media: i2c: ov2659: Fix sensor detection to actually fail when device is not present
[sfrench/cifs-2.6.git] / drivers / media / i2c / ov2659.c
index f4ded0669ff9eb71110e55fe897a3ca2cf3c66b3..efbe6dc720e2d3343b721a4f27f2486d6caa8cba 100644 (file)
@@ -661,7 +661,7 @@ static struct sensor_register ov2659_vga[] = {
        { REG_TIMING_HORIZ_FORMAT, 0x01 },
        { 0x370a, 0x52 },
        { REG_VFIFO_READ_START_H, 0x00 },
-       { REG_VFIFO_READ_START_L, 0x80 },
+       { REG_VFIFO_READ_START_L, 0xa0 },
        { REG_ISP_CTRL02, 0x10 },
        { REG_NULL, 0x00 },
 };
@@ -709,7 +709,7 @@ static  struct sensor_register ov2659_qvga[] = {
        { REG_TIMING_HORIZ_FORMAT, 0x01 },
        { 0x370a, 0x52 },
        { REG_VFIFO_READ_START_H, 0x00 },
-       { REG_VFIFO_READ_START_L, 0x80 },
+       { REG_VFIFO_READ_START_L, 0xa0 },
        { REG_ISP_CTRL02, 0x10 },
        { REG_NULL, 0x00 },
 };
@@ -1330,11 +1330,12 @@ static int ov2659_detect(struct v4l2_subdev *sd)
                unsigned short id;
 
                id = OV265X_ID(pid, ver);
-               if (id != OV2659_ID)
+               if (id != OV2659_ID) {
                        dev_err(&client->dev,
                                "Sensor detection failed (%04X, %d)\n",
                                id, ret);
-               else {
+                       ret = -ENODEV;
+               } else {
                        dev_info(&client->dev, "Found OV%04X sensor\n", id);
                        ret = ov2659_init(sd, 0);
                }