From: Fabio Estevam <festevam@gmail.com>
To: brgl@bgdev.pl
Cc: linus.walleij@linaro.org, linux-gpio@vger.kernel.org,
linux@armlinux.org.uk, Fabio Estevam <festevam@denx.de>
Subject: [PATCH] gpio: pca953x: Print the error code on read/write failures
Date: Wed, 21 Aug 2024 08:42:02 -0300 [thread overview]
Message-ID: <20240821114202.2072220-1-festevam@gmail.com> (raw)
From: Fabio Estevam <festevam@denx.de>
Print the error code in the pca953x_write_regs() and pca953x_read_regs()
functions to help debugging.
Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
drivers/gpio/gpio-pca953x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 8baf3edd5274..3f2d33ee20cc 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -498,7 +498,7 @@ static int pca953x_write_regs(struct pca953x_chip *chip, int reg, unsigned long
ret = regmap_bulk_write(chip->regmap, regaddr, value, NBANK(chip));
if (ret < 0) {
- dev_err(&chip->client->dev, "failed writing register\n");
+ dev_err(&chip->client->dev, "failed writing register: %d\n", ret);
return ret;
}
@@ -513,7 +513,7 @@ static int pca953x_read_regs(struct pca953x_chip *chip, int reg, unsigned long *
ret = regmap_bulk_read(chip->regmap, regaddr, value, NBANK(chip));
if (ret < 0) {
- dev_err(&chip->client->dev, "failed reading register\n");
+ dev_err(&chip->client->dev, "failed reading register: %d\n", ret);
return ret;
}
--
2.34.1
next reply other threads:[~2024-08-21 11:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 11:42 Fabio Estevam [this message]
2024-08-21 12:11 ` [PATCH] gpio: pca953x: Print the error code on read/write failures Bartosz Golaszewski
2024-08-21 12:16 ` Fabio Estevam
2024-08-21 12:28 ` Bartosz Golaszewski
2024-08-21 12:29 ` Bartosz Golaszewski
2024-08-23 15:25 ` 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=20240821114202.2072220-1-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=brgl@bgdev.pl \
--cc=festevam@denx.de \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux@armlinux.org.uk \
/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.