summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorFabio Estevam <festevam@denx.de>2024-08-21 08:42:02 -0300
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2024-08-21 14:28:55 +0200
commitb41a9bf2c64eea119bb6cbef420345f547b9a677 (patch)
tree5a98a2dd2ff5b4be4e5a7b4adb7256c330677130 /drivers/gpio
parent2a4727e6a8bd1d2b8ae7abf95061eda0457c4d79 (diff)
downloadlinux-b41a9bf2c64eea119bb6cbef420345f547b9a677.tar.gz
linux-b41a9bf2c64eea119bb6cbef420345f547b9a677.tar.bz2
linux-b41a9bf2c64eea119bb6cbef420345f547b9a677.zip
gpio: pca953x: Print the error code on read/write failures
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> Link: https://lore.kernel.org/r/20240821114202.2072220-1-festevam@gmail.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-pca953x.c4
1 files 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;
}