[media] tc358743: Handle return value of clk_prepare_enable
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 31 May 2017 09:31:54 +0000 (06:31 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 7 Jun 2017 12:28:05 +0000 (09:28 -0300)
clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/i2c/tc358743.c

index 3e5b090303035dd71102ae4636a34b33ed1ba880..8f8bb9ee3e6db7efc3947a829bd4f318665048cf 100644 (file)
@@ -1731,7 +1731,11 @@ static int tc358743_probe_of(struct tc358743_state *state)
 
        state->bus = endpoint->bus.mipi_csi2;
 
-       clk_prepare_enable(refclk);
+       ret = clk_prepare_enable(refclk);
+       if (ret) {
+               dev_err(dev, "Failed! to enable clock\n");
+               goto free_endpoint;
+       }
 
        state->pdata.refclk_hz = clk_get_rate(refclk);
        state->pdata.ddc5v_delay = DDC5V_DELAY_100_MS;