V4L/DVB: gspca - all modules: Display error messages when gspca debug disabled

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Jean-François Moine 2010-09-13 05:19:58 -03:00 committed by Mauro Carvalho Chehab
parent 548264375b
commit 0b656321f3
35 changed files with 147 additions and 167 deletions

View File

@ -510,7 +510,7 @@ retry:
gspca_dev->usb_buf, databytes, 1000); gspca_dev->usb_buf, databytes, 1000);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR, "usb_control_msg %02x, error %d", command[1], err("usb_control_msg %02x, error %d", command[1],
ret); ret);
if (ret == -EPIPE && retries > 0) { if (ret == -EPIPE && retries > 0) {
@ -1236,7 +1236,7 @@ static void monitor_exposure(struct gspca_dev *gspca_dev)
cmd[7] = 0; cmd[7] = 0;
ret = cpia_usb_transferCmd(gspca_dev, cmd); ret = cpia_usb_transferCmd(gspca_dev, cmd);
if (ret) { if (ret) {
PDEBUG(D_ERR, "ReadVPRegs(30,4,9,8) - failed: %d", ret); err("ReadVPRegs(30,4,9,8) - failed: %d", ret);
return; return;
} }
exp_acc = gspca_dev->usb_buf[0]; exp_acc = gspca_dev->usb_buf[0];

View File

@ -182,7 +182,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
/* Init the device */ /* Init the device */
ret = command(gspca_dev, 0); ret = command(gspca_dev, 0);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_STREAM, "init failed %d", ret); err("init failed %d", ret);
return ret; return ret;
} }
@ -194,14 +194,14 @@ static int sd_start(struct gspca_dev *gspca_dev)
FPIX_MAX_TRANSFER, &len, FPIX_MAX_TRANSFER, &len,
FPIX_TIMEOUT); FPIX_TIMEOUT);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_STREAM, "usb_bulk_msg failed %d", ret); err("usb_bulk_msg failed %d", ret);
return ret; return ret;
} }
/* Request a frame, but don't read it */ /* Request a frame, but don't read it */
ret = command(gspca_dev, 1); ret = command(gspca_dev, 1);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_STREAM, "frame request failed %d", ret); err("frame request failed %d", ret);
return ret; return ret;
} }

View File

@ -585,8 +585,7 @@ int gl860_RTx(struct gspca_dev *gspca_dev,
} }
if (r < 0) if (r < 0)
PDEBUG(D_ERR, err("ctrl transfer failed %4d "
"ctrl transfer failed %4d "
"[p%02x r%d v%04x i%04x len%d]", "[p%02x r%d v%04x i%04x len%d]",
r, pref, req, val, index, len); r, pref, req, val, index, len);
else if (len > 1 && r < len) else if (len > 1 && r < len)

View File

@ -148,7 +148,7 @@ static void int_irq(struct urb *urb)
if (ret == 0) { if (ret == 0) {
ret = usb_submit_urb(urb, GFP_ATOMIC); ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR, "Resubmit URB failed with error %i", ret); err("Resubmit URB failed with error %i", ret);
} }
} }
@ -177,8 +177,8 @@ static int gspca_input_connect(struct gspca_dev *dev)
err = input_register_device(input_dev); err = input_register_device(input_dev);
if (err) { if (err) {
PDEBUG(D_ERR, "Input device registration failed " err("Input device registration failed with error %i",
"with error %i", err); err);
input_dev->dev.parent = NULL; input_dev->dev.parent = NULL;
input_free_device(input_dev); input_free_device(input_dev);
} else { } else {
@ -328,8 +328,7 @@ static void fill_frame(struct gspca_dev *gspca_dev,
} }
st = urb->iso_frame_desc[i].status; st = urb->iso_frame_desc[i].status;
if (st) { if (st) {
PDEBUG(D_ERR, err("ISOC data error: [%d] len=%d, status=%d",
"ISOC data error: [%d] len=%d, status=%d",
i, len, st); i, len, st);
gspca_dev->last_packet_type = DISCARD_PACKET; gspca_dev->last_packet_type = DISCARD_PACKET;
continue; continue;
@ -347,7 +346,7 @@ resubmit:
/* resubmit the URB */ /* resubmit the URB */
st = usb_submit_urb(urb, GFP_ATOMIC); st = usb_submit_urb(urb, GFP_ATOMIC);
if (st < 0) if (st < 0)
PDEBUG(D_ERR|D_PACK, "usb_submit_urb() ret %d", st); err("usb_submit_urb() ret %d", st);
} }
/* /*
@ -401,7 +400,7 @@ resubmit:
if (gspca_dev->cam.bulk_nurbs != 0) { if (gspca_dev->cam.bulk_nurbs != 0) {
st = usb_submit_urb(urb, GFP_ATOMIC); st = usb_submit_urb(urb, GFP_ATOMIC);
if (st < 0) if (st < 0)
PDEBUG(D_ERR|D_PACK, "usb_submit_urb() ret %d", st); err("usb_submit_urb() ret %d", st);
} }
} }
@ -590,7 +589,7 @@ static int gspca_set_alt0(struct gspca_dev *gspca_dev)
return 0; return 0;
ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0); ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR|D_STREAM, "set alt 0 err %d", ret); err("set alt 0 err %d", ret);
return ret; return ret;
} }
@ -850,8 +849,7 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
break; break;
gspca_stream_off(gspca_dev); gspca_stream_off(gspca_dev);
if (ret != -ENOSPC) { if (ret != -ENOSPC) {
PDEBUG(D_ERR|D_STREAM, err("usb_submit_urb alt %d err %d",
"usb_submit_urb alt %d err %d",
gspca_dev->alt, ret); gspca_dev->alt, ret);
goto out; goto out;
} }
@ -2243,7 +2241,7 @@ int gspca_dev_probe(struct usb_interface *intf,
/* we don't handle multi-config cameras */ /* we don't handle multi-config cameras */
if (dev->descriptor.bNumConfigurations != 1) { if (dev->descriptor.bNumConfigurations != 1) {
PDEBUG(D_ERR, "%04x:%04x too many config", err("%04x:%04x too many config",
id->idVendor, id->idProduct); id->idVendor, id->idProduct);
return -ENODEV; return -ENODEV;
} }

View File

@ -82,7 +82,7 @@ static int jlj_write2(struct gspca_dev *gspca_dev, unsigned char *command)
usb_sndbulkpipe(gspca_dev->dev, 3), usb_sndbulkpipe(gspca_dev->dev, 3),
gspca_dev->usb_buf, 2, NULL, 500); gspca_dev->usb_buf, 2, NULL, 500);
if (retval < 0) if (retval < 0)
PDEBUG(D_ERR, "command write [%02x] error %d", err("command write [%02x] error %d",
gspca_dev->usb_buf[0], retval); gspca_dev->usb_buf[0], retval);
return retval; return retval;
} }
@ -97,7 +97,7 @@ static int jlj_read1(struct gspca_dev *gspca_dev, unsigned char response)
gspca_dev->usb_buf, 1, NULL, 500); gspca_dev->usb_buf, 1, NULL, 500);
response = gspca_dev->usb_buf[0]; response = gspca_dev->usb_buf[0];
if (retval < 0) if (retval < 0)
PDEBUG(D_ERR, "read command [%02x] error %d", err("read command [%02x] error %d",
gspca_dev->usb_buf[0], retval); gspca_dev->usb_buf[0], retval);
return retval; return retval;
} }
@ -191,7 +191,7 @@ static void jlj_dostream(struct work_struct *work)
buffer = kmalloc(JEILINJ_MAX_TRANSFER, GFP_KERNEL | GFP_DMA); buffer = kmalloc(JEILINJ_MAX_TRANSFER, GFP_KERNEL | GFP_DMA);
if (!buffer) { if (!buffer) {
PDEBUG(D_ERR, "Couldn't allocate USB buffer"); err("Couldn't allocate USB buffer");
goto quit_stream; goto quit_stream;
} }
while (gspca_dev->present && gspca_dev->streaming) { while (gspca_dev->present && gspca_dev->streaming) {

View File

@ -200,7 +200,7 @@ static void reg_w(struct gspca_dev *gspca_dev, u16 value, u16 index)
0, 0,
1000); 1000);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w err %d", ret); err("reg_w err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -221,7 +221,7 @@ static void reg_r(struct gspca_dev *gspca_dev, u16 value, u16 index)
2, 2,
1000); 1000);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w err %d", ret); err("reg_w err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -284,7 +284,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface); intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface);
alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt); alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt);
if (!alt) { if (!alt) {
PDEBUG(D_ERR, "Couldn't get altsetting"); err("Couldn't get altsetting");
return -EIO; return -EIO;
} }
@ -386,7 +386,7 @@ static void sd_isoc_irq(struct urb *urb)
PDEBUG(D_ERR, "urb status: %d", urb->status); PDEBUG(D_ERR, "urb status: %d", urb->status);
st = usb_submit_urb(urb, GFP_ATOMIC); st = usb_submit_urb(urb, GFP_ATOMIC);
if (st < 0) if (st < 0)
PDEBUG(D_ERR|D_PACK, "resubmit urb error %d", st); err("resubmit urb error %d", st);
return; return;
} }
@ -477,7 +477,7 @@ resubmit:
} }
st = usb_submit_urb(status_urb, GFP_ATOMIC); st = usb_submit_urb(status_urb, GFP_ATOMIC);
if (st < 0) if (st < 0)
PDEBUG(D_ERR|D_PACK, "usb_submit_urb(status_urb) ret %d", st); err("usb_submit_urb(status_urb) ret %d", st);
} }
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)

