linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds: gpio: set led_dat->gpiod pointer for OF defined GPIO leds
@ 2018-10-18  0:14 Liviu Dudau
  2018-10-23 11:18 ` Liviu Dudau
  2018-10-25 12:55 ` Linus Walleij
  0 siblings, 2 replies; 5+ messages in thread
From: Liviu Dudau @ 2018-10-18  0:14 UTC (permalink / raw)
  To: Jacek Anaszewski
  Cc: Linus Walleij, Pavel Machek, linux-leds, LKML, Liviu Dudau

Commit 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
removed the common code path that set the led_dat->gpiod pointer in
create_gpio_led(), but only added it back for the devices that have
a valid gpio_led_platform_data structure. Calling gpio_leds_create()
in gpio_led_probe() is not enough to get a valid gpiod pointer.

Fortunately enough, gpio_leds_create() already gets the needed pointer,
we just need to assign it to the relevant gpio_led_data structure.

Fixes: 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: Liviu Dudau <liviu@dudau.co.uk>
---

Hi,

I found this issue while testing linux-next-20181017, I don't know how
stable the leds for-next tree is in terms of commit IDs, if that gets
rebased then the Fixes commit ID needs updating.

Best regards,
Liviu

 drivers/leds/leds-gpio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 32fa752565bc..45e012093865 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -163,6 +163,8 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)
 			return ERR_CAST(led.gpiod);
 		}
 
+		led_dat->gpiod = led.gpiod;
+
 		fwnode_property_read_string(child, "linux,default-trigger",
 					    &led.default_trigger);
 
-- 
2.19.0


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

* Re: [PATCH] leds: gpio: set led_dat->gpiod pointer for OF defined GPIO leds
  2018-10-18  0:14 [PATCH] leds: gpio: set led_dat->gpiod pointer for OF defined GPIO leds Liviu Dudau
@ 2018-10-23 11:18 ` Liviu Dudau
  2018-10-25 13:08   ` Pavel Machek
  2018-10-25 19:18   ` Jacek Anaszewski
  2018-10-25 12:55 ` Linus Walleij
  1 sibling, 2 replies; 5+ messages in thread
From: Liviu Dudau @ 2018-10-23 11:18 UTC (permalink / raw)
  To: Jacek Anaszewski; +Cc: Linus Walleij, Pavel Machek, linux-leds, LKML

On Thu, Oct 18, 2018 at 01:14:32AM +0100, Liviu Dudau wrote:
> Commit 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
> removed the common code path that set the led_dat->gpiod pointer in
> create_gpio_led(), but only added it back for the devices that have
> a valid gpio_led_platform_data structure. Calling gpio_leds_create()
> in gpio_led_probe() is not enough to get a valid gpiod pointer.
> 
> Fortunately enough, gpio_leds_create() already gets the needed pointer,
> we just need to assign it to the relevant gpio_led_data structure.
> 
> Fixes: 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> Signed-off-by: Liviu Dudau <liviu@dudau.co.uk>
> ---

Gentle ping! I haven't seen any reply to this, even if the commit it fixes is
still in for-next branch.

Best regards,
Liviu

> 
> Hi,
> 
> I found this issue while testing linux-next-20181017, I don't know how
> stable the leds for-next tree is in terms of commit IDs, if that gets
> rebased then the Fixes commit ID needs updating.
> 
> Best regards,
> Liviu
> 
>  drivers/leds/leds-gpio.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index 32fa752565bc..45e012093865 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -163,6 +163,8 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)
>  			return ERR_CAST(led.gpiod);
>  		}
>  
> +		led_dat->gpiod = led.gpiod;
> +
>  		fwnode_property_read_string(child, "linux,default-trigger",
>  					    &led.default_trigger);
>  
> -- 
> 2.19.0
> 

-- 
             /`\
            / : |
   _.._     | '/
 /`    \    | /
