USB: remove err() macro from usb misc 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:
parent
69a85942ff
commit
fd3f1917e3
|
@ -283,8 +283,8 @@ static int adu_open(struct inode *inode, struct file *file)
|
|||
|
||||
interface = usb_find_interface(&adu_driver, subminor);
|
||||
if (!interface) {
|
||||
err("%s - error, can't find device for minor %d",
|
||||
__func__, subminor);
|
||||
printk(KERN_ERR "adutux: %s - error, can't find device for "
|
||||
"minor %d\n", __func__, subminor);
|
||||
retval = -ENODEV;
|
||||
goto exit_no_device;
|
||||
}
|
||||
|
@ -416,7 +416,8 @@ static ssize_t adu_read(struct file *file, __user char *buffer, size_t count,
|
|||
/* verify that the device wasn't unplugged */
|
||||
if (dev->udev == NULL) {
|
||||
retval = -ENODEV;
|
||||
err("No device or device unplugged %d", retval);
|
||||
printk(KERN_ERR "adutux: No device or device unplugged %d\n",
|
||||
retval);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
@ -576,7 +577,8 @@ static ssize_t adu_write(struct file *file, const __user char *buffer,
|
|||
/* verify that the device wasn't unplugged */
|
||||
if (dev->udev == NULL) {
|
||||
retval = -ENODEV;
|
||||
err("No device or device unplugged %d", retval);
|
||||
printk(KERN_ERR "adutux: No device or device unplugged %d\n",
|
||||
retval);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
@ -645,7 +647,8 @@ static ssize_t adu_write(struct file *file, const __user char *buffer,
|
|||
retval = usb_submit_urb(dev->interrupt_out_urb, GFP_KERNEL);
|
||||
if (retval < 0) {
|
||||
dev->out_urb_finished = 1;
|
||||
err("Couldn't submit interrupt_out_urb %d", retval);
|
||||
dev_err(&dev->udev->dev, "Couldn't submit "
|
||||
"interrupt_out_urb %d\n", retval);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
@ -890,8 +893,8 @@ static int __init adu_init(void)
|
|||
/* register this driver with the USB subsystem */
|
||||
result = usb_register(&adu_driver);
|
||||
if (result < 0) {
|
||||
err("usb_register failed for the "__FILE__" driver. "
|
||||
"Error number %d", result);
|
||||
printk(KERN_ERR "usb_register failed for the "__FILE__
|
||||
" driver. Error number %d\n", result);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -130,7 +130,8 @@ static void appledisplay_complete(struct urb *urb)
|
|||
exit:
|
||||
retval = usb_submit_urb(pdata->urb, GFP_ATOMIC);
|
||||
if (retval) {
|
||||
err("%s - usb_submit_urb failed with result %d",
|
||||
dev_err(&pdata->udev->dev,
|
||||
"%s - usb_submit_urb failed with result %d\n",
|
||||
__func__, retval);
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +221,7 @@ static int appledisplay_probe(struct usb_interface *iface,
|
|||
}
|
||||
}
|
||||
if (!int_in_endpointAddr) {
|
||||
err("Could not find int-in endpoint");
|
||||
dev_err(&iface->dev, "Could not find int-in endpoint\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
@ -228,7 +229,7 @@ static int appledisplay_probe(struct usb_interface *iface,
|
|||
pdata = kzalloc(sizeof(struct appledisplay), GFP_KERNEL);
|
||||
if (!pdata) {
|
||||
retval = -ENOMEM;
|
||||
err("Out of memory");
|
||||
dev_err(&iface->dev, "Out of memory\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -241,8 +242,8 @@ static int appledisplay_probe(struct usb_interface *iface,
|
|||
pdata->msgdata = kmalloc(ACD_MSG_BUFFER_LEN, GFP_KERNEL);
|
||||
if (!pdata->msgdata) {
|
||||
retval = -ENOMEM;
|
||||
err("appledisplay: Allocating buffer for control messages "
|
||||
"failed");
|
||||
dev_err(&iface->dev,
|
||||
"Allocating buffer for control messages failed\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -250,7 +251,7 @@ static int appledisplay_probe(struct usb_interface *iface,
|
|||
pdata->urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if (!pdata->urb) {
|
||||
retval = -ENOMEM;
|
||||
err("appledisplay: Allocating URB failed");
|
||||
dev_err(&iface->dev, "Allocating URB failed\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -259,7 +260,7 @@ static int appledisplay_probe(struct usb_interface *iface,
|
|||
GFP_KERNEL, &pdata->urb->transfer_dma);
|
||||
if (!pdata->urbdata) {
|
||||
retval = -ENOMEM;
|
||||
err("appledisplay: Allocating URB buffer failed");
|
||||
dev_err(&iface->dev, "Allocating URB buffer failed\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -270,7 +271,7 @@ static int appledisplay_probe(struct usb_interface *iface,
|
|||
pdata, 1);
|
||||
if (usb_submit_urb(pdata->urb, GFP_KERNEL)) {
|
||||
retval = -EIO;
|
||||
err("appledisplay: Submitting URB failed");
|
||||
dev_err(&iface->dev, "Submitting URB failed\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -280,7 +281,7 @@ static int appledisplay_probe(struct usb_interface *iface,
|
|||
pdata->bd = backlight_device_register(bl_name, NULL, pdata,
|
||||
&appledisplay_bl_data);
|
||||
if (IS_ERR(pdata->bd)) {
|
||||
err("appledisplay: Backlight registration failed");
|
||||
dev_err(&iface->dev, "Backlight registration failed\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -291,7 +292,8 @@ static int appledisplay_probe(struct usb_interface *iface,
|
|||
|
||||
if (brightness < 0) {
|
||||
retval = brightness;
|
||||
err("appledisplay: Error while getting initial brightness: %d", retval);
|
||||
dev_err(&iface->dev,
|
||||
"Error while getting initial brightness: %d\n", retval);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -352,7 +354,7 @@ static int __init appledisplay_init(void)
|
|||
{
|
||||
wq = create_singlethread_workqueue("appledisplay");
|
||||
if (!wq) {
|
||||
err("Could not create work queue\n");
|
||||
printk(KERN_ERR "appledisplay: Could not create work queue\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
|
|
@ -278,9 +278,9 @@ static int __init cypress_init(void)
|
|||
|
||||
/* register this driver with the USB subsystem */
|
||||
result = usb_register(&cypress_driver);
|
||||
if (result) {
|
||||
err("Function usb_register failed! Error number: %d\n", result);
|
||||
}
|
||||
if (result)
|
||||
printk(KERN_ERR KBUILD_MODNAME ": usb_register failed! "
|
||||
"Error number: %d\n", result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -422,9 +422,9 @@ static int __init usb_cytherm_init(void)
|
|||
int result;
|
||||
|
||||
result = usb_register(&cytherm_driver);
|
||||
if (result)
|
||||
{
|
||||
err("usb_register failed. Error number %d", result);
|
||||
if (result) {
|
||||
printk(KERN_ERR KBUILD_MODNAME ": usb_register failed! "
|
||||
"Error number: %d\n", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ static int emi26_writememory (struct usb_device *dev, int address,
|
|||
unsigned char *buffer = kmemdup(data, length, GFP_KERNEL);
|
||||
|
||||
if (!buffer) {
|
||||
err("emi26: kmalloc(%d) failed.", length);
|
||||
dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);
|
||||
return -ENOMEM;
|
||||
}
|
||||
/* Note: usb_control_msg returns negative value on error or length of the
|
||||
|
@ -68,7 +68,7 @@ static int emi26_set_reset (struct usb_device *dev, unsigned char reset_bit)
|
|||
/* printk(KERN_DEBUG "%s - %d", __func__, reset_bit); */
|
||||
response = emi26_writememory (dev, CPUCS_REG, &reset_bit, 1, 0xa0);
|
||||
if (response < 0) {
|
||||
err("emi26: set_reset (%d) failed", reset_bit);
|
||||
dev_err(&dev->dev, "set_reset (%d) failed\n", reset_bit);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
@ -88,7 +88,8 @@ static int emi26_load_firmware (struct usb_device *dev)
|
|||
|
||||
buf = kmalloc(FW_LOAD_SIZE, GFP_KERNEL);
|
||||
if (!buf) {
|
||||
err( "%s - error loading firmware: error = %d", __func__, -ENOMEM);
|
||||
dev_err(&dev->dev, "%s - error loading firmware: error = %d\n",
|
||||
__func__, -ENOMEM);
|
||||
err = -ENOMEM;
|
||||
goto wraperr;
|
||||
}
|
||||
|
@ -106,14 +107,16 @@ static int emi26_load_firmware (struct usb_device *dev)
|
|||
&dev->dev);
|
||||
if (err) {
|
||||
nofw:
|
||||
err( "%s - request_firmware() failed", __func__);
|
||||
dev_err(&dev->dev, "%s - request_firmware() failed\n",
|
||||
__func__);
|
||||
goto wraperr;
|
||||
}
|
||||
|
||||
/* Assert reset (stop the CPU in the EMI) */
|
||||
err = emi26_set_reset(dev,1);
|
||||
if (err < 0) {
|
||||
err( "%s - error loading firmware: error = %d", __func__, err);
|
||||
dev_err(&dev->dev,"%s - error loading firmware: error = %d\n",
|
||||
__func__, err);
|
||||
goto wraperr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue