[<prev] [next>] [day] [month] [year] [list]
Message-Id: <a6fd15c221a76c92a23afa9b678555d6639acea7.1679840463.git.christophe.jaillet@wanadoo.fr>
Date: Sun, 26 Mar 2023 16:21:16 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-media@...r.kernel.org
Subject: [PATCH] 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@...adoo.fr>
---
drivers/media/i2c/ov7670.c | 11 +++--------
1 file 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)
--
2.34.1
Powered by blists - more mailing lists