]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
leds: lp50xx: Get rid of redundant check in lp50xx_enable_disable()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 5 Jan 2026 16:48:06 +0000 (11:48 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:12:07 +0000 (13:12 +0100)
[ Upstream commit 5d2bfb3fb95b2d448c0fbcaa2c58b215b2fa87fc ]

Since GPIO is optional the API is NULL aware and will check descriptor anyway.
Remove duplicate redundant check in lp50xx_enable_disable().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Stable-dep-of: 434959618c47 ("leds: leds-lp50xx: Enable chip before any communication")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/leds/leds-lp50xx.c

index 3dc94cb8705bcfdd0276daa4c5b195b593511126..918cd69cfbf6c72b1fee1c947808279d5db334fb 100644 (file)
@@ -380,11 +380,9 @@ static int lp50xx_enable_disable(struct lp50xx *priv, int enable_disable)
 {
        int ret;
 
-       if (priv->enable_gpio) {
-               ret = gpiod_direction_output(priv->enable_gpio, enable_disable);
-               if (ret)
-                       return ret;
-       }
+       ret = gpiod_direction_output(priv->enable_gpio, enable_disable);
+       if (ret)
+               return ret;
 
        if (enable_disable)
                return regmap_write(priv->regmap, LP50XX_DEV_CFG0, LP50XX_CHIP_EN);