diff options
author | Len Brown <len.brown@intel.com> | 2011-01-12 18:06:06 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-12 18:06:06 -0500 |
commit | 56dbed129df3fdd4caf9018b6e7599ee258a5420 (patch) | |
tree | b902491aef3a99efe0d9d49edd0f6e414dba654f /drivers/media/video/gspca/sq930x.c | |
parent | 2a2d31c8dc6f1ebcf5eab1d93a0cb0fb4ed57c7c (diff) | |
parent | f878133bf022717b880d0e0995b8f91436fd605c (diff) |
Merge branch 'linus' into idle-test
Diffstat (limited to 'drivers/media/video/gspca/sq930x.c')
-rw-r--r-- | drivers/media/video/gspca/sq930x.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/media/video/gspca/sq930x.c b/drivers/media/video/gspca/sq930x.c index 3e4b0b94c70..a4a98811b9e 100644 --- a/drivers/media/video/gspca/sq930x.c +++ b/drivers/media/video/gspca/sq930x.c @@ -687,10 +687,19 @@ static void cmos_probe(struct gspca_dev *gspca_dev) if (gspca_dev->usb_buf[0] != 0) break; } - if (i >= ARRAY_SIZE(probe_order)) + if (i >= ARRAY_SIZE(probe_order)) { err("Unknown sensor"); - else - sd->sensor = probe_order[i]; + gspca_dev->usb_err = -EINVAL; + return; + } + sd->sensor = probe_order[i]; + switch (sd->sensor) { + case SENSOR_OV7660: + case SENSOR_OV9630: + err("Sensor %s not yet treated", sensor_tb[sd->sensor].name); + gspca_dev->usb_err = -EINVAL; + break; + } } static void mt9v111_init(struct gspca_dev *gspca_dev) @@ -867,6 +876,9 @@ static int sd_init(struct gspca_dev *gspca_dev) */ reg_r(gspca_dev, SQ930_CTRL_GET_DEV_INFO, 8); + if (gspca_dev->usb_err < 0) + return gspca_dev->usb_err; + /* it returns: * 03 00 12 93 0b f6 c9 00 live! ultra * 03 00 07 93 0b f6 ca 00 live! ultra for notebook @@ -900,15 +912,15 @@ static int sd_init(struct gspca_dev *gspca_dev) if (sd->sensor == SENSOR_MI0360) { /* no sensor probe for icam tracer */ - if (gspca_dev->usb_buf[5] == 0xf6) /* if CMOS */ + if (gspca_dev->usb_buf[5] == 0xf6) /* if ccd */ sd->sensor = SENSOR_ICX098BQ; else cmos_probe(gspca_dev); } - - PDEBUG(D_PROBE, "Sensor %s", sensor_tb[sd->sensor].name); - - global_init(sd, 1); + if (gspca_dev->usb_err >= 0) { + PDEBUG(D_PROBE, "Sensor %s", sensor_tb[sd->sensor].name); + global_init(sd, 1); + } return gspca_dev->usb_err; } |