[PATCH] media: ov5640: Check the return value from clk_prepare_enable()

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

 



clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxx>
---
 drivers/media/i2c/ov5640.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
index c89ed66..fd93b14 100644
--- a/drivers/media/i2c/ov5640.c
+++ b/drivers/media/i2c/ov5640.c
@@ -1552,7 +1552,9 @@ static int ov5640_set_power(struct ov5640_dev *sensor, bool on)
 	int ret = 0;
 
 	if (on) {
-		clk_prepare_enable(sensor->xclk);
+		ret = clk_prepare_enable(sensor->xclk);
+		if (ret)
+			return ret;
 
 		ret = regulator_bulk_enable(OV5640_NUM_SUPPLIES,
 					    sensor->supplies);
-- 
2.7.4




[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