[PATCH 3/3] media: i2c: ov5647: propagate pwdn GPIO errors
From: phucduc . bui
Date: Wed Oct 07 2026 - 07:14:08 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
devm_gpiod_get_optional() may return -EPROBE_DEFER or other errors,
but ov5647_probe() currently converts them to -EINVAL.
Use dev_err_probe() to propagate the original error from the pwdn GPIO
lookup.
Fixes: b050791d287a ("media: ov5647: Add support for PWDN GPIO.")
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
drivers/media/i2c/ov5647.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index 3facf92b3841..b3049761a5fb 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -1186,10 +1186,9 @@ static int ov5647_probe(struct i2c_client *client)
/* Request the power down GPIO asserted. */
sensor->pwdn = devm_gpiod_get_optional(dev, "pwdn", GPIOD_OUT_HIGH);
- if (IS_ERR(sensor->pwdn)) {
- dev_err(dev, "Failed to get 'pwdn' gpio\n");
- return -EINVAL;
- }
+ if (IS_ERR(sensor->pwdn))
+ return dev_err_probe(dev, PTR_ERR(sensor->pwdn),
+ "Failed to get 'pwdn' gpio\n");
ret = ov5647_configure_regulators(dev, sensor);
if (ret)
--
2.43.0