diff options
author | Raag Jadav <raag.jadav@intel.com> | 2023-06-17 02:03:54 +0530 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-06-19 13:53:26 +0300 |
commit | 5a9fa4c2cd538fe7e244e33aca1a2c87dd0c2471 (patch) | |
tree | 4f00a556f7cac2693c9e02d8014b56f8d3c6fccb /drivers/pinctrl | |
parent | d1bfdf867d5064b8aa1b5436882080a2e7945cfb (diff) |
pinctrl: baytrail: reduce scope of spinlock in ->dbg_show() hook
Reduce scope of spinlock to IO operations in ->dbg_show() hook
and save a few bytes.
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-12 (-12)
Function old new delta
byt_gpio_dbg_show 890 878 -12
Total: Before=17029, After=17017, chg -0.07%
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20230616203356.27343-2-raag.jadav@intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-baytrail.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index d53952f5c87c..54d3c5c26944 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c @@ -1241,30 +1241,30 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) for (i = 0; i < vg->soc->npins; i++) { const struct intel_community *comm; + void __iomem *conf_reg, *val_reg; const char *pull_str = NULL; const char *pull = NULL; - void __iomem *reg; unsigned long flags; const char *label; unsigned int pin; - raw_spin_lock_irqsave(&byt_lock, flags); pin = vg->soc->pins[i].number; - reg = byt_gpio_reg(vg, pin, BYT_CONF0_REG); - if (!reg) { + + conf_reg = byt_gpio_reg(vg, pin, BYT_CONF0_REG); + if (!conf_reg) { seq_printf(s, "Pin %i: can't retrieve CONF0\n", pin); - raw_spin_unlock_irqrestore(&byt_lock, flags); continue; } - conf0 = readl(reg); - reg = byt_gpio_reg(vg, pin, BYT_VAL_REG); - if (!reg) { + val_reg = byt_gpio_reg(vg, pin, BYT_VAL_REG); + if (!val_reg) { seq_printf(s, "Pin %i: can't retrieve VAL\n", pin); - raw_spin_unlock_irqrestore(&byt_lock, flags); continue; } - val = readl(reg); + + raw_spin_lock_irqsave(&byt_lock, flags); + conf0 = readl(conf_reg); + val = readl(val_reg); raw_spin_unlock_irqrestore(&byt_lock, flags); comm = byt_get_community(vg, pin); |