View File

@ -150,7 +150,7 @@ static int reg_w(struct gspca_dev *gspca_dev,
&alen, &alen,
500); /* timeout in milliseconds */ 500); /* timeout in milliseconds */
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR, "reg write [%02x] error %d", err("reg write [%02x] error %d",
gspca_dev->usb_buf[0], ret); gspca_dev->usb_buf[0], ret);
return ret; return ret;
} }

View File

@ -267,7 +267,7 @@ static int mr_write(struct gspca_dev *gspca_dev, int len)
usb_sndbulkpipe(gspca_dev->dev, 4), usb_sndbulkpipe(gspca_dev->dev, 4),
gspca_dev->usb_buf, len, NULL, 500); gspca_dev->usb_buf, len, NULL, 500);
if (rc < 0) if (rc < 0)
PDEBUG(D_ERR, "reg write [%02x] error %d", err("reg write [%02x] error %d",
gspca_dev->usb_buf[0], rc); gspca_dev->usb_buf[0], rc);
return rc; return rc;
} }
@ -281,7 +281,7 @@ static int mr_read(struct gspca_dev *gspca_dev, int len)
usb_rcvbulkpipe(gspca_dev->dev, 3), usb_rcvbulkpipe(gspca_dev->dev, 3),
gspca_dev->usb_buf, len, NULL, 500); gspca_dev->usb_buf, len, NULL, 500);
if (rc < 0) if (rc < 0)
PDEBUG(D_ERR, "reg read [%02x] error %d", err("reg read [%02x] error %d",
gspca_dev->usb_buf[0], rc); gspca_dev->usb_buf[0], rc);
return rc; return rc;
} }
@ -540,7 +540,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
sd->sensor_type = 1; sd->sensor_type = 1;
break; break;
default: default:
PDEBUG(D_ERR, "Unknown CIF Sensor id : %02x", err("Unknown CIF Sensor id : %02x",
gspca_dev->usb_buf[1]); gspca_dev->usb_buf[1]);
return -ENODEV; return -ENODEV;
} }
@ -575,10 +575,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
sd->sensor_type = 2; sd->sensor_type = 2;
} else if ((gspca_dev->usb_buf[0] != 0x03) && } else if ((gspca_dev->usb_buf[0] != 0x03) &&
(gspca_dev->usb_buf[0] != 0x04)) { (gspca_dev->usb_buf[0] != 0x04)) {
PDEBUG(D_ERR, "Unknown VGA Sensor id Byte 0: %02x", err("Unknown VGA Sensor id Byte 0: %02x",
gspca_dev->usb_buf[0]); gspca_dev->usb_buf[0]);
PDEBUG(D_ERR, "Defaults assumed, may not work"); err("Defaults assumed, may not work");
PDEBUG(D_ERR, "Please report this"); err("Please report this");
} }
/* Sakar Digital color needs to be adjusted. */ /* Sakar Digital color needs to be adjusted. */
if ((gspca_dev->usb_buf[0] == 0x03) && if ((gspca_dev->usb_buf[0] == 0x03) &&
@ -595,12 +595,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
/* Nothing to do here. */ /* Nothing to do here. */
break; break;
default: default:
PDEBUG(D_ERR, err("Unknown VGA Sensor id Byte 1: %02x",
"Unknown VGA Sensor id Byte 1: %02x",
gspca_dev->usb_buf[1]); gspca_dev->usb_buf[1]);
PDEBUG(D_ERR, err("Defaults assumed, may not work");
"Defaults assumed, may not work"); err("Please report this");
PDEBUG(D_ERR, "Please report this");
} }
} }
PDEBUG(D_PROBE, "MR97310A VGA camera detected, sensor: %d", PDEBUG(D_PROBE, "MR97310A VGA camera detected, sensor: %d",

View File

@ -1900,7 +1900,7 @@ static int reg_w(struct sd *sd, __u16 index, __u16 value)
sd->gspca_dev.usb_buf, 1, 500); sd->gspca_dev.usb_buf, 1, 500);
leave: leave:
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "Write reg 0x%04x -> [0x%02x] failed", err("Write reg 0x%04x -> [0x%02x] failed",
value, index); value, index);
return ret; return ret;
} }
@ -1938,7 +1938,7 @@ static int reg_r(struct sd *sd, __u16 index)
ret = sd->gspca_dev.usb_buf[0]; ret = sd->gspca_dev.usb_buf[0];
PDEBUG(D_USBI, "Read reg [0x%02X] -> 0x%04X", index, ret); PDEBUG(D_USBI, "Read reg [0x%02X] -> 0x%04X", index, ret);
} else } else
PDEBUG(D_ERR, "Read reg [0x%02x] failed", index); err("Read reg [0x%02x] failed", index);
return ret; return ret;
} }
@ -1958,7 +1958,7 @@ static int reg_r8(struct sd *sd,
if (ret >= 0) if (ret >= 0)
ret = sd->gspca_dev.usb_buf[0]; ret = sd->gspca_dev.usb_buf[0];
else else
PDEBUG(D_ERR, "Read reg 8 [0x%02x] failed", index); err("Read reg 8 [0x%02x] failed", index);
return ret; return ret;
} }
@ -2006,7 +2006,7 @@ static int ov518_reg_w32(struct sd *sd, __u16 index, u32 value, int n)
0, index, 0, index,
sd->gspca_dev.usb_buf, n, 500); sd->gspca_dev.usb_buf, n, 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "Write reg32 [%02x] %08x failed", index, value); err("Write reg32 [%02x] %08x failed", index, value);
return ret; return ret;
} }
@ -2203,7 +2203,7 @@ static int ovfx2_i2c_w(struct sd *sd, __u8 reg, __u8 value)
(__u16)value, (__u16)reg, NULL, 0, 500); (__u16)value, (__u16)reg, NULL, 0, 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "i2c 0x%02x -> [0x%02x] failed", value, reg); err("i2c 0x%02x -> [0x%02x] failed", value, reg);
return ret; return ret;
} }
@ -2225,7 +2225,7 @@ static int ovfx2_i2c_r(struct sd *sd, __u8 reg)
ret = sd->gspca_dev.usb_buf[0]; ret = sd->gspca_dev.usb_buf[0];
PDEBUG(D_USBI, "i2c [0x%02X] -> 0x%02X", reg, ret); PDEBUG(D_USBI, "i2c [0x%02X] -> 0x%02X", reg, ret);
} else } else
PDEBUG(D_ERR, "i2c read [0x%02x] failed", reg); err("i2c read [0x%02x] failed", reg);
return ret; return ret;
} }
@ -2481,7 +2481,7 @@ static int ov_hires_configure(struct sd *sd)
int high, low; int high, low;
if (sd->bridge != BRIDGE_OVFX2) { if (sd->bridge != BRIDGE_OVFX2) {
PDEBUG(D_ERR, "error hires sensors only supported with ovfx2"); err("error hires sensors only supported with ovfx2");
return -1; return -1;
} }
@ -2498,7 +2498,7 @@ static int ov_hires_configure(struct sd *sd)
PDEBUG(D_PROBE, "Sensor is an OV3610"); PDEBUG(D_PROBE, "Sensor is an OV3610");
sd->sensor = SEN_OV3610; sd->sensor = SEN_OV3610;
} else { } else {
PDEBUG(D_ERR, "Error unknown sensor type: 0x%02x%02x", err("Error unknown sensor type: 0x%02x%02x",
high, low); high, low);
return -1; return -1;
} }
@ -2526,7 +2526,7 @@ static int ov8xx0_configure(struct sd *sd)
if ((rc & 3) == 1) { if ((rc & 3) == 1) {
sd->sensor = SEN_OV8610; sd->sensor = SEN_OV8610;
} else { } else {
PDEBUG(D_ERR, "Unknown image sensor version: %d", rc & 3); err("Unknown image sensor version: %d", rc & 3);
return -1; return -1;
} }
@ -2589,9 +2589,8 @@ static int ov7xx0_configure(struct sd *sd)
if (high == 0x76) { if (high == 0x76) {
switch (low) { switch (low) {
case 0x30: case 0x30:
PDEBUG(D_PROBE, "Sensor is an OV7630/OV7635"); err("Sensor is an OV7630/OV7635");
PDEBUG(D_ERR, err("7630 is not supported by this driver");
"7630 is not supported by this driver");
return -1; return -1;
case 0x40: case 0x40:
PDEBUG(D_PROBE, "Sensor is an OV7645"); PDEBUG(D_PROBE, "Sensor is an OV7645");
@ -2614,7 +2613,7 @@ static int ov7xx0_configure(struct sd *sd)
sd->sensor = SEN_OV7620; sd->sensor = SEN_OV7620;
} }
} else { } else {
PDEBUG(D_ERR, "Unknown image sensor version: %d", rc & 3); err("Unknown image sensor version: %d", rc & 3);
return -1; return -1;
} }
@ -2641,9 +2640,8 @@ static int ov6xx0_configure(struct sd *sd)
switch (rc) { switch (rc) {
case 0x00: case 0x00:
sd->sensor = SEN_OV6630; sd->sensor = SEN_OV6630;
PDEBUG(D_ERR, warn("WARNING: Sensor is an OV66308. Your camera may have");
"WARNING: Sensor is an OV66308. Your camera may have"); warn("been misdetected in previous driver versions.");
PDEBUG(D_ERR, "been misdetected in previous driver versions.");
break; break;
case 0x01: case 0x01:
sd->sensor = SEN_OV6620; sd->sensor = SEN_OV6620;
@ -2659,12 +2657,11 @@ static int ov6xx0_configure(struct sd *sd)
break; break;
case 0x90: case 0x90:
sd->sensor = SEN_OV6630; sd->sensor = SEN_OV6630;
PDEBUG(D_ERR, warn("WARNING: Sensor is an OV66307. Your camera may have");
"WARNING: Sensor is an OV66307. Your camera may have"); warn("been misdetected in previous driver versions.");
PDEBUG(D_ERR, "been misdetected in previous driver versions.");
break; break;
default: default:
PDEBUG(D_ERR, "FATAL: Unknown sensor version: 0x%02x", rc); err("FATAL: Unknown sensor version: 0x%02x", rc);
return -1; return -1;
} }
@ -3082,7 +3079,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
goto error; goto error;
} }
} else { } else {
PDEBUG(D_ERR, "Can't determine sensor slave IDs"); err("Can't determine sensor slave IDs");
goto error; goto error;
} }
@ -3253,7 +3250,7 @@ static int ov511_mode_init_regs(struct sd *sd)
intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface); intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface);
alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt); alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt);
if (!alt) { if (!alt) {
PDEBUG(D_ERR, "Couldn't get altsetting"); err("Couldn't get altsetting");
return -EIO; return -EIO;
} }
@ -3377,7 +3374,7 @@ static int ov518_mode_init_regs(struct sd *sd)
intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface); intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface);
alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt); alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt);
if (!alt) { if (!alt) {
PDEBUG(D_ERR, "Couldn't get altsetting"); err("Couldn't get altsetting");
return -EIO; return -EIO;
} }

View File

@ -487,7 +487,7 @@ static void ov534_reg_write(struct gspca_dev *gspca_dev, u16 reg, u8 val)
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0x00, reg, gspca_dev->usb_buf, 1, CTRL_TIMEOUT); 0x00, reg, gspca_dev->usb_buf, 1, CTRL_TIMEOUT);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR, "write failed"); err("write failed %d", ret);
} }
static u8 ov534_reg_read(struct gspca_dev *gspca_dev, u16 reg) static u8 ov534_reg_read(struct gspca_dev *gspca_dev, u16 reg)
@ -502,7 +502,7 @@ static u8 ov534_reg_read(struct gspca_dev *gspca_dev, u16 reg)
0x00, reg, gspca_dev->usb_buf, 1, CTRL_TIMEOUT); 0x00, reg, gspca_dev->usb_buf, 1, CTRL_TIMEOUT);
PDEBUG(D_USBI, "reg=0x%04x, data=0x%02x", reg, gspca_dev->usb_buf[0]); PDEBUG(D_USBI, "reg=0x%04x, data=0x%02x", reg, gspca_dev->usb_buf[0]);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR, "read failed"); err("read failed %d", ret);
return gspca_dev->usb_buf[0]; return gspca_dev->usb_buf[0];
} }
@ -564,7 +564,7 @@ static void sccb_reg_write(struct gspca_dev *gspca_dev, u8 reg, u8 val)
ov534_reg_write(gspca_dev, OV534_REG_OPERATION, OV534_OP_WRITE_3); ov534_reg_write(gspca_dev, OV534_REG_OPERATION, OV534_OP_WRITE_3);
if (!sccb_check_status(gspca_dev)) if (!sccb_check_status(gspca_dev))
PDEBUG(D_ERR, "sccb_reg_write failed"); err("sccb_reg_write failed");
} }
static u8 sccb_reg_read(struct gspca_dev *gspca_dev, u16 reg) static u8 sccb_reg_read(struct gspca_dev *gspca_dev, u16 reg)
@ -572,11 +572,11 @@ static u8 sccb_reg_read(struct gspca_dev *gspca_dev, u16 reg)
ov534_reg_write(gspca_dev, OV534_REG_SUBADDR, reg); ov534_reg_write(gspca_dev, OV534_REG_SUBADDR, reg);
ov534_reg_write(gspca_dev, OV534_REG_OPERATION, OV534_OP_WRITE_2); ov534_reg_write(gspca_dev, OV534_REG_OPERATION, OV534_OP_WRITE_2);
if (!sccb_check_status(gspca_dev)) if (!sccb_check_status(gspca_dev))
PDEBUG(D_ERR, "sccb_reg_read failed 1"); err("sccb_reg_read failed 1");
ov534_reg_write(gspca_dev, OV534_REG_OPERATION, OV534_OP_READ_2); ov534_reg_write(gspca_dev, OV534_REG_OPERATION, OV534_OP_READ_2);
if (!sccb_check_status(gspca_dev)) if (!sccb_check_status(gspca_dev))
PDEBUG(D_ERR, "sccb_reg_read failed 2"); err("sccb_reg_read failed 2");
return ov534_reg_read(gspca_dev, OV534_REG_READ); return ov534_reg_read(gspca_dev, OV534_REG_READ);
} }

View File

@ -785,7 +785,7 @@ static void reg_w_i(struct gspca_dev *gspca_dev, u16 reg, u8 val)
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0x00, reg, gspca_dev->usb_buf, 1, CTRL_TIMEOUT); 0x00, reg, gspca_dev->usb_buf, 1, CTRL_TIMEOUT);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w failed %d", ret); err("reg_w failed %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -810,7 +810,7 @@ static u8 reg_r(struct gspca_dev *gspca_dev, u16 reg)
0x00, reg, gspca_dev->usb_buf, 1, CTRL_TIMEOUT); 0x00, reg, gspca_dev->usb_buf, 1, CTRL_TIMEOUT);
PDEBUG(D_USBI, "reg_r [%04x] -> %02x", reg, gspca_dev->usb_buf[0]); PDEBUG(D_USBI, "reg_r [%04x] -> %02x", reg, gspca_dev->usb_buf[0]);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_r err %d", ret); err("reg_r err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
return gspca_dev->usb_buf[0]; return gspca_dev->usb_buf[0];
@ -848,7 +848,7 @@ static void sccb_write(struct gspca_dev *gspca_dev, u8 reg, u8 val)
reg_w_i(gspca_dev, OV534_REG_OPERATION, OV534_OP_WRITE_3); reg_w_i(gspca_dev, OV534_REG_OPERATION, OV534_OP_WRITE_3);
if (!sccb_check_status(gspca_dev)) if (!sccb_check_status(gspca_dev))
PDEBUG(D_ERR, "sccb_write failed"); err("sccb_write failed");
} }
static u8 sccb_read(struct gspca_dev *gspca_dev, u16 reg) static u8 sccb_read(struct gspca_dev *gspca_dev, u16 reg)
@ -856,11 +856,11 @@ static u8 sccb_read(struct gspca_dev *gspca_dev, u16 reg)
reg_w(gspca_dev, OV534_REG_SUBADDR, reg); reg_w(gspca_dev, OV534_REG_SUBADDR, reg);
reg_w(gspca_dev, OV534_REG_OPERATION, OV534_OP_WRITE_2); reg_w(gspca_dev, OV534_REG_OPERATION, OV534_OP_WRITE_2);
if (!sccb_check_status(gspca_dev)) if (!sccb_check_status(gspca_dev))
PDEBUG(D_ERR, "sccb_read failed 1"); err("sccb_read failed 1");
reg_w(gspca_dev, OV534_REG_OPERATION, OV534_OP_READ_2); reg_w(gspca_dev, OV534_REG_OPERATION, OV534_OP_READ_2);
if (!sccb_check_status(gspca_dev)) if (!sccb_check_status(gspca_dev))
PDEBUG(D_ERR, "sccb_read failed 2"); err("sccb_read failed 2");
return reg_r(gspca_dev, OV534_REG_READ); return reg_r(gspca_dev, OV534_REG_READ);
} }

View File

@ -178,8 +178,7 @@ static int pac207_write_regs(struct gspca_dev *gspca_dev, u16 index,
0x00, index, 0x00, index,
gspca_dev->usb_buf, length, PAC207_CTRL_TIMEOUT); gspca_dev->usb_buf, length, PAC207_CTRL_TIMEOUT);
if (err < 0) if (err < 0)
PDEBUG(D_ERR, err("Failed to write registers to index 0x%04X, error %d)",
"Failed to write registers to index 0x%04X, error %d)",
index, err); index, err);
return err; return err;
@ -195,7 +194,7 @@ static int pac207_write_reg(struct gspca_dev *gspca_dev, u16 index, u16 value)
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
value, index, NULL, 0, PAC207_CTRL_TIMEOUT); value, index, NULL, 0, PAC207_CTRL_TIMEOUT);
if (err) if (err)
PDEBUG(D_ERR, "Failed to write a register (index 0x%04X," err("Failed to write a register (index 0x%04X,"
" value 0x%02X, error %d)", index, value, err); " value 0x%02X, error %d)", index, value, err);
return err; return err;
@ -211,8 +210,7 @@ static int pac207_read_reg(struct gspca_dev *gspca_dev, u16 index)
0x00, index, 0x00, index,
gspca_dev->usb_buf, 1, PAC207_CTRL_TIMEOUT); gspca_dev->usb_buf, 1, PAC207_CTRL_TIMEOUT);
if (res < 0) { if (res < 0) {
PDEBUG(D_ERR, err("Failed to read a register (index 0x%04X, error %d)",
"Failed to read a register (index 0x%04X, error %d)",
index, res); index, res);
return res; return res;
} }

View File

@ -408,8 +408,7 @@ static void reg_w_buf(struct gspca_dev *gspca_dev,
index, gspca_dev->usb_buf, len, index, gspca_dev->usb_buf, len,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w_buf(): " err("reg_w_buf failed index 0x%02x, error %d",
"Failed to write registers to index 0x%x, error %i",
index, ret); index, ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
@ -432,8 +431,7 @@ static void reg_w(struct gspca_dev *gspca_dev,
0, index, gspca_dev->usb_buf, 1, 0, index, gspca_dev->usb_buf, 1,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w(): " err("reg_w() failed index 0x%02x, value 0x%02x, error %d",
"Failed to write register to index 0x%x, value 0x%x, error %i",
index, value, ret); index, value, ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
@ -468,9 +466,8 @@ static void reg_w_page(struct gspca_dev *gspca_dev,
0, index, gspca_dev->usb_buf, 1, 0, index, gspca_dev->usb_buf, 1,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w_page(): " err("reg_w_page() failed index 0x%02x, "
"Failed to write register to index 0x%x, " "value 0x%02x, error %d",
"value 0x%x, error %i",
index, page[index], ret); index, page[index], ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
break; break;

View File

@ -276,8 +276,7 @@ static void reg_w_buf(struct gspca_dev *gspca_dev,
index, gspca_dev->usb_buf, len, index, gspca_dev->usb_buf, len,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w_buf(): " err("reg_w_buf() failed index 0x%02x, error %d",
"Failed to write registers to index 0x%x, error %i",
index, ret); index, ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
@ -300,8 +299,7 @@ static void reg_w(struct gspca_dev *gspca_dev,
0, index, gspca_dev->usb_buf, 1, 0, index, gspca_dev->usb_buf, 1,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w(): " err("reg_w() failed index 0x%02x, value 0x%02x, error %d",
"Failed to write register to index 0x%x, value 0x%x, error %i",
index, value, ret); index, value, ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
@ -336,9 +334,8 @@ static void reg_w_page(struct gspca_dev *gspca_dev,
0, index, gspca_dev->usb_buf, 1, 0, index, gspca_dev->usb_buf, 1,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w_page(): " err("reg_w_page() failed index 0x%02x, "
"Failed to write register to index 0x%x, " "value 0x%02x, error %d",
"value 0x%x, error %i",
index, page[index], ret); index, page[index], ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
break; break;

View File

@ -75,7 +75,7 @@ static int sn9c2028_command(struct gspca_dev *gspca_dev, u8 *command)
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
2, 0, gspca_dev->usb_buf, 6, 500); 2, 0, gspca_dev->usb_buf, 6, 500);
if (rc < 0) { if (rc < 0) {
PDEBUG(D_ERR, "command write [%02x] error %d", err("command write [%02x] error %d",
gspca_dev->usb_buf[0], rc); gspca_dev->usb_buf[0], rc);
return rc; return rc;
} }
@ -93,7 +93,7 @@ static int sn9c2028_read1(struct gspca_dev *gspca_dev)
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
1, 0, gspca_dev->usb_buf, 1, 500); 1, 0, gspca_dev->usb_buf, 1, 500);
if (rc != 1) { if (rc != 1) {
PDEBUG(D_ERR, "read1 error %d", rc); err("read1 error %d", rc);
return (rc < 0) ? rc : -EIO; return (rc < 0) ? rc : -EIO;
} }
PDEBUG(D_USBI, "read1 response %02x", gspca_dev->usb_buf[0]); PDEBUG(D_USBI, "read1 response %02x", gspca_dev->usb_buf[0]);
@ -109,7 +109,7 @@ static int sn9c2028_read4(struct gspca_dev *gspca_dev, u8 *reading)
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
4, 0, gspca_dev->usb_buf, 4, 500); 4, 0, gspca_dev->usb_buf, 4, 500);
if (rc != 4) { if (rc != 4) {
PDEBUG(D_ERR, "read4 error %d", rc); err("read4 error %d", rc);
return (rc < 0) ? rc : -EIO; return (rc < 0) ? rc : -EIO;
} }
memcpy(reading, gspca_dev->usb_buf, 4); memcpy(reading, gspca_dev->usb_buf, 4);
@ -131,7 +131,7 @@ static int sn9c2028_long_command(struct gspca_dev *gspca_dev, u8 *command)
for (i = 0; i < 256 && status < 2; i++) for (i = 0; i < 256 && status < 2; i++)
status = sn9c2028_read1(gspca_dev); status = sn9c2028_read1(gspca_dev);
if (status != 2) { if (status != 2) {
PDEBUG(D_ERR, "long command status read error %d", status); err("long command status read error %d", status);
return (status < 0) ? status : -EIO; return (status < 0) ? status : -EIO;
} }
@ -638,7 +638,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
err_code = start_vivitar_cam(gspca_dev); err_code = start_vivitar_cam(gspca_dev);
break; break;
default: default:
PDEBUG(D_ERR, "Starting unknown camera, please report this"); err("Starting unknown camera, please report this");
return -ENXIO; return -ENXIO;
} }

View File

@ -1599,7 +1599,7 @@ static void ov7648_probe(struct gspca_dev *gspca_dev)
return; return;
} }
PDEBUG(D_PROBE, "Unknown sensor %04x", val); err("Unknown sensor %04x", val);
} }
/* 0c45:6142 sensor may be po2030n, gc0305 or gc0307 */ /* 0c45:6142 sensor may be po2030n, gc0305 or gc0307 */
@ -1635,7 +1635,7 @@ static void po2030n_probe(struct gspca_dev *gspca_dev)
PDEBUG(D_PROBE, "Sensor po2030n"); PDEBUG(D_PROBE, "Sensor po2030n");
/* sd->sensor = SENSOR_PO2030N; */ /* sd->sensor = SENSOR_PO2030N; */
} else { } else {
PDEBUG(D_PROBE, "Unknown sensor ID %04x", val); err("Unknown sensor ID %04x", val);
} }
} }

View File

@ -171,7 +171,7 @@ static void reg_r(struct gspca_dev *gspca_dev,
PDEBUG(D_USBI, "GET %02x 0000 %04x %02x", req, index, PDEBUG(D_USBI, "GET %02x 0000 %04x %02x", req, index,
gspca_dev->usb_buf[0]); gspca_dev->usb_buf[0]);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_r err %d", ret); err("reg_r err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -193,7 +193,7 @@ static void reg_w(struct gspca_dev *gspca_dev,
value, index, value, index,
NULL, 0, 500); NULL, 0, 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w err %d", ret); err("reg_w err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -217,7 +217,7 @@ static void reg_wb(struct gspca_dev *gspca_dev,
value, index, value, index,
gspca_dev->usb_buf, 1, 500); gspca_dev->usb_buf, 1, 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w err %d", ret); err("reg_w err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }

View File

@ -396,7 +396,7 @@ static int reg_w(struct gspca_dev *gspca_dev,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value, index, NULL, 0, 500); value, index, NULL, 0, 500);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR, "reg write: error %d", ret); err("reg write: error %d", ret);
return ret; return ret;
} }
@ -418,8 +418,8 @@ static int reg_r_12(struct gspca_dev *gspca_dev,
gspca_dev->usb_buf, length, gspca_dev->usb_buf, length,
500); /* timeout */ 500); /* timeout */
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_r_12 err %d", ret); err("reg_r_12 err %d", ret);
return -1; return ret;
} }
return (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0]; return (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0];
} }

View File

@ -1852,7 +1852,7 @@ static int reg_write(struct usb_device *dev,
PDEBUG(D_USBO, "reg write: 0x%02x 0x%02x 0x%02x", PDEBUG(D_USBO, "reg write: 0x%02x 0x%02x 0x%02x",
req, index, value); req, index, value);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR, "reg write: error %d", ret); err("reg write: error %d", ret);
return ret; return ret;
} }

View File

@ -582,7 +582,7 @@ static int reg_write(struct usb_device *dev,
PDEBUG(D_USBO, "reg write: 0x%02x,0x%02x:0x%02x, %d", PDEBUG(D_USBO, "reg write: 0x%02x,0x%02x:0x%02x, %d",
req, index, value, ret); req, index, value, ret);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR, "reg write: error %d", ret); err("reg write: error %d", ret);
return ret; return ret;
} }
@ -689,8 +689,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
return ret; return ret;
} }
if (ret != 0x0101) { if (ret != 0x0101) {
PDEBUG(D_ERR|D_CONF, err("After vector read returns 0x%04x should be 0x0101",
"After vector read returns 0x%04x should be 0x0101",
ret); ret);
} }

View File

@ -1276,7 +1276,7 @@ static int reg_write(struct usb_device *dev,
PDEBUG(D_USBO, "reg write i:0x%04x = 0x%02x", PDEBUG(D_USBO, "reg write i:0x%04x = 0x%02x",
index, value); index, value);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR|D_USBO, "reg write: error %d", ret); err("reg write: error %d", ret);
return ret; return ret;
} }
@ -1298,7 +1298,7 @@ static int reg_read(struct gspca_dev *gspca_dev,
PDEBUG(D_USBI, "reg read i:%04x --> %02x", PDEBUG(D_USBI, "reg read i:%04x --> %02x",
index, gspca_dev->usb_buf[0]); index, gspca_dev->usb_buf[0]);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR|D_USBI, "reg_read err %d", ret); err("reg_read err %d", ret);
return ret; return ret;
} }
return gspca_dev->usb_buf[0]; return gspca_dev->usb_buf[0];

View File

@ -315,7 +315,7 @@ static void reg_w_val(struct usb_device *dev, __u16 index, __u8 value)
value, index, NULL, 0, 500); value, index, NULL, 0, 500);
PDEBUG(D_USBO, "reg write: 0x%02x:0x%02x", index, value); PDEBUG(D_USBO, "reg write: 0x%02x:0x%02x", index, value);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR, "reg write: error %d", ret); err("reg write: error %d", ret);
} }
static void write_vector(struct gspca_dev *gspca_dev, static void write_vector(struct gspca_dev *gspca_dev,

View File

@ -123,7 +123,7 @@ static int sq905_command(struct gspca_dev *gspca_dev, u16 index)
SQ905_COMMAND, index, gspca_dev->usb_buf, 1, SQ905_COMMAND, index, gspca_dev->usb_buf, 1,
SQ905_CMD_TIMEOUT); SQ905_CMD_TIMEOUT);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "%s: usb_control_msg failed (%d)", err("%s: usb_control_msg failed (%d)",
__func__, ret); __func__, ret);
return ret; return ret;
} }
@ -135,7 +135,7 @@ static int sq905_command(struct gspca_dev *gspca_dev, u16 index)
SQ905_PING, 0, gspca_dev->usb_buf, 1, SQ905_PING, 0, gspca_dev->usb_buf, 1,
SQ905_CMD_TIMEOUT); SQ905_CMD_TIMEOUT);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "%s: usb_control_msg failed 2 (%d)", err("%s: usb_control_msg failed 2 (%d)",
__func__, ret); __func__, ret);
return ret; return ret;
} }
@ -158,7 +158,7 @@ static int sq905_ack_frame(struct gspca_dev *gspca_dev)
SQ905_READ_DONE, 0, gspca_dev->usb_buf, 1, SQ905_READ_DONE, 0, gspca_dev->usb_buf, 1,
SQ905_CMD_TIMEOUT); SQ905_CMD_TIMEOUT);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "%s: usb_control_msg failed (%d)", __func__, ret); err("%s: usb_control_msg failed (%d)", __func__, ret);
return ret; return ret;
} }
@ -186,7 +186,7 @@ sq905_read_data(struct gspca_dev *gspca_dev, u8 *data, int size, int need_lock)
if (need_lock) if (need_lock)
mutex_unlock(&gspca_dev->usb_lock); mutex_unlock(&gspca_dev->usb_lock);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "%s: usb_control_msg failed (%d)", __func__, ret); err("%s: usb_control_msg failed (%d)", __func__, ret);
return ret; return ret;
} }
ret = usb_bulk_msg(gspca_dev->dev, ret = usb_bulk_msg(gspca_dev->dev,
@ -195,7 +195,7 @@ sq905_read_data(struct gspca_dev *gspca_dev, u8 *data, int size, int need_lock)
/* successful, it returns 0, otherwise negative */ /* successful, it returns 0, otherwise negative */
if (ret < 0 || act_len != size) { if (ret < 0 || act_len != size) {
PDEBUG(D_ERR, "bulk read fail (%d) len %d/%d", err("bulk read fail (%d) len %d/%d",
ret, act_len, size); ret, act_len, size);
return -EIO; return -EIO;
} }
@ -226,7 +226,7 @@ static void sq905_dostream(struct work_struct *work)
buffer = kmalloc(SQ905_MAX_TRANSFER, GFP_KERNEL | GFP_DMA); buffer = kmalloc(SQ905_MAX_TRANSFER, GFP_KERNEL | GFP_DMA);
if (!buffer) { if (!buffer) {
PDEBUG(D_ERR, "Couldn't allocate USB buffer"); err("Couldn't allocate USB buffer");
goto quit_stream; goto quit_stream;
} }

View File

@ -95,7 +95,7 @@ static int sq905c_command(struct gspca_dev *gspca_dev, u16 command, u16 index)
command, index, NULL, 0, command, index, NULL, 0,
SQ905C_CMD_TIMEOUT); SQ905C_CMD_TIMEOUT);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "%s: usb_control_msg failed (%d)", err("%s: usb_control_msg failed (%d)",
__func__, ret); __func__, ret);
return ret; return ret;
} }
@ -115,7 +115,7 @@ static int sq905c_read(struct gspca_dev *gspca_dev, u16 command, u16 index,
command, index, gspca_dev->usb_buf, size, command, index, gspca_dev->usb_buf, size,
SQ905C_CMD_TIMEOUT); SQ905C_CMD_TIMEOUT);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "%s: usb_control_msg failed (%d)", err("%s: usb_control_msg failed (%d)",
__func__, ret); __func__, ret);
return ret; return ret;
} }
@ -146,7 +146,7 @@ static void sq905c_dostream(struct work_struct *work)
buffer = kmalloc(SQ905C_MAX_TRANSFER, GFP_KERNEL | GFP_DMA); buffer = kmalloc(SQ905C_MAX_TRANSFER, GFP_KERNEL | GFP_DMA);
if (!buffer) { if (!buffer) {
PDEBUG(D_ERR, "Couldn't allocate USB buffer"); err("Couldn't allocate USB buffer");
goto quit_stream; goto quit_stream;
} }

View File

@ -468,7 +468,7 @@ static void reg_r(struct gspca_dev *gspca_dev,
value, 0, gspca_dev->usb_buf, len, value, 0, gspca_dev->usb_buf, len,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_r %04x failed %d", value, ret); err("reg_r %04x failed %d", value, ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -488,7 +488,7 @@ static void reg_w(struct gspca_dev *gspca_dev, u16 value, u16 index)
500); 500);
msleep(30); msleep(30);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w %04x %04x failed %d", value, index, ret); err("reg_w %04x %04x failed %d", value, index, ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -511,7 +511,7 @@ static void reg_wb(struct gspca_dev *gspca_dev, u16 value, u16 index,
1000); 1000);
msleep(30); msleep(30);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_wb %04x %04x failed %d", value, index, ret); err("reg_wb %04x %04x failed %d", value, index, ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -556,7 +556,7 @@ static void i2c_write(struct sd *sd,
gspca_dev->usb_buf, buf - gspca_dev->usb_buf, gspca_dev->usb_buf, buf - gspca_dev->usb_buf,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "i2c_write failed %d", ret); err("i2c_write failed %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -612,7 +612,7 @@ static void ucbus_write(struct gspca_dev *gspca_dev,
gspca_dev->usb_buf, buf - gspca_dev->usb_buf, gspca_dev->usb_buf, buf - gspca_dev->usb_buf,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "ucbus_write failed %d", ret); err("ucbus_write failed %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
return; return;
} }
@ -688,7 +688,7 @@ static void cmos_probe(struct gspca_dev *gspca_dev)
break; break;
} }
if (i >= ARRAY_SIZE(probe_order)) if (i >= ARRAY_SIZE(probe_order))
PDEBUG(D_PROBE, "Unknown sensor"); err("Unknown sensor");
else else
sd->sensor = probe_order[i]; sd->sensor = probe_order[i];
} }
@ -1079,7 +1079,7 @@ static void sd_dq_callback(struct gspca_dev *gspca_dev)
gspca_dev->cam.bulk_nurbs = 1; gspca_dev->cam.bulk_nurbs = 1;
ret = usb_submit_urb(gspca_dev->urb[0], GFP_ATOMIC); ret = usb_submit_urb(gspca_dev->urb[0], GFP_ATOMIC);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR|D_PACK, "sd_dq_callback() err %d", ret); err("sd_dq_callback() err %d", ret);
/* wait a little time, otherwise the webcam crashes */ /* wait a little time, otherwise the webcam crashes */
msleep(100); msleep(100);

View File

@ -142,7 +142,7 @@ static u8 reg_r(struct gspca_dev *gspca_dev,
gspca_dev->usb_buf, 1, gspca_dev->usb_buf, 1,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_r err %d", ret); err("reg_r err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
return 0; return 0;
} }
@ -167,7 +167,7 @@ static void reg_w(struct gspca_dev *gspca_dev,
0, 0,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w err %d", ret); err("reg_w err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -197,7 +197,7 @@ static void rcv_val(struct gspca_dev *gspca_dev,
&alen, &alen,
500); /* timeout in milliseconds */ 500); /* timeout in milliseconds */
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "rcv_val err %d", ret); err("rcv_val err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -240,7 +240,7 @@ static void snd_val(struct gspca_dev *gspca_dev,
&alen, &alen,
500); /* timeout in milliseconds */ 500); /* timeout in milliseconds */
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "snd_val err %d", ret); err("snd_val err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} else { } else {
if (ads == 0x003f08) { if (ads == 0x003f08) {
@ -323,7 +323,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
ret = reg_r(gspca_dev, 0x0740); ret = reg_r(gspca_dev, 0x0740);
if (gspca_dev->usb_err >= 0) { if (gspca_dev->usb_err >= 0) {
if (ret != 0xff) { if (ret != 0xff) {
PDEBUG(D_ERR|D_STREAM, "init reg: 0x%02x", ret); err("init reg: 0x%02x", ret);
gspca_dev->usb_err = -EIO; gspca_dev->usb_err = -EIO;
} }
} }
@ -357,7 +357,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
gspca_dev->iface, gspca_dev->iface,
gspca_dev->alt); gspca_dev->alt);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR|D_STREAM, "set intf %d %d failed", err("set intf %d %d failed",
gspca_dev->iface, gspca_dev->alt); gspca_dev->iface, gspca_dev->alt);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
goto out; goto out;

View File

@ -79,8 +79,7 @@ static int stv_sndctrl(struct gspca_dev *gspca_dev, int set, u8 req, u16 val,
val, 0, gspca_dev->usb_buf, size, 500); val, 0, gspca_dev->usb_buf, size, 500);
if ((ret < 0) && (req != 0x0a)) if ((ret < 0) && (req != 0x0a))
PDEBUG(D_ERR, err("usb_control_msg error %i, request = 0x%x, error = %i",
"usb_control_msg error %i, request = 0x%x, error = %i",
set, req, ret); set, req, ret);
return ret; return ret;
@ -237,7 +236,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
if (stv_sndctrl(gspca_dev, 2, 0x06, 0x0100, 0x12) != 0x12 || if (stv_sndctrl(gspca_dev, 2, 0x06, 0x0100, 0x12) != 0x12 ||
gspca_dev->usb_buf[8] != 0x53 || gspca_dev->usb_buf[9] != 0x05) { gspca_dev->usb_buf[8] != 0x53 || gspca_dev->usb_buf[9] != 0x05) {
PDEBUG(D_ERR, "Could not get descriptor 0100."); err("Could not get descriptor 0100.");
return stv0680_handle_error(gspca_dev, -EIO); return stv0680_handle_error(gspca_dev, -EIO);
} }

View File

@ -189,7 +189,7 @@ int stv06xx_read_sensor(struct sd *sd, const u8 address, u16 *value)
0x04, 0x40, 0x1400, 0, buf, I2C_BUFFER_LENGTH, 0x04, 0x40, 0x1400, 0, buf, I2C_BUFFER_LENGTH,
STV06XX_URB_MSG_TIMEOUT); STV06XX_URB_MSG_TIMEOUT);
if (err < 0) { if (err < 0) {
PDEBUG(D_ERR, "I2C: Read error writing address: %d", err); err("I2C: Read error writing address: %d", err);
return err; return err;
} }

View File

@ -246,7 +246,7 @@ static int st6422_start(struct sd *sd)
intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface); intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface);
alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt); alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt);
if (!alt) { if (!alt) {
PDEBUG(D_ERR, "Couldn't get altsetting"); err("Couldn't get altsetting");
return -EIO; return -EIO;
} }

View File

@ -343,7 +343,7 @@ static void reg_r(struct gspca_dev *gspca_dev,
len ? gspca_dev->usb_buf : NULL, len, len ? gspca_dev->usb_buf : NULL, len,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_r err %d", ret); err("reg_r err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -368,7 +368,7 @@ static void reg_w_1(struct gspca_dev *gspca_dev,
gspca_dev->usb_buf, 1, gspca_dev->usb_buf, 1,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w_1 err %d", ret); err("reg_w_1 err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -388,7 +388,7 @@ static void reg_w_riv(struct gspca_dev *gspca_dev,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value, index, NULL, 0, 500); value, index, NULL, 0, 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w_riv err %d", ret); err("reg_w_riv err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
return; return;
} }
@ -413,7 +413,7 @@ static u8 reg_r_1(struct gspca_dev *gspca_dev,
gspca_dev->usb_buf, 1, gspca_dev->usb_buf, 1,
500); /* timeout */ 500); /* timeout */
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_r_1 err %d", ret); err("reg_r_1 err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
return 0; return 0;
} }
@ -440,7 +440,7 @@ static u16 reg_r_12(struct gspca_dev *gspca_dev,
gspca_dev->usb_buf, length, gspca_dev->usb_buf, length,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_r_12 err %d", ret); err("reg_r_12 err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
return 0; return 0;
} }

