linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds: gpio: Fix gpiod for DT based devices
@ 2018-10-25 15:06 Dan Sneddon
  2018-10-25 19:22 ` Jacek Anaszewski
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Sneddon @ 2018-10-25 15:06 UTC (permalink / raw)
  To: jacek.anaszewski, pavel, linux-leds, linux-kernel; +Cc: linus.walleij

commit 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
failes to set the gpio descriptor for DT based machines.  Since the
value being passed in is always 0 the descriptor fails the validation
check but does so silently.  This means the driver probes successfully
even though it can't actually control the gpio line.  This patch sets
the gpio descriptor in the path taken by DT based devices.

Fixes: 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
Signed-off-by: Dan Sneddon <dan.sneddon@gmail.com>
---
 drivers/leds/leds-gpio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 32fa752..e0e57c2 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -162,6 +162,7 @@ static struct gpio_leds_priv
*gpio_leds_create(struct platform_device *pdev)
            fwnode_handle_put(child);
            return ERR_CAST(led.gpiod);
        }
+       led_dat->gpiod = led.gpiod;

        fwnode_property_read_string(child, "linux,default-trigger",
                        &led.default_trigger);
-- 
2.7.4

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

* Re: [PATCH] leds: gpio: Fix gpiod for DT based devices
  2018-10-25 15:06 [PATCH] leds: gpio: Fix gpiod for DT based devices Dan Sneddon
@ 2018-10-25 19:22 ` Jacek Anaszewski
  2018-10-25 20:41   ` Pavel Machek
  0 siblings, 1 reply; 3+ messages in thread
From: Jacek Anaszewski @ 2018-10-25 19:22 UTC (permalink / raw)
  To: Dan Sneddon, pavel, linux-leds, linux-kernel; +Cc: linus.walleij

Hi Dan,

Thank you for the patch. Nonetheless, I've just applied similar Liviu's
patch [0], since it arrived one week ago already.

I'll send it upstream with LED fixes for 4-20-rc2.

[0] https://lkml.org/lkml/2018/10/18/154

Best regards,
Jacek Anaszewski

On 10/25/2018 05:06 PM, Dan Sneddon wrote:
> commit 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
> failes to set the gpio descriptor for DT based machines.  Since the
> value being passed in is always 0 the descriptor fails the validation
> check but does so silently.  This means the driver probes successfully
> even though it can't actually control the gpio line.  This patch sets
> the gpio descriptor in the path taken by DT based devices.
> 
> Fixes: 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
> Signed-off-by: Dan Sneddon <dan.sneddon@gmail.com>
> ---
>  drivers/leds/leds-gpio.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index 32fa752..e0e57c2 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -162,6 +162,7 @@ static struct gpio_leds_priv
> *gpio_leds_create(struct platform_device *pdev)
>             fwnode_handle_put(child);
>             return ERR_CAST(led.gpiod);
>         }
> +       led_dat->gpiod = led.gpiod;
> 
>         fwnode_property_read_string(child, "linux,default-trigger",
>                         &led.default_trigger);
> 



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

* Re: [PATCH] leds: gpio: Fix gpiod for DT based devices
  2018-10-25 19:22 ` Jacek Anaszewski
@ 2018-10-25 20:41   ` Pavel Machek
  0 siblings, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2018-10-25 20:41 UTC (permalink / raw)
  To: Jacek Anaszewski; +Cc: Dan Sneddon, linux-leds, linux-kernel, linus.walleij

[-- Attachment #1: Type: text/plain, Size: 624 bytes --]

On Thu 2018-10-25 21:22:34, Jacek Anaszewski wrote:
> Hi Dan,
> 
> Thank you for the patch. Nonetheless, I've just applied similar Liviu's
> patch [0], since it arrived one week ago already.
> 
> I'll send it upstream with LED fixes for 4-20-rc2.
> 
> [0] https://lkml.org/lkml/2018/10/18/154

If people are hitting it this often, maybe it is time to push it
early? Linus should not have problem taking two pull requests in a
merge window.

Best regards,
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

end of thread, other threads:[~2018-10-25 20:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-25 15:06 [PATCH] leds: gpio: Fix gpiod for DT based devices Dan Sneddon
2018-10-25 19:22 ` Jacek Anaszewski
2018-10-25 20:41   ` Pavel Machek

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).