diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2009-01-08 07:13:42 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:26 -0400 |
commit | be9ed5117d95cdc4e601f9da220ebeaaab131679 (patch) | |
tree | 9dc12b47951ded56ec654c579253e07514360fd2 /drivers/media/video/s2255drv.c | |
parent | f180152376c984a6faa9decb8f2811c373da9141 (diff) |
V4L/DVB (10298): remove err macro from few usb devices
Patch removes err() macros from few usb devices.
It places pr_err in pvrusb2-v4l2.c, dev_err in dabusb and in usbvision
drivers. Beside placing dev_err, patch defines new s2255_dev_err macro
with S2255_DRIVER_NAME in s2255 module.
Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Acked-by: Thierry Merle <thierry.merle@free.fr>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s2255drv.c')
-rw-r--r-- | drivers/media/video/s2255drv.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c index 13f85ad363cd..31bc94075268 100644 --- a/drivers/media/video/s2255drv.c +++ b/drivers/media/video/s2255drv.c | |||
@@ -336,14 +336,19 @@ static long s2255_vendor_req(struct s2255_dev *dev, unsigned char req, | |||
336 | u16 index, u16 value, void *buf, | 336 | u16 index, u16 value, void *buf, |
337 | s32 buf_len, int bOut); | 337 | s32 buf_len, int bOut); |
338 | 338 | ||
339 | /* dev_err macro with driver name */ | ||
340 | #define S2255_DRIVER_NAME "s2255" | ||
341 | #define s2255_dev_err(dev, fmt, arg...) \ | ||
342 | dev_err(dev, S2255_DRIVER_NAME " - " fmt, ##arg) | ||
343 | |||
339 | #define dprintk(level, fmt, arg...) \ | 344 | #define dprintk(level, fmt, arg...) \ |
340 | do { \ | 345 | do { \ |
341 | if (*s2255_debug >= (level)) { \ | 346 | if (*s2255_debug >= (level)) { \ |
342 | printk(KERN_DEBUG "s2255: " fmt, ##arg); \ | 347 | printk(KERN_DEBUG S2255_DRIVER_NAME \ |
348 | ": " fmt, ##arg); \ | ||
343 | } \ | 349 | } \ |
344 | } while (0) | 350 | } while (0) |
345 | 351 | ||
346 | |||
347 | static struct usb_driver s2255_driver; | 352 | static struct usb_driver s2255_driver; |
348 | 353 | ||
349 | 354 | ||
@@ -528,14 +533,14 @@ static void s2255_fwchunk_complete(struct urb *urb) | |||
528 | int len; | 533 | int len; |
529 | dprintk(100, "udev %p urb %p", udev, urb); | 534 | dprintk(100, "udev %p urb %p", udev, urb); |
530 | if (urb->status) { | 535 | if (urb->status) { |
531 | dev_err(&udev->dev, "URB failed with status %d", urb->status); | 536 | dev_err(&udev->dev, "URB failed with status %d\n", urb->status); |
532 | atomic_set(&data->fw_state, S2255_FW_FAILED); | 537 | atomic_set(&data->fw_state, S2255_FW_FAILED); |
533 | /* wake up anything waiting for the firmware */ | 538 | /* wake up anything waiting for the firmware */ |
534 | wake_up(&data->wait_fw); | 539 | wake_up(&data->wait_fw); |
535 | return; | 540 | return; |
536 | } | 541 | } |
537 | if (data->fw_urb == NULL) { | 542 | if (data->fw_urb == NULL) { |
538 | dev_err(&udev->dev, "s2255 disconnected\n"); | 543 | s2255_dev_err(&udev->dev, "disconnected\n"); |
539 | atomic_set(&data->fw_state, S2255_FW_FAILED); | 544 | atomic_set(&data->fw_state, S2255_FW_FAILED); |
540 | /* wake up anything waiting for the firmware */ | 545 | /* wake up anything waiting for the firmware */ |
541 | wake_up(&data->wait_fw); | 546 | wake_up(&data->wait_fw); |
@@ -1278,7 +1283,7 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) | |||
1278 | } | 1283 | } |
1279 | 1284 | ||
1280 | if (!res_get(dev, fh)) { | 1285 | if (!res_get(dev, fh)) { |
1281 | dev_err(&dev->udev->dev, "s2255: stream busy\n"); | 1286 | s2255_dev_err(&dev->udev->dev, "stream busy\n"); |
1282 | return -EBUSY; | 1287 | return -EBUSY; |
1283 | } | 1288 | } |
1284 | 1289 | ||
@@ -1545,7 +1550,8 @@ static int s2255_open(struct file *file) | |||
1545 | 1550 | ||
1546 | switch (atomic_read(&dev->fw_data->fw_state)) { | 1551 | switch (atomic_read(&dev->fw_data->fw_state)) { |
1547 | case S2255_FW_FAILED: | 1552 | case S2255_FW_FAILED: |
1548 | err("2255 firmware load failed. retrying.\n"); | 1553 | s2255_dev_err(&dev->udev->dev, |
1554 | "firmware load failed. retrying.\n"); | ||
1549 | s2255_fwload_start(dev, 1); | 1555 | s2255_fwload_start(dev, 1); |
1550 | wait_event_timeout(dev->fw_data->wait_fw, | 1556 | wait_event_timeout(dev->fw_data->wait_fw, |
1551 | ((atomic_read(&dev->fw_data->fw_state) | 1557 | ((atomic_read(&dev->fw_data->fw_state) |
@@ -2173,7 +2179,8 @@ static int s2255_board_init(struct s2255_dev *dev) | |||
2173 | 2179 | ||
2174 | printk(KERN_INFO "2255 usb firmware version %d \n", fw_ver); | 2180 | printk(KERN_INFO "2255 usb firmware version %d \n", fw_ver); |
2175 | if (fw_ver < CUR_USB_FWVER) | 2181 | if (fw_ver < CUR_USB_FWVER) |
2176 | err("usb firmware not up to date %d\n", fw_ver); | 2182 | dev_err(&dev->udev->dev, |
2183 | "usb firmware not up to date %d\n", fw_ver); | ||
2177 | 2184 | ||
2178 | for (j = 0; j < MAX_CHANNELS; j++) { | 2185 | for (j = 0; j < MAX_CHANNELS; j++) { |
2179 | dev->b_acquire[j] = 0; | 2186 | dev->b_acquire[j] = 0; |
@@ -2228,13 +2235,13 @@ static void read_pipe_completion(struct urb *purb) | |||
2228 | dprintk(100, "read pipe completion %p, status %d\n", purb, | 2235 | dprintk(100, "read pipe completion %p, status %d\n", purb, |
2229 | purb->status); | 2236 | purb->status); |
2230 | if (pipe_info == NULL) { | 2237 | if (pipe_info == NULL) { |
2231 | err("no context !"); | 2238 | dev_err(&purb->dev->dev, "no context!\n"); |
2232 | return; | 2239 | return; |
2233 | } | 2240 | } |
2234 | 2241 | ||
2235 | dev = pipe_info->dev; | 2242 | dev = pipe_info->dev; |
2236 | if (dev == NULL) { | 2243 | if (dev == NULL) { |
2237 | err("no context !"); | 2244 | dev_err(&purb->dev->dev, "no context!\n"); |
2238 | return; | 2245 | return; |
2239 | } | 2246 | } |
2240 | status = purb->status; | 2247 | status = purb->status; |
@@ -2286,7 +2293,7 @@ static int s2255_start_readpipe(struct s2255_dev *dev) | |||
2286 | pipe_info->stream_urb = usb_alloc_urb(0, GFP_KERNEL); | 2293 | pipe_info->stream_urb = usb_alloc_urb(0, GFP_KERNEL); |
2287 | if (!pipe_info->stream_urb) { | 2294 | if (!pipe_info->stream_urb) { |
2288 | dev_err(&dev->udev->dev, | 2295 | dev_err(&dev->udev->dev, |
2289 | "ReadStream: Unable to alloc URB"); | 2296 | "ReadStream: Unable to alloc URB\n"); |
2290 | return -ENOMEM; | 2297 | return -ENOMEM; |
2291 | } | 2298 | } |
2292 | /* transfer buffer allocated in board_init */ | 2299 | /* transfer buffer allocated in board_init */ |
@@ -2391,7 +2398,7 @@ static void s2255_stop_readpipe(struct s2255_dev *dev) | |||
2391 | int j; | 2398 | int j; |
2392 | 2399 | ||
2393 | if (dev == NULL) { | 2400 | if (dev == NULL) { |
2394 | err("s2255: invalid device"); | 2401 | s2255_dev_err(&dev->udev->dev, "invalid device\n"); |
2395 | return; | 2402 | return; |
2396 | } | 2403 | } |
2397 | dprintk(4, "stop read pipe\n"); | 2404 | dprintk(4, "stop read pipe\n"); |
@@ -2453,7 +2460,7 @@ static int s2255_probe(struct usb_interface *interface, | |||
2453 | /* allocate memory for our device state and initialize it to zero */ | 2460 | /* allocate memory for our device state and initialize it to zero */ |
2454 | dev = kzalloc(sizeof(struct s2255_dev), GFP_KERNEL); | 2461 | dev = kzalloc(sizeof(struct s2255_dev), GFP_KERNEL); |
2455 | if (dev == NULL) { | 2462 | if (dev == NULL) { |
2456 | err("s2255: out of memory"); | 2463 | s2255_dev_err(&interface->dev, "out of memory\n"); |
2457 | goto error; | 2464 | goto error; |
2458 | } | 2465 | } |
2459 | 2466 | ||
@@ -2487,7 +2494,7 @@ static int s2255_probe(struct usb_interface *interface, | |||
2487 | } | 2494 | } |
2488 | 2495 | ||
2489 | if (!dev->read_endpoint) { | 2496 | if (!dev->read_endpoint) { |
2490 | dev_err(&interface->dev, "Could not find bulk-in endpoint"); | 2497 | dev_err(&interface->dev, "Could not find bulk-in endpoint\n"); |
2491 | goto error; | 2498 | goto error; |
2492 | } | 2499 | } |
2493 | 2500 | ||
@@ -2583,7 +2590,7 @@ static void s2255_disconnect(struct usb_interface *interface) | |||
2583 | } | 2590 | } |
2584 | 2591 | ||
2585 | static struct usb_driver s2255_driver = { | 2592 | static struct usb_driver s2255_driver = { |
2586 | .name = "s2255", | 2593 | .name = S2255_DRIVER_NAME, |
2587 | .probe = s2255_probe, | 2594 | .probe = s2255_probe, |
2588 | .disconnect = s2255_disconnect, | 2595 | .disconnect = s2255_disconnect, |
2589 | .id_table = s2255_table, | 2596 | .id_table = s2255_table, |
@@ -2597,7 +2604,8 @@ static int __init usb_s2255_init(void) | |||
2597 | result = usb_register(&s2255_driver); | 2604 | result = usb_register(&s2255_driver); |
2598 | 2605 | ||
2599 | if (result) | 2606 | if (result) |
2600 | err("usb_register failed. Error number %d", result); | 2607 | pr_err(KBUILD_MODNAME |
2608 | ": usb_register failed. Error number %d\n", result); | ||
2601 | 2609 | ||
2602 | dprintk(2, "s2255_init: done\n"); | 2610 | dprintk(2, "s2255_init: done\n"); |
2603 | return result; | 2611 | return result; |