Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1fc86ad0 authored by Fabio Estevam's avatar Fabio Estevam Committed by Mauro Carvalho Chehab
Browse files

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: default avatarFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 011dfab8
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1615,7 +1615,9 @@ static int ov7670_probe(struct i2c_client *client,
	info->clk = devm_clk_get(&client->dev, "xclk");
	info->clk = devm_clk_get(&client->dev, "xclk");
	if (IS_ERR(info->clk))
	if (IS_ERR(info->clk))
		return PTR_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);
	ret = ov7670_init_gpio(client, info);
	if (ret)
	if (ret)