From: Andy Shevchenko Date: Tue, 16 Feb 2021 15:50:48 +0000 (+0200) Subject: leds: lp50xx: Get rid of redundant check in lp50xx_enable_disable() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5d2bfb3fb95b2d448c0fbcaa2c58b215b2fa87fc;p=linux.git leds: lp50xx: Get rid of redundant check in lp50xx_enable_disable() 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 --- diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c index 0723b26885524..ae82d4d7c9f3c 100644 --- a/drivers/leds/leds-lp50xx.c +++ b/drivers/leds/leds-lp50xx.c @@ -382,11 +382,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);