All of lore.kernel.org
 help / color / mirror / Atom feed
From: phucduc.bui@gmail.com
To: Sakari Ailus <sakari.ailus@linux.intel.com>,
	Shunqian Zheng <zhengsq@rock-chips.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Walter Werner Schneider <contact@schnwalter.eu>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Jacopo Mondi <jacopo@jmondi.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Luca Weiss <luca@lucaweiss.eu>,
	Hans Verkuil <hverkuil@kernel.org>,
	Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>,
	bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 2/3] media: i2c: ov2732: propagate GPIO errors
Date: Wed,  7 Oct 2026 17:49:38 +0700	[thread overview]
Message-ID: <20261007104940.507820-3-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20261007104940.507820-1-phucduc.bui@gmail.com>

From: bui duc phuc <phucduc.bui@gmail.com>

devm_gpiod_get_optional() returns NULL when an optional GPIO is not
present, but may return -EPROBE_DEFER or other errors.

Check the return values and propagate errors from the powerdown and
reset GPIO lookups.

Fixes: 247b8b855876 ("media: i2c: Add ov2732 image sensor driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 drivers/media/i2c/ov2732.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/media/i2c/ov2732.c b/drivers/media/i2c/ov2732.c
index 40035320fec6..b8009c392d4d 100644
--- a/drivers/media/i2c/ov2732.c
+++ b/drivers/media/i2c/ov2732.c
@@ -665,9 +665,15 @@ static int ov2732_probe(struct i2c_client *client)
 	ov2732->powerdown_gpio = devm_gpiod_get_optional(ov2732->dev,
 							 "powerdown",
 							 GPIOD_OUT_HIGH);
+	if (IS_ERR(ov2732->powerdown_gpio))
+		return dev_err_probe(ov2732->dev, PTR_ERR(ov2732->powerdown_gpio),
+				     "failed to get powerdown GPIO\n");
 
 	ov2732->reset_gpio = devm_gpiod_get_optional(ov2732->dev, "reset",
 						     GPIOD_OUT_HIGH);
+	if (IS_ERR(ov2732->reset_gpio))
+		return dev_err_probe(ov2732->dev, PTR_ERR(ov2732->reset_gpio),
+				     "failed to get reset GPIO\n");
 
 	ov2732->regmap = devm_cci_regmap_init_i2c(client, 16);
 	if (IS_ERR(ov2732->regmap))
-- 
2.43.0


  parent reply	other threads:[~2026-10-07 10:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 10:49 [PATCH 0/3] media: i2c: propagate GPIO errors phucduc.bui
2026-10-07 10:49 ` [PATCH 1/3] media: i2c: ov2685: propagate reset " phucduc.bui
2026-10-07 10:49 ` phucduc.bui [this message]
2026-10-07 10:49 ` [PATCH 3/3] media: i2c: ov5647: propagate pwdn " phucduc.bui
2026-10-07 11:07   ` Dave Stevenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261007104940.507820-3-phucduc.bui@gmail.com \
    --to=phucduc.bui@gmail.com \
    --cc=contact@schnwalter.eu \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=hverkuil@kernel.org \
    --cc=jacopo@jmondi.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=luca@lucaweiss.eu \
    --cc=mchehab@kernel.org \
    --cc=roman.kovalivskyi@globallogic.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=zhengsq@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.