diff mbox

[2/2,media] tc358743: make reset gpio optional

Message ID 1439886670-12322-2-git-send-email-u.kleine-koenig@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Uwe Kleine-König Aug. 18, 2015, 8:31 a.m. UTC
Commit 256148246852 ("[media] tc358743: support probe from device tree")
specified in the device tree binding documentation that the reset gpio
is optional. Make the implementation match accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/media/i2c/tc358743.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Linus Walleij Aug. 19, 2015, 5:56 a.m. UTC | #1
On Tue, Aug 18, 2015 at 10:31 AM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:

> Commit 256148246852 ("[media] tc358743: support probe from device tree")
> specified in the device tree binding documentation that the reset gpio
> is optional. Make the implementation match accordingly.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Philipp Zabel Aug. 19, 2015, 8:31 a.m. UTC | #2
Am Dienstag, den 18.08.2015, 10:31 +0200 schrieb Uwe Kleine-König:
> Commit 256148246852 ("[media] tc358743: support probe from device tree")
> specified in the device tree binding documentation that the reset gpio
> is optional. Make the implementation match accordingly.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

thanks
Philipp

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index 6ca6c0817993..c511b43a6ff8 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1749,14 +1749,16 @@  static int tc358743_probe_of(struct tc358743_state *state)
 	state->pdata.ths_trailcnt = 0x2;
 	state->pdata.hstxvregcnt = 0;
 
-	state->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
+	state->reset_gpio = devm_gpiod_get_optional(dev, "reset",
+						    GPIOD_OUT_LOW);
 	if (IS_ERR(state->reset_gpio)) {
 		dev_err(dev, "failed to get reset gpio\n");
 		ret = PTR_ERR(state->reset_gpio);
 		goto disable_clk;
 	}
 
-	tc358743_gpio_reset(state);
+	if (state->reset_gpio)
+		tc358743_gpio_reset(state);
 
 	ret = 0;
 	goto free_endpoint;