Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+37 -29
+10 -7
drivers/usb/misc/adutux.c
··· 283 283 284 284 interface = usb_find_interface(&adu_driver, subminor); 285 285 if (!interface) { 286 - err("%s - error, can't find device for minor %d", 287 - __func__, subminor); 286 + printk(KERN_ERR "adutux: %s - error, can't find device for " 287 + "minor %d\n", __func__, subminor); 288 288 retval = -ENODEV; 289 289 goto exit_no_device; 290 290 } ··· 416 416 /* verify that the device wasn't unplugged */ 417 417 if (dev->udev == NULL) { 418 418 retval = -ENODEV; 419 - err("No device or device unplugged %d", retval); 419 + printk(KERN_ERR "adutux: No device or device unplugged %d\n", 420 + retval); 420 421 goto exit; 421 422 } 422 423 ··· 577 576 /* verify that the device wasn't unplugged */ 578 577 if (dev->udev == NULL) { 579 578 retval = -ENODEV; 580 - err("No device or device unplugged %d", retval); 579 + printk(KERN_ERR "adutux: No device or device unplugged %d\n", 580 + retval); 581 581 goto exit; 582 582 } 583 583 ··· 647 645 retval = usb_submit_urb(dev->interrupt_out_urb, GFP_KERNEL); 648 646 if (retval < 0) { 649 647 dev->out_urb_finished = 1; 650 - err("Couldn't submit interrupt_out_urb %d", retval); 648 + dev_err(&dev->udev->dev, "Couldn't submit " 649 + "interrupt_out_urb %d\n", retval); 651 650 goto exit; 652 651 } 653 652 ··· 893 890 /* register this driver with the USB subsystem */ 894 891 result = usb_register(&adu_driver); 895 892 if (result < 0) { 896 - err("usb_register failed for the "__FILE__" driver. " 897 - "Error number %d", result); 893 + printk(KERN_ERR "usb_register failed for the "__FILE__ 894 + " driver. Error number %d\n", result); 898 895 goto exit; 899 896 } 900 897
+13 -11
drivers/usb/misc/appledisplay.c
··· 130 130 exit: 131 131 retval = usb_submit_urb(pdata->urb, GFP_ATOMIC); 132 132 if (retval) { 133 - err("%s - usb_submit_urb failed with result %d", 133 + dev_err(&pdata->udev->dev, 134 + "%s - usb_submit_urb failed with result %d\n", 134 135 __func__, retval); 135 136 } 136 137 } ··· 221 220 } 222 221 } 223 222 if (!int_in_endpointAddr) { 224 - err("Could not find int-in endpoint"); 223 + dev_err(&iface->dev, "Could not find int-in endpoint\n"); 225 224 return -EIO; 226 225 } 227 226 ··· 229 228 pdata = kzalloc(sizeof(struct appledisplay), GFP_KERNEL); 230 229 if (!pdata) { 231 230 retval = -ENOMEM; 232 - err("Out of memory"); 231 + dev_err(&iface->dev, "Out of memory\n"); 233 232 goto error; 234 233 } 235 234 ··· 242 241 pdata->msgdata = kmalloc(ACD_MSG_BUFFER_LEN, GFP_KERNEL); 243 242 if (!pdata->msgdata) { 244 243 retval = -ENOMEM; 245 - err("appledisplay: Allocating buffer for control messages " 246 - "failed"); 244 + dev_err(&iface->dev, 245 + "Allocating buffer for control messages failed\n"); 247 246 goto error; 248 247 } 249 248 ··· 251 250 pdata->urb = usb_alloc_urb(0, GFP_KERNEL); 252 251 if (!pdata->urb) { 253 252 retval = -ENOMEM; 254 - err("appledisplay: Allocating URB failed"); 253 + dev_err(&iface->dev, "Allocating URB failed\n"); 255 254 goto error; 256 255 } 257 256 ··· 260 259 GFP_KERNEL, &pdata->urb->transfer_dma); 261 260 if (!pdata->urbdata) { 262 261 retval = -ENOMEM; 263 - err("appledisplay: Allocating URB buffer failed"); 262 + dev_err(&iface->dev, "Allocating URB buffer failed\n"); 264 263 goto error; 265 264 } 266 265 ··· 271 270 pdata, 1); 272 271 if (usb_submit_urb(pdata->urb, GFP_KERNEL)) { 273 272 retval = -EIO; 274 - err("appledisplay: Submitting URB failed"); 273 + dev_err(&iface->dev, "Submitting URB failed\n"); 275 274 goto error; 276 275 } 277 276 ··· 281 280 pdata->bd = backlight_device_register(bl_name, NULL, pdata, 282 281 &appledisplay_bl_data); 283 282 if (IS_ERR(pdata->bd)) { 284 - err("appledisplay: Backlight registration failed"); 283 + dev_err(&iface->dev, "Backlight registration failed\n"); 285 284 goto error; 286 285 } 287 286 ··· 292 291 293 292 if (brightness < 0) { 294 293 retval = brightness; 295 - err("appledisplay: Error while getting initial brightness: %d", retval); 294 + dev_err(&iface->dev, 295 + "Error while getting initial brightness: %d\n", retval); 296 296 goto error; 297 297 } 298 298 ··· 354 352 { 355 353 wq = create_singlethread_workqueue("appledisplay"); 356 354 if (!wq) { 357 - err("Could not create work queue\n"); 355 + printk(KERN_ERR "appledisplay: Could not create work queue\n"); 358 356 return -ENOMEM; 359 357 } 360 358
+3 -3
drivers/usb/misc/cypress_cy7c63.c
··· 278 278 279 279 /* register this driver with the USB subsystem */ 280 280 result = usb_register(&cypress_driver); 281 - if (result) { 282 - err("Function usb_register failed! Error number: %d\n", result); 283 - } 281 + if (result) 282 + printk(KERN_ERR KBUILD_MODNAME ": usb_register failed! " 283 + "Error number: %d\n", result); 284 284 285 285 return result; 286 286 }
+3 -3
drivers/usb/misc/cytherm.c
··· 422 422 int result; 423 423 424 424 result = usb_register(&cytherm_driver); 425 - if (result) 426 - { 427 - err("usb_register failed. Error number %d", result); 425 + if (result) { 426 + printk(KERN_ERR KBUILD_MODNAME ": usb_register failed! " 427 + "Error number: %d\n", result); 428 428 return result; 429 429 } 430 430
+8 -5
drivers/usb/misc/emi26.c
··· 50 50 unsigned char *buffer = kmemdup(data, length, GFP_KERNEL); 51 51 52 52 if (!buffer) { 53 - err("emi26: kmalloc(%d) failed.", length); 53 + dev_err(&dev->dev, "kmalloc(%d) failed.\n", length); 54 54 return -ENOMEM; 55 55 } 56 56 /* Note: usb_control_msg returns negative value on error or length of the ··· 68 68 /* printk(KERN_DEBUG "%s - %d", __func__, reset_bit); */ 69 69 response = emi26_writememory (dev, CPUCS_REG, &reset_bit, 1, 0xa0); 70 70 if (response < 0) { 71 - err("emi26: set_reset (%d) failed", reset_bit); 71 + dev_err(&dev->dev, "set_reset (%d) failed\n", reset_bit); 72 72 } 73 73 return response; 74 74 } ··· 88 88 89 89 buf = kmalloc(FW_LOAD_SIZE, GFP_KERNEL); 90 90 if (!buf) { 91 - err( "%s - error loading firmware: error = %d", __func__, -ENOMEM); 91 + dev_err(&dev->dev, "%s - error loading firmware: error = %d\n", 92 + __func__, -ENOMEM); 92 93 err = -ENOMEM; 93 94 goto wraperr; 94 95 } ··· 107 106 &dev->dev); 108 107 if (err) { 109 108 nofw: 110 - err( "%s - request_firmware() failed", __func__); 109 + dev_err(&dev->dev, "%s - request_firmware() failed\n", 110 + __func__); 111 111 goto wraperr; 112 112 } 113 113 114 114 /* Assert reset (stop the CPU in the EMI) */ 115 115 err = emi26_set_reset(dev,1); 116 116 if (err < 0) { 117 - err( "%s - error loading firmware: error = %d", __func__, err); 117 + dev_err(&dev->dev,"%s - error loading firmware: error = %d\n", 118 + __func__, err); 118 119 goto wraperr; 119 120 } 120 121