Commit a0428fee authored by Luca Ceresoli's avatar Luca Ceresoli Committed by Wentao Guan
Browse files

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

stable inclusion
from stable-v6.6.76
commit b38f66273f89b5851fb8b667d0503f7a0eb7392d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBW08Q

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b38f66273f89b5851fb8b667d0503f7a0eb7392d



--------------------------------

[ Upstream commit 7cef813a91c468253c80633891393478b9f2c966 ]

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: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
Fixes: 054ccdef ("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: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit b38f66273f89b5851fb8b667d0503f7a0eb7392d)
Signed-off-by: default avatarWentao Guan <guanwentao@uniontech.com>
parent ca66d9ce
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1107,7 +1107,8 @@ static int pca953x_probe(struct i2c_client *client)
		reset_gpio = devm_gpiod_get_optional(&client->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;