diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-03-26 16:21:16 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-04-11 18:54:00 +0200 |
commit | bb4e2e24acdf3316d18138298936c3c8aff2dbfb (patch) | |
tree | 707efafbc5971c57209adda558b807fdd25e7eec /drivers/media | |
parent | 5276c9df9c2ab9a43b534bfb56bdb10899cd3a22 (diff) |
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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/i2c/ov7670.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c index b1bb0833571e..ecbded4f0765 100644 --- a/drivers/media/i2c/ov7670.c +++ b/drivers/media/i2c/ov7670.c @@ -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) |