From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: linus.walleij@linaro.org, brgl@bgdev.pl, andy@kernel.org
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Peng Fan <peng.fan@nxp.com>
Subject: [PATCH V3] gpiolib: use dev_err() when gpiod_configure_flags failed
Date: Fri, 22 Mar 2024 15:37:25 +0800 [thread overview]
Message-ID: <20240322073725.3338266-1-peng.fan@oss.nxp.com> (raw)
From: Peng Fan <peng.fan@nxp.com>
When gpio-ranges property was missed to be added in the gpio node,
using dev_err() to show an error message will helping to locate issues
easier.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
V3:
Move gpiod_put before dev_err per Andy Shevchenko
V2:
Update commit log
drivers/gpio/gpiolib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index ce94e37bcbee..b988704f5d63 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -4233,8 +4233,8 @@ struct gpio_desc *gpiod_find_and_request(struct device *consumer,
ret = gpiod_configure_flags(desc, con_id, lookupflags, flags);
if (ret < 0) {
- dev_dbg(consumer, "setup of GPIO %s failed\n", con_id);
gpiod_put(desc);
+ dev_err(consumer, "setup of GPIO %s failed: %d\n", con_id, ret);
return ERR_PTR(ret);
}
--
2.37.1
next reply other threads:[~2024-03-22 7:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 7:37 Peng Fan (OSS) [this message]
2024-03-22 15:59 ` Andy Shevchenko
2024-03-25 15:48 ` Bartosz Golaszewski
2024-03-25 16:00 ` Andy Shevchenko
2024-03-25 16:24 ` Bartosz Golaszewski
2024-03-25 17:19 ` Andy Shevchenko
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=20240322073725.3338266-1-peng.fan@oss.nxp.com \
--to=peng.fan@oss.nxp.com \
--cc=andy@kernel.org \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
/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
all inboxes | Powered by JetHome®