USB: remove err() macro from more usb drivers

USB should not be having it's own printk macros, so remove err() and
use the system-wide standard of dev_err() wherever possible.  In the
few places that will not work out, use a basic printk().

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2008-08-14 09:37:34 -07:00
parent fd3f1917e3
commit 802f389a2c
4 changed files with 63 additions and 45 deletions

View File

@ -218,7 +218,7 @@ static int __devinit isp1761_pci_probe(struct pci_dev *dev,
* and reading back and checking the contents are same or not * and reading back and checking the contents are same or not
*/ */
if (reg_data != 0xFACE) { if (reg_data != 0xFACE) {
err("scratch register mismatch %x", reg_data); dev_err(&dev->dev, "scratch register mismatch %x\n", reg_data);
goto clean; goto clean;
} }

View File

@ -118,7 +118,7 @@ static int r8a66597_clock_enable(struct r8a66597 *r8a66597)
r8a66597_write(r8a66597, SCKE, SYSCFG0); r8a66597_write(r8a66597, SCKE, SYSCFG0);
tmp = r8a66597_read(r8a66597, SYSCFG0); tmp = r8a66597_read(r8a66597, SYSCFG0);
if (i++ > 1000) { if (i++ > 1000) {
err("register access fail."); printk(KERN_ERR "r8a66597: register access fail.\n");
return -ENXIO; return -ENXIO;
} }
} while ((tmp & SCKE) != SCKE); } while ((tmp & SCKE) != SCKE);
@ -128,7 +128,7 @@ static int r8a66597_clock_enable(struct r8a66597 *r8a66597)
r8a66597_write(r8a66597, USBE, SYSCFG0); r8a66597_write(r8a66597, USBE, SYSCFG0);
tmp = r8a66597_read(r8a66597, SYSCFG0); tmp = r8a66597_read(r8a66597, SYSCFG0);
if (i++ > 1000) { if (i++ > 1000) {
err("register access fail."); printk(KERN_ERR "r8a66597: register access fail.\n");
return -ENXIO; return -ENXIO;
} }
} while ((tmp & USBE) != USBE); } while ((tmp & USBE) != USBE);
@ -141,7 +141,7 @@ static int r8a66597_clock_enable(struct r8a66597 *r8a66597)
msleep(1); msleep(1);
tmp = r8a66597_read(r8a66597, SYSCFG0); tmp = r8a66597_read(r8a66597, SYSCFG0);
if (i++ > 500) { if (i++ > 500) {
err("register access fail."); printk(KERN_ERR "r8a66597: register access fail.\n");
return -ENXIO; return -ENXIO;
} }
} while ((tmp & SCKE) != SCKE); } while ((tmp & SCKE) != SCKE);
@ -265,7 +265,7 @@ static void get_port_number(char *devpath, u16 *root_port, u16 *hub_port)
if (root_port) { if (root_port) {
*root_port = (devpath[0] & 0x0F) - 1; *root_port = (devpath[0] & 0x0F) - 1;
if (*root_port >= R8A66597_MAX_ROOT_HUB) if (*root_port >= R8A66597_MAX_ROOT_HUB)
err("illegal root port number"); printk(KERN_ERR "r8a66597: Illegal root port number.\n");
} }
if (hub_port) if (hub_port)
*hub_port = devpath[2] & 0x0F; *hub_port = devpath[2] & 0x0F;
@ -286,7 +286,7 @@ static u16 get_r8a66597_usb_speed(enum usb_device_speed speed)
usbspd = HSMODE; usbspd = HSMODE;
break; break;
default: default:
err("unknown speed"); printk(KERN_ERR "r8a66597: unknown speed\n");
break; break;
} }
@ -385,7 +385,7 @@ static u8 alloc_usb_address(struct r8a66597 *r8a66597, struct urb *urb)
struct r8a66597_device *dev; struct r8a66597_device *dev;
if (is_hub_limit(urb->dev->devpath)) { if (is_hub_limit(urb->dev->devpath)) {
err("Externel hub limit reached."); dev_err(&urb->dev->dev, "External hub limit reached.\n");
return 0; return 0;
} }
@ -406,8 +406,9 @@ static u8 alloc_usb_address(struct r8a66597 *r8a66597, struct urb *urb)
return addr; return addr;
} }
err("cannot communicate with a USB device more than 10.(%x)", dev_err(&urb->dev->dev,
r8a66597->address_map); "cannot communicate with a USB device more than 10.(%x)\n",
r8a66597->address_map);
return 0; return 0;
} }
@ -447,7 +448,8 @@ static void r8a66597_reg_wait(struct r8a66597 *r8a66597, unsigned long reg,
do { do {
tmp = r8a66597_read(r8a66597, reg); tmp = r8a66597_read(r8a66597, reg);
if (i++ > 1000000) { if (i++ > 1000000) {
err("register%lx, loop %x is timeout", reg, loop); printk(KERN_ERR "r8a66597: register%lx, loop %x "
"is timeout\n", reg, loop);
break; break;
} }
ndelay(1); ndelay(1);
@ -675,7 +677,7 @@ static u16 get_empty_pipenum(struct r8a66597 *r8a66597,
array[i++] = 1; array[i++] = 1;
break; break;
default: default:
err("Illegal type"); printk(KERN_ERR "r8a66597: Illegal type\n");
return 0; return 0;
} }
@ -705,7 +707,7 @@ static u16 get_r8a66597_type(__u8 type)
r8a66597_type = R8A66597_ISO; r8a66597_type = R8A66597_ISO;
break; break;
default: default:
err("Illegal type"); printk(KERN_ERR "r8a66597: Illegal type\n");
r8a66597_type = 0x0000; r8a66597_type = 0x0000;
break; break;
} }
@ -724,7 +726,7 @@ static u16 get_bufnum(u16 pipenum)
else if (check_interrupt(pipenum)) else if (check_interrupt(pipenum))
bufnum = 4 + (pipenum - 6); bufnum = 4 + (pipenum - 6);
else else
err("Illegal pipenum (%d)", pipenum); printk(KERN_ERR "r8a66597: Illegal pipenum (%d)\n", pipenum);
return bufnum; return bufnum;
} }
@ -740,7 +742,7 @@ static u16 get_buf_bsize(u16 pipenum)
else if (check_interrupt(pipenum)) else if (check_interrupt(pipenum))
buf_bsize = 0; buf_bsize = 0;
else else
err("Illegal pipenum (%d)", pipenum); printk(KERN_ERR "r8a66597: Illegal pipenum (%d)\n", pipenum);
return buf_bsize; return buf_bsize;
} }
@ -1189,7 +1191,7 @@ static int start_transfer(struct r8a66597 *r8a66597, struct r8a66597_td *td)
prepare_status_packet(r8a66597, td); prepare_status_packet(r8a66597, td);
break; break;
default: default:
err("invalid type."); printk(KERN_ERR "r8a66597: invalid type.\n");
break; break;
} }
@ -1297,7 +1299,7 @@ static void packet_read(struct r8a66597 *r8a66597, u16 pipenum)
if (unlikely((tmp & FRDY) == 0)) { if (unlikely((tmp & FRDY) == 0)) {
pipe_stop(r8a66597, td->pipe); pipe_stop(r8a66597, td->pipe);
pipe_irq_disable(r8a66597, pipenum); pipe_irq_disable(r8a66597, pipenum);
err("in fifo not ready (%d)", pipenum); printk(KERN_ERR "r8a66597: in fifo not ready (%d)\n", pipenum);
finish_request(r8a66597, td, pipenum, td->urb, -EPIPE); finish_request(r8a66597, td, pipenum, td->urb, -EPIPE);
return; return;
} }
@ -1372,7 +1374,7 @@ static void packet_write(struct r8a66597 *r8a66597, u16 pipenum)
if (unlikely((tmp & FRDY) == 0)) { if (unlikely((tmp & FRDY) == 0)) {
pipe_stop(r8a66597, td->pipe); pipe_stop(r8a66597, td->pipe);
pipe_irq_disable(r8a66597, pipenum); pipe_irq_disable(r8a66597, pipenum);
err("out write fifo not ready. (%d)", pipenum); printk(KERN_ERR "r8a66597: out fifo not ready (%d)\n", pipenum);
finish_request(r8a66597, td, pipenum, urb, -EPIPE); finish_request(r8a66597, td, pipenum, urb, -EPIPE);
return; return;
} }
@ -2007,7 +2009,7 @@ static struct r8a66597_device *get_r8a66597_device(struct r8a66597 *r8a66597,
return dev; return dev;
} }
err("get_r8a66597_device fail.(%d)\n", addr); printk(KERN_ERR "r8a66597: get_r8a66597_device fail.(%d)\n", addr);
return NULL; return NULL;
} }
@ -2276,7 +2278,7 @@ static int __init r8a66597_probe(struct platform_device *pdev)
if (pdev->dev.dma_mask) { if (pdev->dev.dma_mask) {
ret = -EINVAL; ret = -EINVAL;
err("dma not support"); dev_err(&pdev->dev, "dma not supported\n");
goto clean_up; goto clean_up;
} }
@ -2284,14 +2286,15 @@ static int __init r8a66597_probe(struct platform_device *pdev)
(char *)hcd_name); (char *)hcd_name);
if (!res) { if (!res) {
ret = -ENODEV; ret = -ENODEV;
err("platform_get_resource_byname error."); dev_err(&pdev->dev, "platform_get_resource_byname error.\n");
goto clean_up; goto clean_up;
} }
ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0); ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!ires) { if (!ires) {
ret = -ENODEV; ret = -ENODEV;
err("platform_get_resource IORESOURCE_IRQ error."); dev_err(&pdev->dev,
"platform_get_resource IORESOURCE_IRQ error.\n");
goto clean_up; goto clean_up;
} }
@ -2301,7 +2304,7 @@ static int __init r8a66597_probe(struct platform_device *pdev)
reg = ioremap(res->start, resource_len(res)); reg = ioremap(res->start, resource_len(res));
if (reg == NULL) { if (reg == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
err("ioremap error."); dev_err(&pdev->dev, "ioremap error.\n");
goto clean_up; goto clean_up;
} }
@ -2309,7 +2312,7 @@ static int __init r8a66597_probe(struct platform_device *pdev)
hcd = usb_create_hcd(&r8a66597_hc_driver, &pdev->dev, (char *)hcd_name); hcd = usb_create_hcd(&r8a66597_hc_driver, &pdev->dev, (char *)hcd_name);
if (!hcd) { if (!hcd) {
ret = -ENOMEM; ret = -ENOMEM;
err("Failed to create hcd"); dev_err(&pdev->dev, "Failed to create hcd\n");
goto clean_up; goto clean_up;
} }
r8a66597 = hcd_to_r8a66597(hcd); r8a66597 = hcd_to_r8a66597(hcd);
@ -2355,12 +2358,12 @@ static int __init r8a66597_probe(struct platform_device *pdev)
} }
break; break;
default: default:
err("Unknown irq_sense value."); dev_err(&pdev->dev, "Unknown irq_sense value.\n");
} }
ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | irq_trigger); ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | irq_trigger);
if (ret != 0) { if (ret != 0) {
err("Failed to add hcd"); dev_err(&pdev->dev, "Failed to add hcd\n");
goto clean_up; goto clean_up;
} }

