aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-02-16 17:50:48 +0200
committerPavel Machek <pavel@ucw.cz>2021-02-19 22:15:43 +0100
commit5d2bfb3fb95b2d448c0fbcaa2c58b215b2fa87fc (patch)
treeeb528810b3a897d49650e02fad308a5f4315beae /drivers/leds
parentleds: lp50xx: Reduce level of dereferences (diff)
downloadlinux-dev-5d2bfb3fb95b2d448c0fbcaa2c58b215b2fa87fc.tar.xz
linux-dev-5d2bfb3fb95b2d448c0fbcaa2c58b215b2fa87fc.zip
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 <andriy.shevchenko@linux.intel.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-lp50xx.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c
index 0723b2688552..ae82d4d7c9f3 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);