summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorErik Andr?n <erik.andren@gmail.com>2009-01-08 08:04:19 +0100
committerErik Andr?n <erik.andren@gmail.com>2009-01-08 08:04:19 +0100
commiteb5048481558b0ffb869825cf1b287ab08b63695 (patch)
treecd7126389efa0f898d21ce70204decd9aa32abd9 /linux/drivers/media/video
parent446db4040b9c2beefff8f8d02819d69d66694a9c (diff)
downloadmediapointer-dvb-s2-eb5048481558b0ffb869825cf1b287ab08b63695.tar.gz
mediapointer-dvb-s2-eb5048481558b0ffb869825cf1b287ab08b63695.tar.bz2
gspca - m5602-po1030: Probe read only register at probe time
From: Erik Andr?n <erik.andren@gmail.com> Currently, we're probing r/w registers at probe time. This is potentially dangerous, probe some read only registers instead. Priority: normal Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/gspca/m5602/m5602_po1030.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_po1030.c b/linux/drivers/media/video/gspca/m5602/m5602_po1030.c
index 0547841b2..122c777c7 100644
--- a/linux/drivers/media/video/gspca/m5602/m5602_po1030.c
+++ b/linux/drivers/media/video/gspca/m5602/m5602_po1030.c
@@ -140,7 +140,7 @@ static void po1030_dump_registers(struct sd *sd);
int po1030_probe(struct sd *sd)
{
- u8 prod_id = 0, ver_id = 0, i;
+ u8 dev_id_h = 0, dev_id_l = 0, i;
s32 *sensor_settings;
if (force_sensor) {
@@ -165,13 +165,13 @@ int po1030_probe(struct sd *sd)
m5602_write_bridge(sd, preinit_po1030[i][1], data);
}
- if (m5602_read_sensor(sd, 0x3, &prod_id, 1))
+ if (m5602_read_sensor(sd, PO1030_DEVID_H, &dev_id_h, 1))
return -ENODEV;
- if (m5602_read_sensor(sd, 0x4, &ver_id, 1))
+ if (m5602_read_sensor(sd, PO1030_DEVID_L, &dev_id_l, 1))
return -ENODEV;
- if ((prod_id == 0x02) && (ver_id == 0xef)) {
+ if ((dev_id_h == 0x10) && (dev_id_l == 0x30)) {
info("Detected a po1030 sensor");
goto sensor_found;
}