All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Wahren <wahrenst@gmx.net>
To: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>
Cc: bcm-kernel-feedback-list@broadcom.com,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-leds@vger.kernel.org, Stefan Wahren <wahrenst@gmx.net>
Subject: [PATCH 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
Date: Sun,  5 Nov 2023 16:49:39 +0100	[thread overview]
Message-ID: <20231105154940.97688-2-wahrenst@gmx.net> (raw)
In-Reply-To: <20231105154940.97688-1-wahrenst@gmx.net>

In case leds-gpio fails to get the GPIO from the DT (e.g. the GPIO is
already requested) the driver doesn't provide any helpful error log:

    leds-gpio: probe of leds failed with error -16

So add a new error log in case devm_fwnode_gpiod_get() fails.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 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 710c319ad312..284a9e66fd9e 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -172,6 +172,8 @@ static struct gpio_leds_priv *gpio_leds_create(struct device *dev)
 		led.gpiod = devm_fwnode_gpiod_get(dev, child, NULL, GPIOD_ASIS,
 						  NULL);
 		if (IS_ERR(led.gpiod)) {
+			dev_err(dev, "Failed to get gpio '%pfw': %ld\n",
+				child, PTR_ERR(led.gpiod));
 			fwnode_handle_put(child);
 			return ERR_CAST(led.gpiod);
 		}
--
2.34.1


WARNING: multiple messages have this Message-ID (diff)
From: Stefan Wahren <wahrenst@gmx.net>
To: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>
Cc: bcm-kernel-feedback-list@broadcom.com,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-leds@vger.kernel.org, Stefan Wahren <wahrenst@gmx.net>
Subject: [PATCH 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails
Date: Sun,  5 Nov 2023 16:49:39 +0100	[thread overview]
Message-ID: <20231105154940.97688-2-wahrenst@gmx.net> (raw)
In-Reply-To: <20231105154940.97688-1-wahrenst@gmx.net>

In case leds-gpio fails to get the GPIO from the DT (e.g. the GPIO is
already requested) the driver doesn't provide any helpful error log:

    leds-gpio: probe of leds failed with error -16

So add a new error log in case devm_fwnode_gpiod_get() fails.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 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 710c319ad312..284a9e66fd9e 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -172,6 +172,8 @@ static struct gpio_leds_priv *gpio_leds_create(struct device *dev)
 		led.gpiod = devm_fwnode_gpiod_get(dev, child, NULL, GPIOD_ASIS,
 						  NULL);
 		if (IS_ERR(led.gpiod)) {
+			dev_err(dev, "Failed to get gpio '%pfw': %ld\n",
+				child, PTR_ERR(led.gpiod));
 			fwnode_handle_put(child);
 			return ERR_CAST(led.gpiod);
 		}
--
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-11-05 15:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-05 15:49 [PATCH 0/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Stefan Wahren
2023-11-05 15:49 ` Stefan Wahren
2023-11-05 15:49 ` Stefan Wahren [this message]
2023-11-05 15:49   ` [PATCH 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails Stefan Wahren
2023-11-06 11:19   ` Andy Shevchenko
2023-11-06 11:19     ` Andy Shevchenko
2023-11-18 12:31     ` Stefan Wahren
2023-11-18 12:31       ` Stefan Wahren
2023-11-05 15:49 ` [PATCH 2/2] ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Stefan Wahren
2023-11-05 15:49   ` Stefan Wahren

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=20231105154940.97688-2-wahrenst@gmx.net \
    --to=wahrenst@gmx.net \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.