summaryrefslogtreecommitdiff
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2015-08-18 05:31:10 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-09-03 13:18:23 -0300
commit1e137d92c0c6f162d57ede1ba85c298acde26bdc (patch)
treed10f629a500bec9e5269df28734551f5c132706c /drivers/media/i2c
parent06d3f2e02024912d46e1fc8387c0284c9dfc36ad (diff)
[media] tc358743: make reset gpio optional
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> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/tc358743.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index a4efb6e2e7a2..7a6fdecc7215 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1782,14 +1782,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;