[PATCH] media: ov772x: remove the unnecessary check for priv->clk
From: Vitalii Mordan
Date: Tue Jan 14 2025 - 14:49:31 EST
Remove the unnecessary check in ov772x_power_on(). The resource was either
successfully created during ov772x_probe() or the probe terminated with an
error. Moreover, clk routines do not fail with NULL pointers.
Signed-off-by: Vitalii Mordan <mordan@xxxxxxxxx>
---
drivers/media/i2c/ov772x.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c
index 8a0556e21659..c70d5dfc9da9 100644
--- a/drivers/media/i2c/ov772x.c
+++ b/drivers/media/i2c/ov772x.c
@@ -877,11 +877,9 @@ static int ov772x_power_on(struct ov772x_priv *priv)
struct i2c_client *client = v4l2_get_subdevdata(&priv->subdev);
int ret;
- if (priv->clk) {
- ret = clk_prepare_enable(priv->clk);
- if (ret)
- return ret;
- }
+ ret = clk_prepare_enable(priv->clk);
+ if (ret)
+ return ret;
if (priv->pwdn_gpio) {
gpiod_set_value(priv->pwdn_gpio, 1);
--
2.25.1