]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pinctrl: intel: move PWM base computation past feature check
authorStepan Ionichev <sozdayvek@gmail.com>
Sun, 17 May 2026 16:15:30 +0000 (21:15 +0500)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 18 May 2026 07:01:17 +0000 (09:01 +0200)
Compute base inside intel_pinctrl_probe_pwm() only after the
PINCTRL_FEATURE_PWM and CONFIG_PWM_LPSS checks have passed. Tidy
up; no functional change.

Suggested-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/linux-gpio/aglu5jy5SbW9Wjwj@ashevche-desk.local/
Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/pinctrl/intel/pinctrl-intel.c

index 97bf5ec78db4e06121694e8d1cac2a2a7faa8b9c..2e2526e01d58362d5fe8201b259ff6816f683185 100644 (file)
@@ -1556,13 +1556,13 @@ static int intel_pinctrl_probe_pwm(struct intel_pinctrl *pctrl,
                                   struct intel_community *community,
                                   unsigned short capability_offset)
 {
-       void __iomem *base = community->regs + capability_offset + 4;
        static const struct pwm_lpss_boardinfo info = {
                .clk_rate = 19200000,
                .npwm = 1,
                .base_unit_bits = 22,
        };
        struct pwm_chip *chip;
+       void __iomem *base;
 
        if (!(community->features & PINCTRL_FEATURE_PWM))
                return 0;
@@ -1570,6 +1570,7 @@ static int intel_pinctrl_probe_pwm(struct intel_pinctrl *pctrl,
        if (!IS_REACHABLE(CONFIG_PWM_LPSS))
                return 0;
 
+       base = community->regs + capability_offset + 4;
        chip = devm_pwm_lpss_probe(pctrl->dev, base, &info);
        return PTR_ERR_OR_ZERO(chip);
 }