|  .-._ '-"` (
|_/   /   o  o\
      |  == () ==
       \   -- /                       ______________________________________
       / ---<_              ________|                                      |_______
      |      \\             \       |  I would like to fix the world but   |      /
      | |     \\__           \      |   no one gives me the source code.   |     /
      / ;     |.__)          /      |______________________________________|     \
     (_/.-.   ;             /__________)                                (_________\
    { `|   \_/
     '-\   / |
        | /  |
       /  \  '-.
       \__|-----'

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

* Re: [PATCH] leds: gpio: set led_dat->gpiod pointer for OF defined GPIO leds
  2018-10-18  0:14 [PATCH] leds: gpio: set led_dat->gpiod pointer for OF defined GPIO leds Liviu Dudau
  2018-10-23 11:18 ` Liviu Dudau
@ 2018-10-25 12:55 ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2018-10-25 12:55 UTC (permalink / raw)
  To: liviu; +Cc: Jacek Anaszewski, Pavel Machek, linux-leds, linux-kernel

On Thu, Oct 18, 2018 at 2:14 AM Liviu Dudau <liviu@dudau.co.uk> wrote:

> Commit 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
> removed the common code path that set the led_dat->gpiod pointer in
> create_gpio_led(), but only added it back for the devices that have
> a valid gpio_led_platform_data structure. Calling gpio_leds_create()
> in gpio_led_probe() is not enough to get a valid gpiod pointer.
>
> Fortunately enough, gpio_leds_create() already gets the needed pointer,
> we just need to assign it to the relevant gpio_led_data structure.
>
> Fixes: 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> Signed-off-by: Liviu Dudau <liviu@dudau.co.uk>

Ooops
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH] leds: gpio: set led_dat->gpiod pointer for OF defined GPIO leds
  2018-10-23 11:18 ` Liviu Dudau
@ 2018-10-25 13:08   ` Pavel Machek
  2018-10-25 19:18   ` Jacek Anaszewski
  1 sibling, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2018-10-25 13:08 UTC (permalink / raw)
  To: Liviu Dudau; +Cc: Jacek Anaszewski, Linus Walleij, linux-leds, LKML

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

On Tue 2018-10-23 12:18:44, Liviu Dudau wrote:
> On Thu, Oct 18, 2018 at 01:14:32AM +0100, Liviu Dudau wrote:
> > Commit 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
> > removed the common code path that set the led_dat->gpiod pointer in
> > create_gpio_led(), but only added it back for the devices that have
> > a valid gpio_led_platform_data structure. Calling gpio_leds_create()
> > in gpio_led_probe() is not enough to get a valid gpiod pointer.
> > 
> > Fortunately enough, gpio_leds_create() already gets the needed pointer,
> > we just need to assign it to the relevant gpio_led_data structure.
> > 
> > Fixes: 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> > Signed-off-by: Liviu Dudau <liviu@dudau.co.uk>

Acked-by: Pavel Machek <pavel@ucw.cz>

-- 
(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] 5+ messages in thread

* Re: [PATCH] leds: gpio: set led_dat->gpiod pointer for OF defined GPIO leds
  2018-10-23 11:18 ` Liviu Dudau
  2018-10-25 13:08   ` Pavel Machek
@ 2018-10-25 19:18   ` Jacek Anaszewski
  1 sibling, 0 replies; 5+ messages in thread
From: Jacek Anaszewski @ 2018-10-25 19:18 UTC (permalink / raw)
  To: Liviu Dudau; +Cc: Linus Walleij, Pavel Machek, linux-leds, LKML

Hi Liviu,

Thank you for the patch.

On 10/23/2018 01:18 PM, Liviu Dudau wrote:
> On Thu, Oct 18, 2018 at 01:14:32AM +0100, Liviu Dudau wrote:
>> Commit 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
>> removed the common code path that set the led_dat->gpiod pointer in
>> create_gpio_led(), but only added it back for the devices that have
>> a valid gpio_led_platform_data structure. Calling gpio_leds_create()
>> in gpio_led_probe() is not enough to get a valid gpiod pointer.
>>
>> Fortunately enough, gpio_leds_create() already gets the needed pointer,
>> we just need to assign it to the relevant gpio_led_data structure.
>>
>> Fixes: 45d4c6de4e49 ("leds: gpio: Try to lookup gpiod from device")
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
>> Signed-off-by: Liviu Dudau <liviu@dudau.co.uk>
>> ---
> 
> Gentle ping! I haven't seen any reply to this, even if the commit it fixes is
> still in for-next branch.

I found this message in the Spam folder of my gmail mailbox.
It can have something in common with the ASCII art in your signature.

Anyway, I've just applied the patch to the fixes-for-4.20-rc2 branch
of linux-leds.git.

Best regards,
Jacek Anaszewski

> 
>>
>> Hi,
>>
>> I found this issue while testing linux-next-20181017, I don't know how
>> stable the leds for-next tree is in terms of commit IDs, if that gets
>> rebased then the Fixes commit ID needs updating.
>>
>> Best regards,
>> Liviu
>>
>>  drivers/leds/leds-gpio.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
>> index 32fa752565bc..45e012093865 100644
>> --- a/drivers/leds/leds-gpio.c
>> +++ b/drivers/leds/leds-gpio.c
>> @@ -163,6 +163,8 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)
>>  			return ERR_CAST(led.gpiod);
>>  		}
>>  
>> +		led_dat->gpiod = led.gpiod;
>> +
>>  		fwnode_property_read_string(child, "linux,default-trigger",
>>  					    &led.default_trigger);
>>  
>> -- 
>> 2.19.0
>>
> 


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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-18  0:14 [PATCH] leds: gpio: set led_dat->gpiod pointer for OF defined GPIO leds Liviu Dudau
2018-10-23 11:18 ` Liviu Dudau
2018-10-25 13:08   ` Pavel Machek
2018-10-25 19:18   ` Jacek Anaszewski
2018-10-25 12:55 ` Linus Walleij

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