linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] leds: lp8860: Remove unused of_gpio,h
@ 2023-02-15 17:04 Andy Shevchenko
  2023-02-15 17:04 ` [PATCH v1 2/2] leds: lp8860: Remove duplicate NULL checks Andy Shevchenko
  2023-03-03 10:28 ` [PATCH v1 1/2] leds: lp8860: Remove unused of_gpio,h Lee Jones
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2023-02-15 17:04 UTC (permalink / raw)
  To: Andy Shevchenko, linux-leds, linux-kernel; +Cc: Pavel Machek, Lee Jones

of_gpio.h provides a single function, which is not used in this driver.
Remove unused header.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/leds/leds-lp8860.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c
index b66ed5ac1aa5..666f4d38214f 100644
--- a/drivers/leds/leds-lp8860.c
+++ b/drivers/leds/leds-lp8860.c
@@ -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>
 
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v1 2/2] leds: lp8860: Remove duplicate NULL checks
  2023-02-15 17:04 [PATCH v1 1/2] leds: lp8860: Remove unused of_gpio,h Andy Shevchenko
@ 2023-02-15 17:04 ` Andy Shevchenko
  2023-03-03 10:30   ` Lee Jones
  2023-03-03 10:28 ` [PATCH v1 1/2] leds: lp8860: Remove unused of_gpio,h Lee Jones
  1 sibling, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2023-02-15 17:04 UTC (permalink / raw)
  To: Andy Shevchenko, linux-leds, linux-kernel; +Cc: Pavel Machek, Lee Jones

gpiod_*() API check already for the NULL, no need
to repeat that in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/leds/leds-lp8860.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c
index 666f4d38214f..221b386443bc 100644
--- a/drivers/leds/leds-lp8860.c
+++ b/drivers/leds/leds-lp8860.c
@@ -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);
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/2] leds: lp8860: Remove unused of_gpio,h
  2023-02-15 17:04 [PATCH v1 1/2] leds: lp8860: Remove unused of_gpio,h Andy Shevchenko
  2023-02-15 17:04 ` [PATCH v1 2/2] leds: lp8860: Remove duplicate NULL checks Andy Shevchenko
@ 2023-03-03 10:28 ` Lee Jones
  1 sibling, 0 replies; 4+ messages in thread
From: Lee Jones @ 2023-03-03 10:28 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-leds, linux-kernel, Pavel Machek

On Wed, 15 Feb 2023, Andy Shevchenko wrote:

> of_gpio.h provides a single function, which is not used in this driver.
> Remove unused header.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/leds/leds-lp8860.c | 1 -
>  1 file changed, 1 deletion(-)

Applied, thanks

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 2/2] leds: lp8860: Remove duplicate NULL checks
  2023-02-15 17:04 ` [PATCH v1 2/2] leds: lp8860: Remove duplicate NULL checks Andy Shevchenko
@ 2023-03-03 10:30   ` Lee Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2023-03-03 10:30 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-leds, linux-kernel, Pavel Machek

On Wed, 15 Feb 2023, Andy Shevchenko wrote:

> gpiod_*() API check already for the NULL, no need
> to repeat that in the driver.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/leds/leds-lp8860.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)

Applied, thanks

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-03 10:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-15 17:04 [PATCH v1 1/2] leds: lp8860: Remove unused of_gpio,h Andy Shevchenko
2023-02-15 17:04 ` [PATCH v1 2/2] leds: lp8860: Remove duplicate NULL checks Andy Shevchenko
2023-03-03 10:30   ` Lee Jones
2023-03-03 10:28 ` [PATCH v1 1/2] leds: lp8860: Remove unused of_gpio,h Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).