mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
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>
This commit is contained in:
parent
011dfab805
commit
1fc86ad052
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue