mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 22:54:01 +00:00
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>
This commit is contained in:
parent
556f15fe02
commit
5d2bfb3fb9
1 changed files with 3 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue