diff options
Diffstat (limited to 'drivers/media/usb/gspca/stv06xx/stv06xx.c')
-rw-r--r-- | drivers/media/usb/gspca/stv06xx/stv06xx.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx.c b/drivers/media/usb/gspca/stv06xx/stv06xx.c index 657160b4a1f7..55ee7a61c67f 100644 --- a/drivers/media/usb/gspca/stv06xx/stv06xx.c +++ b/drivers/media/usb/gspca/stv06xx/stv06xx.c @@ -42,8 +42,10 @@ static bool dump_sensor; int stv06xx_write_bridge(struct sd *sd, u16 address, u16 i2c_data) { int err; + struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; struct usb_device *udev = sd->gspca_dev.dev; __u8 *buf = sd->gspca_dev.usb_buf; + u8 len = (i2c_data > 0xff) ? 2 : 1; buf[0] = i2c_data & 0xff; @@ -62,6 +64,7 @@ int stv06xx_write_bridge(struct sd *sd, u16 address, u16 i2c_data) int stv06xx_read_bridge(struct sd *sd, u16 address, u8 *i2c_data) { int err; + struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; struct usb_device *udev = sd->gspca_dev.dev; __u8 *buf = sd->gspca_dev.usb_buf; @@ -110,6 +113,7 @@ static int stv06xx_write_sensor_finish(struct sd *sd) int stv06xx_write_sensor_bytes(struct sd *sd, const u8 *data, u8 len) { int err, i, j; + struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; struct usb_device *udev = sd->gspca_dev.dev; __u8 *buf = sd->gspca_dev.usb_buf; @@ -139,6 +143,7 @@ int stv06xx_write_sensor_bytes(struct sd *sd, const u8 *data, u8 len) int stv06xx_write_sensor_words(struct sd *sd, const u16 *data, u8 len) { int err, i, j; + struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; struct usb_device *udev = sd->gspca_dev.dev; __u8 *buf = sd->gspca_dev.usb_buf; @@ -170,6 +175,7 @@ int stv06xx_write_sensor_words(struct sd *sd, const u16 *data, u8 len) int stv06xx_read_sensor(struct sd *sd, const u8 address, u16 *value) { int err; + struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; struct usb_device *udev = sd->gspca_dev.dev; __u8 *buf = sd->gspca_dev.usb_buf; @@ -283,7 +289,7 @@ static int stv06xx_start(struct gspca_dev *gspca_dev) intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface); alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt); if (!alt) { - PDEBUG(D_ERR, "Couldn't get altsetting"); + PERR("Couldn't get altsetting"); return -EIO; } @@ -341,7 +347,7 @@ static int stv06xx_isoc_nego(struct gspca_dev *gspca_dev) ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 1); if (ret < 0) - PDEBUG(D_ERR|D_STREAM, "set alt 1 err %d", ret); + PERR("set alt 1 err %d", ret); return ret; } @@ -406,7 +412,7 @@ static void stv06xx_pkt_scan(struct gspca_dev *gspca_dev, len -= 4; if (len < chunk_len) { - PDEBUG(D_ERR, "URB packet length is smaller" + PERR("URB packet length is smaller" " than the specified chunk length"); gspca_dev->last_packet_type = DISCARD_PACKET; return; @@ -449,7 +455,7 @@ frame_data: sd->to_skip = gspca_dev->width * 4; if (chunk_len) - PDEBUG(D_ERR, "Chunk length is " + PERR("Chunk length is " "non-zero on a SOF"); break; @@ -463,7 +469,7 @@ frame_data: NULL, 0); if (chunk_len) - PDEBUG(D_ERR, "Chunk length is " + PERR("Chunk length is " "non-zero on a EOF"); break; @@ -596,7 +602,6 @@ MODULE_DEVICE_TABLE(usb, device_table); static int sd_probe(struct usb_interface *intf, const struct usb_device_id *id) { - PDEBUG(D_PROBE, "Probing for a stv06xx device"); return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd), THIS_MODULE); } |