From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Hans de Goede <hdegoede@redhat.com>,
Ferry Toth <ftoth@exalondelft.nl>
Subject: [PATCH v1 3/3] gpiolib: Make debug messages in gpiod_find_by_fwnode() less confusing
Date: Thu, 19 Oct 2023 20:34:57 +0300 [thread overview]
Message-ID: <20231019173457.2445119-4-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20231019173457.2445119-1-andriy.shevchenko@linux.intel.com>
Currently the extended debug messages have added confusion,
but value when con_id is NULL, which is the case for, e.g.,
GPIO LEDs.
Improve the messaging by using GPIO function name rather than con_id.
This requires to split and move the second part after the respective
calls.
Reported-by: Ferry Toth <ftoth@exalondelft.nl>
Fixes: 8eb1f71e7acc ("gpiolib: consolidate GPIO lookups")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/gpio/gpiolib.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index beac3031246e..2cc275fb62b6 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -3946,18 +3946,15 @@ static struct gpio_desc *gpiod_find_by_fwnode(struct fwnode_handle *fwnode,
struct gpio_desc *desc = ERR_PTR(-ENOENT);
if (is_of_node(fwnode)) {
- dev_dbg(consumer, "using DT '%pfw' for '%s' GPIO lookup\n",
- fwnode, con_id);
+ dev_dbg(consumer, "using DT '%pfw' for GPIO lookup\n", fwnode);
desc = of_find_gpio(to_of_node(fwnode), con_id, idx, propname, propsize,
lookupflags);
} else if (is_acpi_node(fwnode)) {
- dev_dbg(consumer, "using ACPI '%pfw' for '%s' GPIO lookup\n",
- fwnode, con_id);
+ dev_dbg(consumer, "using ACPI '%pfw' for GPIO lookup\n", fwnode);
desc = acpi_find_gpio(fwnode, con_id, idx, propname, propsize,
flags, lookupflags);
} else if (is_software_node(fwnode)) {
- dev_dbg(consumer, "using swnode '%pfw' for '%s' GPIO lookup\n",
- fwnode, con_id);
+ dev_dbg(consumer, "using swnode '%pfw' for GPIO lookup\n", fwnode);
desc = swnode_find_gpio(fwnode, con_id, idx, propname, propsize,
lookupflags);
}
@@ -3993,10 +3990,12 @@ static struct gpio_desc *gpiod_find_and_request(struct device *consumer,
}
if (IS_ERR(desc)) {
- dev_dbg(consumer, "No GPIO consumer %s found\n", con_id);
+ dev_dbg(consumer, "No GPIO descriptor for '%s' found\n", funcname);
return desc;
}
+ dev_dbg(consumer, "Found GPIO descriptor for '%s'\n", funcname);
+
/*
* If a connection label was passed use that, else attempt to use
* the device name as label
@@ -4015,13 +4014,13 @@ static struct gpio_desc *gpiod_find_and_request(struct device *consumer,
* FIXME: Make this more sane and safe.
*/
dev_info(consumer,
- "nonexclusive access to GPIO for %s\n", con_id);
+ "nonexclusive access to GPIO for %s\n", funcname);
return desc;
}
ret = gpiod_configure_flags(desc, funcname, lookupflags, flags);
if (ret < 0) {
- dev_dbg(consumer, "setup of GPIO %s failed\n", con_id);
+ dev_dbg(consumer, "setup of GPIO %s failed\n", funcname);
gpiod_put(desc);
return ERR_PTR(ret);
}
--
2.40.0.1.gaa8946217a0b
next prev parent reply other threads:[~2023-10-19 17:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 17:34 [PATCH v1 0/3] gpiolib: acpi: More fixes to the consolidation rework Andy Shevchenko
2023-10-19 17:34 ` [PATCH v1 1/3] gpiolib: acpi: Add missing memset(0) to acpi_get_gpiod_from_data() Andy Shevchenko
2023-10-19 19:20 ` Dmitry Torokhov
2023-10-20 9:25 ` Bartosz Golaszewski
2023-10-19 17:34 ` [PATCH v1 2/3] gpiolib: Fix debug messaging in gpiod_find_and_request() Andy Shevchenko
2023-10-19 19:21 ` Dmitry Torokhov
2023-11-14 15:29 ` Andy Shevchenko
2023-11-14 21:18 ` Dmitry Torokhov
2023-11-15 1:37 ` andy.shevchenko
2023-11-15 14:57 ` Dmitry Torokhov
2024-03-20 15:05 ` Andy Shevchenko
2023-11-14 20:26 ` Linus Walleij
2023-10-19 17:34 ` Andy Shevchenko [this message]
2023-11-14 20:29 ` [PATCH v1 3/3] gpiolib: Make debug messages in gpiod_find_by_fwnode() less confusing Linus Walleij
2023-10-20 11:50 ` [PATCH v1 0/3] gpiolib: acpi: More fixes to the consolidation rework Ferry Toth
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=20231019173457.2445119-4-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=dmitry.torokhov@gmail.com \
--cc=ftoth@exalondelft.nl \
--cc=hdegoede@redhat.com \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.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;
as well as URLs for NNTP newsgroup(s).