diff options
Diffstat (limited to 'drivers/media/usb/gspca/cpia1.c')
-rw-r--r-- | drivers/media/usb/gspca/cpia1.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c index 1dcdd9f95f1c..064b53043b15 100644 --- a/drivers/media/usb/gspca/cpia1.c +++ b/drivers/media/usb/gspca/cpia1.c | |||
@@ -421,8 +421,7 @@ static int cpia_usb_transferCmd(struct gspca_dev *gspca_dev, u8 *command) | |||
421 | pipe = usb_sndctrlpipe(gspca_dev->dev, 0); | 421 | pipe = usb_sndctrlpipe(gspca_dev->dev, 0); |
422 | requesttype = USB_TYPE_VENDOR | USB_RECIP_DEVICE; | 422 | requesttype = USB_TYPE_VENDOR | USB_RECIP_DEVICE; |
423 | } else { | 423 | } else { |
424 | PDEBUG(D_ERR, "Unexpected first byte of command: %x", | 424 | PERR("Unexpected first byte of command: %x", command[0]); |
425 | command[0]); | ||
426 | return -EINVAL; | 425 | return -EINVAL; |
427 | } | 426 | } |
428 | 427 | ||
@@ -701,7 +700,7 @@ static void reset_camera_params(struct gspca_dev *gspca_dev) | |||
701 | params->qx3.cradled = 0; | 700 | params->qx3.cradled = 0; |
702 | } | 701 | } |
703 | 702 | ||
704 | static void printstatus(struct cam_params *params) | 703 | static void printstatus(struct gspca_dev *gspca_dev, struct cam_params *params) |
705 | { | 704 | { |
706 | PDEBUG(D_PROBE, "status: %02x %02x %02x %02x %02x %02x %02x %02x", | 705 | PDEBUG(D_PROBE, "status: %02x %02x %02x %02x %02x %02x %02x %02x", |
707 | params->status.systemState, params->status.grabState, | 706 | params->status.systemState, params->status.grabState, |
@@ -725,10 +724,9 @@ static int goto_low_power(struct gspca_dev *gspca_dev) | |||
725 | 724 | ||
726 | if (sd->params.status.systemState != LO_POWER_STATE) { | 725 | if (sd->params.status.systemState != LO_POWER_STATE) { |
727 | if (sd->params.status.systemState != WARM_BOOT_STATE) { | 726 | if (sd->params.status.systemState != WARM_BOOT_STATE) { |
728 | PDEBUG(D_ERR, | 727 | PERR("unexpected state after lo power cmd: %02x", |
729 | "unexpected state after lo power cmd: %02x", | 728 | sd->params.status.systemState); |
730 | sd->params.status.systemState); | 729 | printstatus(gspca_dev, &sd->params); |
731 | printstatus(&sd->params); | ||
732 | } | 730 | } |
733 | return -EIO; | 731 | return -EIO; |
734 | } | 732 | } |
@@ -756,9 +754,9 @@ static int goto_high_power(struct gspca_dev *gspca_dev) | |||
756 | return ret; | 754 | return ret; |
757 | 755 | ||
758 | if (sd->params.status.systemState != HI_POWER_STATE) { | 756 | if (sd->params.status.systemState != HI_POWER_STATE) { |
759 | PDEBUG(D_ERR, "unexpected state after hi power cmd: %02x", | 757 | PERR("unexpected state after hi power cmd: %02x", |
760 | sd->params.status.systemState); | 758 | sd->params.status.systemState); |
761 | printstatus(&sd->params); | 759 | printstatus(gspca_dev, &sd->params); |
762 | return -EIO; | 760 | return -EIO; |
763 | } | 761 | } |
764 | 762 | ||
@@ -1449,8 +1447,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1449 | sd->params.version.firmwareVersion = 0; | 1447 | sd->params.version.firmwareVersion = 0; |
1450 | get_version_information(gspca_dev); | 1448 | get_version_information(gspca_dev); |
1451 | if (sd->params.version.firmwareVersion != 1) { | 1449 | if (sd->params.version.firmwareVersion != 1) { |
1452 | PDEBUG(D_ERR, "only firmware version 1 is supported (got: %d)", | 1450 | PERR("only firmware version 1 is supported (got: %d)", |
1453 | sd->params.version.firmwareVersion); | 1451 | sd->params.version.firmwareVersion); |
1454 | return -ENODEV; | 1452 | return -ENODEV; |
1455 | } | 1453 | } |
1456 | 1454 | ||
@@ -1475,9 +1473,9 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1475 | /* Start the camera in low power mode */ | 1473 | /* Start the camera in low power mode */ |
1476 | if (goto_low_power(gspca_dev)) { | 1474 | if (goto_low_power(gspca_dev)) { |
1477 | if (sd->params.status.systemState != WARM_BOOT_STATE) { | 1475 | if (sd->params.status.systemState != WARM_BOOT_STATE) { |
1478 | PDEBUG(D_ERR, "unexpected systemstate: %02x", | 1476 | PERR("unexpected systemstate: %02x", |
1479 | sd->params.status.systemState); | 1477 | sd->params.status.systemState); |
1480 | printstatus(&sd->params); | 1478 | printstatus(gspca_dev, &sd->params); |
1481 | return -ENODEV; | 1479 | return -ENODEV; |
1482 | } | 1480 | } |
1483 | 1481 | ||
@@ -1523,9 +1521,8 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
1523 | return ret; | 1521 | return ret; |
1524 | 1522 | ||
1525 | if (sd->params.status.fatalError) { | 1523 | if (sd->params.status.fatalError) { |
1526 | PDEBUG(D_ERR, "fatal_error: %04x, vp_status: %04x", | 1524 | PERR("fatal_error: %04x, vp_status: %04x", |
1527 | sd->params.status.fatalError, | 1525 | sd->params.status.fatalError, sd->params.status.vpStatus); |
1528 | sd->params.status.vpStatus); | ||
1529 | return -EIO; | 1526 | return -EIO; |
1530 | } | 1527 | } |
1531 | 1528 | ||