diff mbox series

gpio: pca953x: log an error when failing to get the reset GPIO

Message ID 20241219-pca953x-log-no-reset-gpio-v1-1-9aa7bcc45ead@bootlin.com
State New
Headers show
Series gpio: pca953x: log an error when failing to get the reset GPIO | expand

Commit Message

Luca Ceresoli Dec. 19, 2024, 9:39 a.m. UTC
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>
---
 drivers/gpio/gpio-pca953x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


---
base-commit: 78d4f34e2115b517bcbfe7ec0d018bbbb6f9b0b8
change-id: 20241219-pca953x-log-no-reset-gpio-f57060c93337

Best regards,
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 272febc3230e90baf370811f498383b9fb12cc6f..be4c9981ebc404ad5c1e1b0ba9f9f948122de462 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -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;