Skip to content

Commit

Permalink
USB: remove warn() macro from usb media drivers
Browse files Browse the repository at this point in the history
USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible.  In the
few places that will not work out, use a basic printk().

Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Oct 17, 2008
1 parent 1817b16 commit aa82661
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 23 deletions.
13 changes: 8 additions & 5 deletions drivers/media/radio/dsbr100.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,

radio->curfreq = f->frequency;
if (dsbr100_setfreq(radio, radio->curfreq)==-1)
warn("Set frequency failed");
dev_warn(&radio->usbdev->dev, "Set frequency failed\n");
return 0;
}

Expand Down Expand Up @@ -361,12 +361,14 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
case V4L2_CID_AUDIO_MUTE:
if (ctrl->value) {
if (dsbr100_stop(radio) == -1) {
warn("Radio did not respond properly");
dev_warn(&radio->usbdev->dev,
"Radio did not respond properly\n");
return -EBUSY;
}
} else {
if (dsbr100_start(radio) == -1) {
warn("Radio did not respond properly");
dev_warn(&radio->usbdev->dev,
"Radio did not respond properly\n");
return -EBUSY;
}
}
Expand Down Expand Up @@ -416,7 +418,8 @@ static int usb_dsbr100_open(struct inode *inode, struct file *file)
radio->muted = 1;

if (dsbr100_start(radio)<0) {
warn("Radio did not start up properly");
dev_warn(&radio->usbdev->dev,
"Radio did not start up properly\n");
radio->users = 0;
unlock_kernel();
return -EIO;
Expand Down Expand Up @@ -501,7 +504,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf,
radio->curfreq = FREQ_MIN*FREQ_MUL;
video_set_drvdata(radio->videodev, radio);
if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr) < 0) {
warn("Could not register video device");
dev_warn(&intf->dev, "Could not register video device\n");
video_device_release(radio->videodev);
kfree(radio->transfer_buffer);
kfree(radio);
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/video/dabusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static void dabusb_iso_complete (struct urb *purb)
err("dabusb_iso_complete: invalid len %d", len);
}
else
warn("dabusb_iso_complete: corrupted packet status: %d", purb->iso_frame_desc[i].status);
dev_warn(&purb->dev->dev, "dabusb_iso_complete: corrupted packet status: %d\n", purb->iso_frame_desc[i].status);
if (dst != purb->actual_length)
err("dst!=purb->actual_length:%d!=%d", dst, purb->actual_length);
}
Expand Down Expand Up @@ -289,7 +289,7 @@ static int dabusb_bulk (pdabusb_t s, pbulk_transfer_t pb)
}

if( ret == -EPIPE ) {
warn("CLEAR_FEATURE request to remove STALL condition.");
dev_warn(&s->usbdev->dev, "CLEAR_FEATURE request to remove STALL condition.\n");
if(usb_clear_halt(s->usbdev, usb_pipeendpoint(pipe)))
err("request failed");
}
Expand Down
19 changes: 12 additions & 7 deletions drivers/media/video/ov511.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,9 +1098,10 @@ ov51x_clear_snapshot(struct usb_ov511 *ov)
reg_w(ov, R51x_SYS_SNAP, 0x02);
reg_w(ov, R51x_SYS_SNAP, 0x00);
} else if (ov->bclass == BCL_OV518) {
warn("snapshot reset not supported yet on OV518(+)");
dev_warn(&ov->dev->dev,
"snapshot reset not supported yet on OV518(+)\n");
} else {
err("clear snap: invalid bridge type");
dev_err(&ov->dev->dev, "clear snap: invalid bridge type\n");
}
}

Expand All @@ -1115,14 +1116,16 @@ ov51x_check_snapshot(struct usb_ov511 *ov)
if (ov->bclass == BCL_OV511) {
ret = reg_r(ov, R51x_SYS_SNAP);
if (ret < 0) {
err("Error checking snspshot status (%d)", ret);
dev_err(&ov->dev->dev,
"Error checking snspshot status (%d)\n", ret);
} else if (ret & 0x08) {
status = 1;
}
} else if (ov->bclass == BCL_OV518) {
warn("snapshot check not supported yet on OV518(+)");
dev_warn(&ov->dev->dev,
"snapshot check not supported yet on OV518(+)\n");
} else {
err("check snap: invalid bridge type");
dev_err(&ov->dev->dev, "clear snap: invalid bridge type\n");
}

return status;
Expand Down Expand Up @@ -5217,7 +5220,8 @@ saa7111a_configure(struct usb_ov511 *ov)
if (ov->bclass == BCL_OV511)
reg_w(ov, 0x11, 0x00);
else
warn("SAA7111A not yet supported with OV518/OV518+");
dev_warn(&ov->dev->dev,
"SAA7111A not yet supported with OV518/OV518+\n");

return 0;
}
Expand Down Expand Up @@ -5456,7 +5460,8 @@ ov518_configure(struct usb_ov511 *ov)
* required. OV518 has no uncompressed mode, to save RAM. */
if (!dumppix && !ov->compress) {
ov->compress = 1;
warn("Compression required with OV518...enabling");
dev_warn(&ov->dev->dev,
"Compression required with OV518...enabling\n");
}

if (ov->bridge == BRG_OV518) {
Expand Down
8 changes: 5 additions & 3 deletions drivers/media/video/usbvideo/konicawc.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev

cam->input = input_dev = input_allocate_device();
if (!input_dev) {
warn("Not enough memory for camera's input device\n");
dev_warn(&dev->dev,
"Not enough memory for camera's input device\n");
return;
}

Expand All @@ -243,8 +244,9 @@ static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev

error = input_register_device(cam->input);
if (error) {
warn("Failed to register camera's input device, err: %d\n",
error);
dev_warn(&dev->dev,
"Failed to register camera's input device, err: %d\n",
error);
input_free_device(cam->input);
cam->input = NULL;
}
Expand Down
14 changes: 8 additions & 6 deletions drivers/media/video/usbvideo/quickcam_messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void qcm_register_input(struct qcm *cam, struct usb_device *dev)

cam->input = input_dev = input_allocate_device();
if (!input_dev) {
warn("insufficient mem for cam input device");
dev_warn(&dev->dev, "insufficient mem for cam input device\n");
return;
}

Expand All @@ -107,8 +107,9 @@ static void qcm_register_input(struct qcm *cam, struct usb_device *dev)

error = input_register_device(cam->input);
if (error) {
warn("Failed to register camera's input device, err: %d\n",
error);
dev_warn(&dev->dev,
"Failed to register camera's input device, err: %d\n",
error);
input_free_device(cam->input);
cam->input = NULL;
}
Expand Down Expand Up @@ -587,8 +588,9 @@ static int qcm_compress_iso(struct uvd *uvd, struct urb *dataurb)
dataurb->iso_frame_desc[i].offset;

if (st < 0) {
warn("Data error: packet=%d. len=%d. status=%d.",
i, n, st);
dev_warn(&uvd->dev->dev,
"Data error: packet=%d. len=%d. status=%d.\n",
i, n, st);
uvd->stats.iso_err_count++;
continue;
}
Expand Down Expand Up @@ -699,7 +701,7 @@ static void qcm_stop_data(struct uvd *uvd)

ret = qcm_camera_off(uvd);
if (ret)
warn("couldn't turn the cam off.");
dev_warn(&uvd->dev->dev, "couldn't turn the cam off.\n");

uvd->streaming = 0;

Expand Down

0 comments on commit aa82661

Please sign in to comment.