mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 05:32:00 +00:00
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>
This commit is contained in:
parent
2a4727e6a8
commit
b41a9bf2c6
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user