leds: lp8860: Remove unused of_gpio,h
PATCH 1/2 leds: lp8860: Remove unused of_gpio,h
of_gpio.h provides a single function, which is not used in this driver. Remove unused header.
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/leds/leds-lp8860.c | 1 - 1 file changed, 1 deletion(-)
drivers/leds/leds-lp8860.c +0 -1
@@ -15,7 +15,6 @@#include <linux/module.h> #include <linux/mutex.h> #include <linux/of.h> -#include <linux/of_gpio.h> #include <linux/gpio/consumer.h> #include <linux/slab.h>
Signature · 1 line
2.39.1
PATCH 2/2 leds: lp8860: Remove duplicate NULL checks
gpiod_*() API check already for the NULL, no need
to repeat that in the driver.
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/leds/leds-lp8860.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/leds/leds-lp8860.c +3 -6
@@ -249,8 +249,7 @@ static int lp8860_init(struct lp8860_led *led) } } -if (led->enable_gpio) -gpiod_direction_output (led->enable_gpio,1 ); +gpiod_direction_output (led->enable_gpio,1 ); ret =lp8860_fault_check (led);if (ret)
@@ -293,8 +292,7 @@ static int lp8860_init(struct lp8860_led *led) out:if (ret) -if (led->enable_gpio) -gpiod_direction_output (led->enable_gpio,0 ); +gpiod_direction_output (led->enable_gpio,0 );if (led->regulator) { ret =regulator_disable (led->regulator);
@@ -448,8 +446,7 @@ static void lp8860_remove(struct i2c_client *client)struct lp8860_led *led =i2c_get_clientdata (client);int ret; -if (led->enable_gpio) -gpiod_direction_output (led->enable_gpio,0 ); +gpiod_direction_output (led->enable_gpio,0 );if (led->regulator) { ret =regulator_disable (led->regulator);
Signature · 1 line
2.39.1
Re: [PATCH v1 2/2] leds: lp8860: Remove duplicate NULL checks
Quoted 7 lines · Andy Shevchenko
gpiod_*() API check already for the NULL, no need
to repeat that in the driver.Signed-off-by Andy Shevchenko <[email protected]>--- drivers/leds/leds-lp8860.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Applied, thanks
Signature · 1 line
Lee Jones [李琼斯]
Quoted 7 lines · Andy Shevchenko
of_gpio.hprovides a single function, which is not used in this driver. Remove unused header.Signed-off-by Andy Shevchenko <[email protected]>--- drivers/leds/leds-lp8860.c | 1 - 1 file changed, 1 deletion(-)
Applied, thanks
Signature · 1 line
Lee Jones [李琼斯]