aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/usbvision
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2009-01-08 07:13:42 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:26 -0400
commitbe9ed5117d95cdc4e601f9da220ebeaaab131679 (patch)
tree9dc12b47951ded56ec654c579253e07514360fd2 /drivers/media/video/usbvision
parentf180152376c984a6faa9decb8f2811c373da9141 (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/usbvision')
-rw-r--r--drivers/media/video/usbvision/usbvision-core.c44
-rw-r--r--drivers/media/video/usbvision/usbvision-i2c.c6
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c36
3 files changed, 53 insertions, 33 deletions
diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c
index 9e4f50639975..4444e7e3cdf8 100644
--- a/drivers/media/video/usbvision/usbvision-core.c
+++ b/drivers/media/video/usbvision/usbvision-core.c
@@ -381,8 +381,9 @@ int usbvision_scratch_alloc(struct usb_usbvision *usbvision)
381 usbvision->scratch = vmalloc_32(scratch_buf_size); 381 usbvision->scratch = vmalloc_32(scratch_buf_size);
382 scratch_reset(usbvision); 382 scratch_reset(usbvision);
383 if(usbvision->scratch == NULL) { 383 if(usbvision->scratch == NULL) {
384 err("%s: unable to allocate %d bytes for scratch", 384 dev_err(&usbvision->dev->dev,
385 __func__, scratch_buf_size); 385 "%s: unable to allocate %d bytes for scratch\n",
386 __func__, scratch_buf_size);
386 return -ENOMEM; 387 return -ENOMEM;
387 } 388 }
388 return 0; 389 return 0;
@@ -491,8 +492,9 @@ int usbvision_decompress_alloc(struct usb_usbvision *usbvision)
491 int IFB_size = MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 3 / 2; 492 int IFB_size = MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 3 / 2;
492 usbvision->IntraFrameBuffer = vmalloc_32(IFB_size); 493 usbvision->IntraFrameBuffer = vmalloc_32(IFB_size);
493 if (usbvision->IntraFrameBuffer == NULL) { 494 if (usbvision->IntraFrameBuffer == NULL) {
494 err("%s: unable to allocate %d for compr. frame buffer", 495 dev_err(&usbvision->dev->dev,
495 __func__, IFB_size); 496 "%s: unable to allocate %d for compr. frame buffer\n",
497 __func__, IFB_size);
496 return -ENOMEM; 498 return -ENOMEM;
497 } 499 }
498 return 0; 500 return 0;
@@ -1514,8 +1516,9 @@ static void usbvision_isocIrq(struct urb *urb)
1514 errCode = usb_submit_urb (urb, GFP_ATOMIC); 1516 errCode = usb_submit_urb (urb, GFP_ATOMIC);
1515 1517
1516 if(errCode) { 1518 if(errCode) {
1517 err("%s: usb_submit_urb failed: error %d", 1519 dev_err(&usbvision->dev->dev,
1518 __func__, errCode); 1520 "%s: usb_submit_urb failed: error %d\n",
1521 __func__, errCode);
1519 } 1522 }
1520 1523
1521 return; 1524 return;
@@ -1546,7 +1549,8 @@ int usbvision_read_reg(struct usb_usbvision *usbvision, unsigned char reg)
1546 0, (__u16) reg, buffer, 1, HZ); 1549 0, (__u16) reg, buffer, 1, HZ);
1547 1550
1548 if (errCode < 0) { 1551 if (errCode < 0) {
1549 err("%s: failed: error %d", __func__, errCode); 1552 dev_err(&usbvision->dev->dev,
1553 "%s: failed: error %d\n", __func__, errCode);
1550 return errCode; 1554 return errCode;
1551 } 1555 }
1552 return buffer[0]; 1556 return buffer[0];
@@ -1574,7 +1578,8 @@ int usbvision_write_reg(struct usb_usbvision *usbvision, unsigned char reg,
1574 USB_RECIP_ENDPOINT, 0, (__u16) reg, &value, 1, HZ); 1578 USB_RECIP_ENDPOINT, 0, (__u16) reg, &value, 1, HZ);
1575 1579
1576 if (errCode < 0) { 1580 if (errCode < 0) {
1577 err("%s: failed: error %d", __func__, errCode); 1581 dev_err(&usbvision->dev->dev,
1582 "%s: failed: error %d\n", __func__, errCode);
1578 } 1583 }
1579 return errCode; 1584 return errCode;
1580} 1585}
@@ -1850,7 +1855,8 @@ int usbvision_set_output(struct usb_usbvision *usbvision, int width,
1850 0, (__u16) USBVISION_LXSIZE_O, value, 4, HZ); 1855 0, (__u16) USBVISION_LXSIZE_O, value, 4, HZ);
1851 1856
1852 if (errCode < 0) { 1857 if (errCode < 0) {
1853 err("%s failed: error %d", __func__, errCode); 1858 dev_err(&usbvision->dev->dev,
1859 "%s failed: error %d\n", __func__, errCode);
1854 return errCode; 1860 return errCode;
1855 } 1861 }
1856 usbvision->curwidth = usbvision->stretch_width * UsbWidth; 1862 usbvision->curwidth = usbvision->stretch_width * UsbWidth;
@@ -2236,7 +2242,7 @@ static int usbvision_set_dram_settings(struct usb_usbvision *usbvision)
2236 (__u16) USBVISION_DRM_PRM1, value, 8, HZ); 2242 (__u16) USBVISION_DRM_PRM1, value, 8, HZ);
2237 2243
2238 if (rc < 0) { 2244 if (rc < 0) {
2239 err("%sERROR=%d", __func__, rc); 2245 dev_err(&usbvision->dev->dev, "%sERROR=%d\n", __func__, rc);
2240 return rc; 2246 return rc;
2241 } 2247 }
2242 2248
@@ -2432,8 +2438,9 @@ int usbvision_set_alternate(struct usb_usbvision *dev)
2432 PDEBUG(DBG_FUNC,"setting alternate %d with wMaxPacketSize=%u", dev->ifaceAlt,dev->isocPacketSize); 2438 PDEBUG(DBG_FUNC,"setting alternate %d with wMaxPacketSize=%u", dev->ifaceAlt,dev->isocPacketSize);
2433 errCode = usb_set_interface(dev->dev, dev->iface, dev->ifaceAlt); 2439 errCode = usb_set_interface(dev->dev, dev->iface, dev->ifaceAlt);
2434 if (errCode < 0) { 2440 if (errCode < 0) {
2435 err ("cannot change alternate number to %d (error=%i)", 2441 dev_err(&dev->dev->dev,
2436 dev->ifaceAlt, errCode); 2442 "cannot change alternate number to %d (error=%i)\n",
2443 dev->ifaceAlt, errCode);
2437 return errCode; 2444 return errCode;
2438 } 2445 }
2439 } 2446 }
@@ -2484,7 +2491,8 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
2484 2491
2485 urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL); 2492 urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL);
2486 if (urb == NULL) { 2493 if (urb == NULL) {
2487 err("%s: usb_alloc_urb() failed", __func__); 2494 dev_err(&usbvision->dev->dev,
2495 "%s: usb_alloc_urb() failed\n", __func__);
2488 return -ENOMEM; 2496 return -ENOMEM;
2489 } 2497 }
2490 usbvision->sbuf[bufIdx].urb = urb; 2498 usbvision->sbuf[bufIdx].urb = urb;
@@ -2516,8 +2524,9 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
2516 errCode = usb_submit_urb(usbvision->sbuf[bufIdx].urb, 2524 errCode = usb_submit_urb(usbvision->sbuf[bufIdx].urb,
2517 GFP_KERNEL); 2525 GFP_KERNEL);
2518 if (errCode) { 2526 if (errCode) {
2519 err("%s: usb_submit_urb(%d) failed: error %d", 2527 dev_err(&usbvision->dev->dev,
2520 __func__, bufIdx, errCode); 2528 "%s: usb_submit_urb(%d) failed: error %d\n",
2529 __func__, bufIdx, errCode);
2521 } 2530 }
2522 } 2531 }
2523 2532
@@ -2566,8 +2575,9 @@ void usbvision_stop_isoc(struct usb_usbvision *usbvision)
2566 errCode = usb_set_interface(usbvision->dev, usbvision->iface, 2575 errCode = usb_set_interface(usbvision->dev, usbvision->iface,
2567 usbvision->ifaceAlt); 2576 usbvision->ifaceAlt);
2568 if (errCode < 0) { 2577 if (errCode < 0) {
2569 err("%s: usb_set_interface() failed: error %d", 2578 dev_err(&usbvision->dev->dev,
2570 __func__, errCode); 2579 "%s: usb_set_interface() failed: error %d\n",
2580 __func__, errCode);
2571 usbvision->last_error = errCode; 2581 usbvision->last_error = errCode;
2572 } 2582 }
2573 regValue = (16-usbvision_read_reg(usbvision, USBVISION_ALTER_REG)) & 0x0F; 2583 regValue = (16-usbvision_read_reg(usbvision, USBVISION_ALTER_REG)) & 0x0F;
diff --git a/drivers/media/video/usbvision/usbvision-i2c.c b/drivers/media/video/usbvision/usbvision-i2c.c
index 6b66ae4f430f..6057098282ca 100644
--- a/drivers/media/video/usbvision/usbvision-i2c.c
+++ b/drivers/media/video/usbvision/usbvision-i2c.c
@@ -119,7 +119,8 @@ static inline int usb_find_address(struct i2c_adapter *i2c_adap,
119 /* try extended address code... */ 119 /* try extended address code... */
120 ret = try_write_address(i2c_adap, addr, retries); 120 ret = try_write_address(i2c_adap, addr, retries);
121 if (ret != 1) { 121 if (ret != 1) {
122 err("died at extended address code, while writing"); 122 dev_err(&i2c_adap->dev,
123 "died at extended address code, while writing\n");
123 return -EREMOTEIO; 124 return -EREMOTEIO;
124 } 125 }
125 add[0] = addr; 126 add[0] = addr;
@@ -128,7 +129,8 @@ static inline int usb_find_address(struct i2c_adapter *i2c_adap,
128 addr |= 0x01; 129 addr |= 0x01;
129 ret = try_read_address(i2c_adap, addr, retries); 130 ret = try_read_address(i2c_adap, addr, retries);
130 if (ret != 1) { 131 if (ret != 1) {
131 err("died at extended address code, while reading"); 132 dev_err(&i2c_adap->dev,
133 "died at extended address code, while reading\n");
132 return -EREMOTEIO; 134 return -EREMOTEIO;
133 } 135 }
134 } 136 }
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index 2622de003a45..47d672da5415 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -329,7 +329,7 @@ static void usbvision_create_sysfs(struct video_device *vdev)
329 return; 329 return;
330 } while (0); 330 } while (0);
331 331
332 err("%s error: %d\n", __func__, res); 332 dev_err(&vdev->dev, "%s error: %d\n", __func__, res);
333} 333}
334 334
335static void usbvision_remove_sysfs(struct video_device *vdev) 335static void usbvision_remove_sysfs(struct video_device *vdev)
@@ -487,8 +487,9 @@ static int vidioc_g_register (struct file *file, void *priv,
487 /* NT100x has a 8-bit register space */ 487 /* NT100x has a 8-bit register space */
488 errCode = usbvision_read_reg(usbvision, reg->reg&0xff); 488 errCode = usbvision_read_reg(usbvision, reg->reg&0xff);
489 if (errCode < 0) { 489 if (errCode < 0) {
490 err("%s: VIDIOC_DBG_G_REGISTER failed: error %d", 490 dev_err(&usbvision->vdev->dev,
491 __func__, errCode); 491 "%s: VIDIOC_DBG_G_REGISTER failed: error %d\n",
492 __func__, errCode);
492 return errCode; 493 return errCode;
493 } 494 }
494 reg->val = errCode; 495 reg->val = errCode;
@@ -507,8 +508,9 @@ static int vidioc_s_register (struct file *file, void *priv,
507 /* NT100x has a 8-bit register space */ 508 /* NT100x has a 8-bit register space */
508 errCode = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val); 509 errCode = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val);
509 if (errCode < 0) { 510 if (errCode < 0) {
510 err("%s: VIDIOC_DBG_S_REGISTER failed: error %d", 511 dev_err(&usbvision->vdev->dev,
511 __func__, errCode); 512 "%s: VIDIOC_DBG_S_REGISTER failed: error %d\n",
513 __func__, errCode);
512 return errCode; 514 return errCode;
513 } 515 }
514 return 0; 516 return 0;
@@ -1189,7 +1191,9 @@ static int usbvision_radio_open(struct file *file)
1189 mutex_lock(&usbvision->lock); 1191 mutex_lock(&usbvision->lock);
1190 1192
1191 if (usbvision->user) { 1193 if (usbvision->user) {
1192 err("%s: Someone tried to open an already opened USBVision Radio!", __func__); 1194 dev_err(&usbvision->rdev->dev,
1195 "%s: Someone tried to open an already opened USBVision Radio!\n",
1196 __func__);
1193 errCode = -EBUSY; 1197 errCode = -EBUSY;
1194 } 1198 }
1195 else { 1199 else {
@@ -1413,7 +1417,8 @@ static struct video_device *usbvision_vdev_init(struct usb_usbvision *usbvision,
1413 struct video_device *vdev; 1417 struct video_device *vdev;
1414 1418
1415 if (usb_dev == NULL) { 1419 if (usb_dev == NULL) {
1416 err("%s: usbvision->dev is not set", __func__); 1420 dev_err(&usbvision->dev->dev,
1421 "%s: usbvision->dev is not set\n", __func__);
1417 return NULL; 1422 return NULL;
1418 } 1423 }
1419 1424
@@ -1524,7 +1529,9 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
1524 return 0; 1529 return 0;
1525 1530
1526 err_exit: 1531 err_exit:
1527 err("USBVision[%d]: video_register_device() failed", usbvision->nr); 1532 dev_err(&usbvision->dev->dev,
1533 "USBVision[%d]: video_register_device() failed\n",
1534 usbvision->nr);
1528 usbvision_unregister_video(usbvision); 1535 usbvision_unregister_video(usbvision);
1529 return -1; 1536 return -1;
1530} 1537}
@@ -1675,20 +1682,20 @@ static int __devinit usbvision_probe(struct usb_interface *intf,
1675 } 1682 }
1676 endpoint = &interface->endpoint[1].desc; 1683 endpoint = &interface->endpoint[1].desc;
1677 if (!usb_endpoint_xfer_isoc(endpoint)) { 1684 if (!usb_endpoint_xfer_isoc(endpoint)) {
1678 err("%s: interface %d. has non-ISO endpoint!", 1685 dev_err(&intf->dev, "%s: interface %d. has non-ISO endpoint!\n",
1679 __func__, ifnum); 1686 __func__, ifnum);
1680 err("%s: Endpoint attributes %d", 1687 dev_err(&intf->dev, "%s: Endpoint attributes %d",
1681 __func__, endpoint->bmAttributes); 1688 __func__, endpoint->bmAttributes);
1682 return -ENODEV; 1689 return -ENODEV;
1683 } 1690 }
1684 if (usb_endpoint_dir_out(endpoint)) { 1691 if (usb_endpoint_dir_out(endpoint)) {
1685 err("%s: interface %d. has ISO OUT endpoint!", 1692 dev_err(&intf->dev, "%s: interface %d. has ISO OUT endpoint!\n",
1686 __func__, ifnum); 1693 __func__, ifnum);
1687 return -ENODEV; 1694 return -ENODEV;
1688 } 1695 }
1689 1696
1690 if ((usbvision = usbvision_alloc(dev)) == NULL) { 1697 if ((usbvision = usbvision_alloc(dev)) == NULL) {
1691 err("%s: couldn't allocate USBVision struct", __func__); 1698 dev_err(&intf->dev, "%s: couldn't allocate USBVision struct\n", __func__);
1692 return -ENOMEM; 1699 return -ENOMEM;
1693 } 1700 }
1694 1701
@@ -1711,7 +1718,7 @@ static int __devinit usbvision_probe(struct usb_interface *intf,
1711 usbvision->alt_max_pkt_size = kmalloc(32* 1718 usbvision->alt_max_pkt_size = kmalloc(32*
1712 usbvision->num_alt,GFP_KERNEL); 1719 usbvision->num_alt,GFP_KERNEL);
1713 if (usbvision->alt_max_pkt_size == NULL) { 1720 if (usbvision->alt_max_pkt_size == NULL) {
1714 err("usbvision: out of memory!\n"); 1721 dev_err(&intf->dev, "usbvision: out of memory!\n");
1715 mutex_unlock(&usbvision->lock); 1722 mutex_unlock(&usbvision->lock);
1716 return -ENOMEM; 1723 return -ENOMEM;
1717 } 1724 }
@@ -1772,7 +1779,8 @@ static void __devexit usbvision_disconnect(struct usb_interface *intf)
1772 PDEBUG(DBG_PROBE, ""); 1779 PDEBUG(DBG_PROBE, "");
1773 1780
1774 if (usbvision == NULL) { 1781 if (usbvision == NULL) {
1775 err("%s: usb_get_intfdata() failed", __func__); 1782 dev_err(&usbvision->dev->dev,
1783 "%s: usb_get_intfdata() failed\n", __func__);
1776 return; 1784 return;
1777 } 1785 }
1778 usb_set_intfdata (intf, NULL); 1786 usb_set_intfdata (intf, NULL);