diff options
author | Raag Jadav <raag.jadav@intel.com> | 2023-06-13 10:50:52 +0200 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-06-14 17:54:49 +0200 |
commit | e95433c367e681dc6d4613706bd74f483a25acd8 (patch) | |
tree | 39697ef9264eb12f887ab5381e8bc3ac56a34ae5 | |
parent | pinctrl: baytrail: Use str_hi_lo() helper (diff) | |
download | linux-e95433c367e681dc6d4613706bd74f483a25acd8.tar.xz linux-e95433c367e681dc6d4613706bd74f483a25acd8.zip |
pinctrl: intel: refine ->set_mux() hook
Utilize a temporary variable for common shift operation in
->set_mux() hook and improve readability while saving a few bytes.
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-3 (-3)
Function old new delta
intel_pinmux_set_mux 245 242 -3
Total: Before=10472, After=10469, chg -0.03%
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20230613085054.10976-2-raag.jadav@intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-intel.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index c7a71c49df0a..e8adf2580321 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -411,18 +411,19 @@ static int intel_pinmux_set_mux(struct pinctrl_dev *pctldev, /* Now enable the mux setting for each pin in the group */ for (i = 0; i < grp->grp.npins; i++) { void __iomem *padcfg0; - u32 value; + u32 value, pmode; padcfg0 = intel_get_padcfg(pctrl, grp->grp.pins[i], PADCFG0); - value = readl(padcfg0); + value = readl(padcfg0); value &= ~PADCFG0_PMODE_MASK; if (grp->modes) - value |= grp->modes[i] << PADCFG0_PMODE_SHIFT; + pmode = grp->modes[i]; else - value |= grp->mode << PADCFG0_PMODE_SHIFT; + pmode = grp->mode; + value |= pmode << PADCFG0_PMODE_SHIFT; writel(value, padcfg0); } |