From: Andy Shevchenko Date: Mon, 5 Jan 2026 16:48:06 +0000 (-0500) Subject: leds: lp50xx: Get rid of redundant check in lp50xx_enable_disable() X-Git-Tag: v5.10.248~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cf9f0f654fda2438a9c7a6bba87dc725c0b2789;p=thirdparty%2Fkernel%2Fstable.git leds: lp50xx: Get rid of redundant check in lp50xx_enable_disable() [ 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 Signed-off-by: Pavel Machek Stable-dep-of: 434959618c47 ("leds: leds-lp50xx: Enable chip before any communication") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c index 3dc94cb8705bc..918cd69cfbf6c 100644 --- a/drivers/leds/leds-lp50xx.c +++ b/drivers/leds/leds-lp50xx.c @@ -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);