View File

@ -892,7 +892,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
sd->sensor = SENSOR_OM6802; sd->sensor = SENSOR_OM6802;
break; break;
default: default:
PDEBUG(D_ERR|D_PROBE, "unknown sensor %04x", sensor_id); err("unknown sensor %04x", sensor_id);
return -EINVAL; return -EINVAL;
} }

View File

@ -3164,7 +3164,7 @@ static void reg_r_i(struct gspca_dev *gspca_dev,
index, gspca_dev->usb_buf, len, index, gspca_dev->usb_buf, len,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_r err %d", ret); err("reg_r err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -3205,7 +3205,7 @@ static void reg_w_i(struct gspca_dev *gspca_dev,
value, index, NULL, 0, value, index, NULL, 0,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w err %d", ret); err("reg_w err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -3230,7 +3230,7 @@ static u16 read_sensor_register(struct gspca_dev *gspca_dev,
reg_r(gspca_dev, 0xa1, 0xb33f, 1); reg_r(gspca_dev, 0xa1, 0xb33f, 1);
if (!(gspca_dev->usb_buf[0] & 0x02)) { if (!(gspca_dev->usb_buf[0] & 0x02)) {
PDEBUG(D_ERR, "I2c Bus Busy Wait %02x", err("I2c Bus Busy Wait %02x",
gspca_dev->usb_buf[0]); gspca_dev->usb_buf[0]);
return 0; return 0;
} }
@ -3344,7 +3344,7 @@ static void i2c_write(struct gspca_dev *gspca_dev,
msleep(20); msleep(20);
} while (--retry > 0); } while (--retry > 0);
if (retry <= 0) if (retry <= 0)
PDEBUG(D_ERR, "i2c_write timeout"); err("i2c_write timeout");
} }
static void put_tab_to_reg(struct gspca_dev *gspca_dev, static void put_tab_to_reg(struct gspca_dev *gspca_dev,
@ -3440,7 +3440,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
switch (sensor) { switch (sensor) {
case -1: case -1:
PDEBUG(D_PROBE, "Unknown sensor..."); err("Unknown sensor...");
return -EINVAL; return -EINVAL;
case SENSOR_HV7131R: case SENSOR_HV7131R:
PDEBUG(D_PROBE, "Find Sensor HV7131R"); PDEBUG(D_PROBE, "Find Sensor HV7131R");

View File

@ -78,7 +78,7 @@ static int w9968cf_write_fsb(struct sd *sd, u16* data)
USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE, USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE,
value, 0x06, sd->gspca_dev.usb_buf, 6, 500); value, 0x06, sd->gspca_dev.usb_buf, 6, 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "Write FSB registers failed (%d)", ret); err("Write FSB registers failed (%d)", ret);
return ret; return ret;
} }
@ -104,7 +104,7 @@ static int w9968cf_write_sb(struct sd *sd, u16 value)
udelay(W9968CF_I2C_BUS_DELAY); udelay(W9968CF_I2C_BUS_DELAY);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "Write SB reg [01] %04x failed", value); err("Write SB reg [01] %04x failed", value);
return ret; return ret;
} }
@ -130,7 +130,7 @@ static int w9968cf_read_sb(struct sd *sd)
ret = sd->gspca_dev.usb_buf[0] | ret = sd->gspca_dev.usb_buf[0] |
(sd->gspca_dev.usb_buf[1] << 8); (sd->gspca_dev.usb_buf[1] << 8);
else else
PDEBUG(D_ERR, "Read SB reg [01] failed"); err("Read SB reg [01] failed");
udelay(W9968CF_I2C_BUS_DELAY); udelay(W9968CF_I2C_BUS_DELAY);

View File

@ -798,7 +798,7 @@ static int cit_write_reg(struct gspca_dev *gspca_dev, u16 value, u16 index)
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT,
value, index, NULL, 0, 1000); value, index, NULL, 0, 1000);
if (err < 0) if (err < 0)
PDEBUG(D_ERR, "Failed to write a register (index 0x%04X," err("Failed to write a register (index 0x%04X,"
" value 0x%02X, error %d)", index, value, err); " value 0x%02X, error %d)", index, value, err);
return 0; return 0;
@ -814,8 +814,7 @@ static int cit_read_reg(struct gspca_dev *gspca_dev, u16 index)
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT,
0x00, index, buf, 8, 1000); 0x00, index, buf, 8, 1000);
if (res < 0) { if (res < 0) {
PDEBUG(D_ERR, err("Failed to read a register (index 0x%04X, error %d)",
"Failed to read a register (index 0x%04X, error %d)",
index, res); index, res);
return res; return res;
} }
@ -1586,7 +1585,7 @@ static int cit_get_packet_size(struct gspca_dev *gspca_dev)
intf = usb_ifnum_to_if(gspca_dev->dev, gspca_dev->iface); intf = usb_ifnum_to_if(gspca_dev->dev, gspca_dev->iface);
alt = usb_altnum_to_altsetting(intf, gspca_dev->alt); alt = usb_altnum_to_altsetting(intf, gspca_dev->alt);
if (!alt) { if (!alt) {
PDEBUG(D_ERR, "Couldn't get altsetting"); err("Couldn't get altsetting");
return -EIO; return -EIO;
} }
@ -2784,7 +2783,7 @@ static int sd_isoc_nego(struct gspca_dev *gspca_dev)
ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 1); ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 1);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR|D_STREAM, "set alt 1 err %d", ret); err("set alt 1 err %d", ret);
return ret; return ret;
} }

View File

@ -5698,7 +5698,7 @@ static u8 reg_r_i(struct gspca_dev *gspca_dev,
index, gspca_dev->usb_buf, 1, index, gspca_dev->usb_buf, 1,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_r_i err %d", ret); err("reg_r_i err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
return 0; return 0;
} }
@ -5730,7 +5730,7 @@ static void reg_w_i(struct gspca_dev *gspca_dev,
value, index, NULL, 0, value, index, NULL, 0,
500); 500);
if (ret < 0) { if (ret < 0) {
PDEBUG(D_ERR, "reg_w_i err %d", ret); err("reg_w_i err %d", ret);
gspca_dev->usb_err = ret; gspca_dev->usb_err = ret;
} }
} }
@ -6503,8 +6503,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)"); PDEBUG(D_PROBE, "Sensor Tas5130 (VF0250)");
break; break;
default: default:
PDEBUG(D_PROBE, warn("Unknown sensor - set to TAS5130C");
"Unknown sensor - set to TAS5130C");
sd->sensor = SENSOR_TAS5130C; sd->sensor = SENSOR_TAS5130C;
} }
break; break;
@ -6610,7 +6609,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
sd->sensor = SENSOR_OV7620; /* same sensor (?) */ sd->sensor = SENSOR_OV7620; /* same sensor (?) */
break; break;
default: default:
PDEBUG(D_ERR|D_PROBE, "Unknown sensor %04x", sensor); err("Unknown sensor %04x", sensor);
return -EINVAL; return -EINVAL;
} }
} }