[PATCH] media: ov772x: remove the unnecessary check for priv->clk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux