Skip to content

Commit

Permalink
gpio: pca953x: log an error when failing to get the reset GPIO
Browse files Browse the repository at this point in the history
When the dirver fails getting this GPIO, it fails silently. Log an error
message to make debugging a lot easier by just reading dmesg.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Fixes: 054ccde ("gpio: pca953x: Add optional reset gpio control")
Link: https://lore.kernel.org/r/20241219-pca953x-log-no-reset-gpio-v1-1-9aa7bcc45ead@bootlin.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
  • Loading branch information
Luca Ceresoli authored and Bartosz Golaszewski committed Dec 20, 2024
1 parent 83a9752 commit 7cef813
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpio/gpio-pca953x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,8 @@ static int pca953x_probe(struct i2c_client *client)
*/
reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(reset_gpio))
return PTR_ERR(reset_gpio);
return dev_err_probe(dev, PTR_ERR(reset_gpio),
"Failed to get reset gpio\n");
}

chip->client = client;
Expand Down

0 comments on commit 7cef813

Please sign in to comment.