From: Arvind Yadav Date: Wed, 31 May 2017 09:31:54 +0000 (-0300) Subject: [media] tc358743: Handle return value of clk_prepare_enable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=43b288baa8f39054dc5e7102a329180bbeb1e115;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [media] tc358743: Handle return value of clk_prepare_enable clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index 3e5b09030303..8f8bb9ee3e6d 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -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;