linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Sneddon <dan.sneddon@gmail.com>
To: jacek.anaszewski@gmail.com, pavel@ucw.cz,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: linus.walleij@linaro.org
Subject: [PATCH] leds: gpio: Fix gpiod for DT based devices
Date: Thu, 25 Oct 2018 08:06:01 -0700	[thread overview]
Message-ID: <CACceFXdF9XQS6WeSWvO=EKUEGnKwG_VkqUOECA3kJY-Hy72fjQ@mail.gmail.com> (raw)

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

             reply	other threads:[~2018-10-25 15:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 15:06 Dan Sneddon [this message]
2018-10-25 19:22 ` [PATCH] leds: gpio: Fix gpiod for DT based devices Jacek Anaszewski
2018-10-25 20:41   ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACceFXdF9XQS6WeSWvO=EKUEGnKwG_VkqUOECA3kJY-Hy72fjQ@mail.gmail.com' \
    --to=dan.sneddon@gmail.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).