[PATCH 1/3] media: i2c: ov2685: propagate reset GPIO errors

From: phucduc . bui

Date: Wed Oct 07 2026 - 08:18:05 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

devm_gpiod_get_optional() may return -EPROBE_DEFER or other errors,
but ov2685_probe() currently converts them all to -EINVAL.

Use dev_err_probe() to propagate the original error from the reset GPIO
lookup.

Fixes: 0482fbb1c1cc ("media: i2c: ov2685: Make reset gpio optional")
Fixes: e3861d9118c8 ("media: ov2685: add support for OV2685 sensor")
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
drivers/media/i2c/ov2685.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c
index 4911a4eea126..92d0f90b3d37 100644
--- a/drivers/media/i2c/ov2685.c
+++ b/drivers/media/i2c/ov2685.c
@@ -793,10 +793,9 @@ static int ov2685_probe(struct i2c_client *client)
dev_warn(dev, "xvclk mismatched, modes are based on 24MHz\n");

ov2685->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
- if (IS_ERR(ov2685->reset_gpio)) {
- dev_err(dev, "Failed to get reset-gpios\n");
- return -EINVAL;
- }
+ if (IS_ERR(ov2685->reset_gpio))
+ return dev_err_probe(dev, PTR_ERR(ov2685->reset_gpio),
+ "Failed to get reset-gpios\n");

ret = ov2685_configure_regulators(ov2685);
if (ret) {
--
2.43.0