View File

@ -355,7 +355,7 @@ static int mdc800_usb_waitForIRQ (int mode, int msec)
if (mdc800->camera_request_ready>0) if (mdc800->camera_request_ready>0)
{ {
mdc800->camera_request_ready=0; mdc800->camera_request_ready=0;
err ("timeout waiting for camera."); dev_err(&mdc800->dev->dev, "timeout waiting for camera.\n");
return -1; return -1;
} }
@ -380,7 +380,8 @@ static void mdc800_usb_write_notify (struct urb *urb)
int status = urb->status; int status = urb->status;
if (status != 0) if (status != 0)
err ("writing command fails (status=%i)", status); dev_err(&mdc800->dev->dev,
"writing command fails (status=%i)\n", status);
else else
mdc800->state=READY; mdc800->state=READY;
mdc800->written = 1; mdc800->written = 1;
@ -407,7 +408,8 @@ static void mdc800_usb_download_notify (struct urb *urb)
mdc800->state=READY; mdc800->state=READY;
} }
} else { } else {
err ("request bytes fails (status:%i)", status); dev_err(&mdc800->dev->dev,
"request bytes fails (status:%i)\n", status);
} }
mdc800->downloaded = 1; mdc800->downloaded = 1;
wake_up (&mdc800->download_wait); wake_up (&mdc800->download_wait);
@ -450,7 +452,8 @@ static int mdc800_usb_probe (struct usb_interface *intf,
if (dev->descriptor.bNumConfigurations != 1) if (dev->descriptor.bNumConfigurations != 1)
{ {
err ("probe fails -> wrong Number of Configuration"); dev_err(&intf->dev,
"probe fails -> wrong Number of Configuration\n");
return -ENODEV; return -ENODEV;
} }
intf_desc = intf->cur_altsetting; intf_desc = intf->cur_altsetting;
@ -462,7 +465,7 @@ static int mdc800_usb_probe (struct usb_interface *intf,
|| ( intf_desc->desc.bNumEndpoints != 4) || ( intf_desc->desc.bNumEndpoints != 4)
) )
{ {
err ("probe fails -> wrong Interface"); dev_err(&intf->dev, "probe fails -> wrong Interface\n");
return -ENODEV; return -ENODEV;
} }
@ -483,7 +486,7 @@ static int mdc800_usb_probe (struct usb_interface *intf,
} }
if (mdc800->endpoint[i] == -1) if (mdc800->endpoint[i] == -1)
{ {
err ("probe fails -> Wrong Endpoints."); dev_err(&intf->dev, "probe fails -> Wrong Endpoints.\n");
return -ENODEV; return -ENODEV;
} }
} }
@ -495,7 +498,7 @@ static int mdc800_usb_probe (struct usb_interface *intf,
retval = usb_register_dev(intf, &mdc800_class); retval = usb_register_dev(intf, &mdc800_class);
if (retval) { if (retval) {
err ("Not able to get a minor for this device."); dev_err(&intf->dev, "Not able to get a minor for this device.\n");
return -ENODEV; return -ENODEV;
} }
@ -645,7 +648,8 @@ static int mdc800_device_open (struct inode* inode, struct file *file)
mdc800->irq_urb->dev = mdc800->dev; mdc800->irq_urb->dev = mdc800->dev;
retval = usb_submit_urb (mdc800->irq_urb, GFP_KERNEL); retval = usb_submit_urb (mdc800->irq_urb, GFP_KERNEL);
if (retval) { if (retval) {
err ("request USB irq fails (submit_retval=%i).", retval); dev_err(&mdc800->dev->dev,
"request USB irq fails (submit_retval=%i).\n", retval);
errn = -EIO; errn = -EIO;
goto error_out; goto error_out;
} }
@ -735,7 +739,9 @@ static ssize_t mdc800_device_read (struct file *file, char __user *buf, size_t l
mdc800->download_urb->dev = mdc800->dev; mdc800->download_urb->dev = mdc800->dev;
retval = usb_submit_urb (mdc800->download_urb, GFP_KERNEL); retval = usb_submit_urb (mdc800->download_urb, GFP_KERNEL);
if (retval) { if (retval) {
err ("Can't submit download urb (retval=%i)",retval); dev_err(&mdc800->dev->dev,
"Can't submit download urb "
"(retval=%i)\n", retval);
mutex_unlock(&mdc800->io_lock); mutex_unlock(&mdc800->io_lock);
return len-left; return len-left;
} }
@ -744,7 +750,10 @@ static ssize_t mdc800_device_read (struct file *file, char __user *buf, size_t l
mdc800->downloaded = 0; mdc800->downloaded = 0;
if (mdc800->download_urb->status != 0) if (mdc800->download_urb->status != 0)
{ {
err ("request download-bytes fails (status=%i)",mdc800->download_urb->status); dev_err(&mdc800->dev->dev,
"request download-bytes fails "
"(status=%i)\n",
mdc800->download_urb->status);
mutex_unlock(&mdc800->io_lock); mutex_unlock(&mdc800->io_lock);
return len-left; return len-left;
} }
@ -841,7 +850,8 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s
if (mdc800_usb_waitForIRQ (0,TO_GET_READY)) if (mdc800_usb_waitForIRQ (0,TO_GET_READY))
{ {
err ("Camera didn't get ready.\n"); dev_err(&mdc800->dev->dev,
"Camera didn't get ready.\n");
mutex_unlock(&mdc800->io_lock); mutex_unlock(&mdc800->io_lock);
return -EIO; return -EIO;
} }
@ -853,7 +863,9 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s
mdc800->write_urb->dev = mdc800->dev; mdc800->write_urb->dev = mdc800->dev;
retval = usb_submit_urb (mdc800->write_urb, GFP_KERNEL); retval = usb_submit_urb (mdc800->write_urb, GFP_KERNEL);
if (retval) { if (retval) {
err ("submitting write urb fails (retval=%i)", retval); dev_err(&mdc800->dev->dev,
"submitting write urb fails "
"(retval=%i)\n", retval);
mutex_unlock(&mdc800->io_lock); mutex_unlock(&mdc800->io_lock);
return -EIO; return -EIO;
} }
@ -872,7 +884,9 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s
case 0x3e: /* Take shot in Fine Mode (WCam Mode) */ case 0x3e: /* Take shot in Fine Mode (WCam Mode) */
if (mdc800->pic_len < 0) if (mdc800->pic_len < 0)
{ {
err ("call 0x07 before 0x05,0x3e"); dev_err(&mdc800->dev->dev,
"call 0x07 before "
"0x05,0x3e\n");
mdc800->state=READY; mdc800->state=READY;
mutex_unlock(&mdc800->io_lock); mutex_unlock(&mdc800->io_lock);
return -EIO; return -EIO;
@ -892,7 +906,7 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s
if (mdc800_usb_waitForIRQ (1,TO_READ_FROM_IRQ)) if (mdc800_usb_waitForIRQ (1,TO_READ_FROM_IRQ))
{ {
err ("requesting answer from irq fails"); dev_err(&mdc800->dev->dev, "requesting answer from irq fails\n");
mutex_unlock(&mdc800->io_lock); mutex_unlock(&mdc800->io_lock);
return -EIO; return -EIO;
} }
@ -920,7 +934,7 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s
{ {
if (mdc800_usb_waitForIRQ (0,TO_DEFAULT_COMMAND)) if (mdc800_usb_waitForIRQ (0,TO_DEFAULT_COMMAND))
{ {
err ("Command Timeout."); dev_err(&mdc800->dev->dev, "Command Timeout.\n");
mutex_unlock(&mdc800->io_lock); mutex_unlock(&mdc800->io_lock);
return -EIO; return -EIO;
} }
@ -1031,7 +1045,7 @@ cleanup_on_fail:
if (mdc800 != NULL) if (mdc800 != NULL)
{ {
err ("can't alloc memory!"); printk(KERN_ERR "mdc800: can't alloc memory!\n");
kfree(mdc800->download_urb_buffer); kfree(mdc800->download_urb_buffer);
kfree(mdc800->write_urb_buffer); kfree(mdc800->write_urb_buffer);

View File

@ -78,8 +78,8 @@ static void usb_onetouch_irq(struct urb *urb)
resubmit: resubmit:
retval = usb_submit_urb (urb, GFP_ATOMIC); retval = usb_submit_urb (urb, GFP_ATOMIC);
if (retval) if (retval)
err ("can't resubmit intr, %s-%s/input0, retval %d", dev_err(&dev->dev, "can't resubmit intr, %s-%s/input0, "
onetouch->udev->bus->bus_name, "retval %d\n", onetouch->udev->bus->bus_name,
onetouch->udev->devpath, retval); onetouch->udev->devpath, retval);
} }
@ -90,7 +90,7 @@ static int usb_onetouch_open(struct input_dev *dev)
onetouch->is_open = 1; onetouch->is_open = 1;
onetouch->irq->dev = onetouch->udev; onetouch->irq->dev = onetouch->udev;
if (usb_submit_urb(onetouch->irq, GFP_KERNEL)) { if (usb_submit_urb(onetouch->irq, GFP_KERNEL)) {
err("usb_submit_urb failed"); dev_err(&dev->dev, "usb_submit_urb failed\n");
return -EIO; return -EIO;
} }
@ -117,7 +117,8 @@ static void usb_onetouch_pm_hook(struct us_data *us, int action)
break; break;
case US_RESUME: case US_RESUME:
if (usb_submit_urb(onetouch->irq, GFP_KERNEL) != 0) if (usb_submit_urb(onetouch->irq, GFP_KERNEL) != 0)
err("usb_submit_urb failed"); dev_err(&onetouch->irq->dev->dev,
"usb_submit_urb failed\n");
break; break;
default: default:
break; break;