Commit bb4e2e24 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Hans Verkuil

media: i2c: ov7670: Use the devm_clk_get_optional() helper

Use devm_clk_get_optional() instead of hand writing it.
This saves some loC and improves the semantic.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 5276c9df
......@@ -1894,14 +1894,9 @@ static int ov7670_probe(struct i2c_client *client)
info->pclk_hb_disable = true;
}
info->clk = devm_clk_get(&client->dev, "xclk"); /* optional */
if (IS_ERR(info->clk)) {
ret = PTR_ERR(info->clk);
if (ret == -ENOENT)
info->clk = NULL;
else
return ret;
}
info->clk = devm_clk_get_optional(&client->dev, "xclk");
if (IS_ERR(info->clk))
return PTR_ERR(info->clk);
ret = ov7670_init_gpio(client, info);
if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment