diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2017-07-18 23:34:19 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-08-08 06:24:58 -0400 |
commit | 1fc86ad052fc051639df1f60faeb619dbe567e07 (patch) | |
tree | 4d0bf883c7aca950550344f7232ff723f3659e52 /drivers/media/i2c/ov7670.c | |
parent | 011dfab80543019d01f66665734f50f5a4b26e6d (diff) | |
download | linux-1fc86ad052fc051639df1f60faeb619dbe567e07.tar.bz2 |
media: ov7670: Check the return value from clk_prepare_enable()
clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c/ov7670.c')
-rw-r--r-- | drivers/media/i2c/ov7670.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c index 552a881e24da..e88549f0e704 100644 --- a/drivers/media/i2c/ov7670.c +++ b/drivers/media/i2c/ov7670.c @@ -1615,7 +1615,9 @@ static int ov7670_probe(struct i2c_client *client, info->clk = devm_clk_get(&client->dev, "xclk"); if (IS_ERR(info->clk)) return PTR_ERR(info->clk); - clk_prepare_enable(info->clk); + ret = clk_prepare_enable(info->clk); + if (ret) + return ret; ret = ov7670_init_gpio(client, info); if (ret) |