Commit fd3f1917e345d852ef9ae36178719f4e639f70ae
1 parent
69a85942ff
Exists in
master
and in
7 other branches
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>
Showing 5 changed files with 37 additions and 29 deletions Side-by-side Diff
drivers/usb/misc/adutux.c
... | ... | @@ -283,8 +283,8 @@ |
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,7 +416,8 @@ |
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 | |
... | ... | @@ -576,7 +577,8 @@ |
576 | 577 | /* verify that the device wasn't unplugged */ |
577 | 578 | if (dev->udev == NULL) { |
578 | 579 | retval = -ENODEV; |
579 | - err("No device or device unplugged %d", retval); | |
580 | + printk(KERN_ERR "adutux: No device or device unplugged %d\n", | |
581 | + retval); | |
580 | 582 | goto exit; |
581 | 583 | } |
582 | 584 | |
... | ... | @@ -645,7 +647,8 @@ |
645 | 647 | retval = usb_submit_urb(dev->interrupt_out_urb, GFP_KERNEL); |
646 | 648 | if (retval < 0) { |
647 | 649 | dev->out_urb_finished = 1; |
648 | - err("Couldn't submit interrupt_out_urb %d", retval); | |
650 | + dev_err(&dev->udev->dev, "Couldn't submit " | |
651 | + "interrupt_out_urb %d\n", retval); | |
649 | 652 | goto exit; |
650 | 653 | } |
651 | 654 | |
... | ... | @@ -890,8 +893,8 @@ |
890 | 893 | /* register this driver with the USB subsystem */ |
891 | 894 | result = usb_register(&adu_driver); |
892 | 895 | if (result < 0) { |
893 | - err("usb_register failed for the "__FILE__" driver. " | |
894 | - "Error number %d", result); | |
896 | + printk(KERN_ERR "usb_register failed for the "__FILE__ | |
897 | + " driver. Error number %d\n", result); | |
895 | 898 | goto exit; |
896 | 899 | } |
897 | 900 |
drivers/usb/misc/appledisplay.c
... | ... | @@ -130,7 +130,8 @@ |
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 | } |
... | ... | @@ -220,7 +221,7 @@ |
220 | 221 | } |
221 | 222 | } |
222 | 223 | if (!int_in_endpointAddr) { |
223 | - err("Could not find int-in endpoint"); | |
224 | + dev_err(&iface->dev, "Could not find int-in endpoint\n"); | |
224 | 225 | return -EIO; |
225 | 226 | } |
226 | 227 | |
... | ... | @@ -228,7 +229,7 @@ |
228 | 229 | pdata = kzalloc(sizeof(struct appledisplay), GFP_KERNEL); |
229 | 230 | if (!pdata) { |
230 | 231 | retval = -ENOMEM; |
231 | - err("Out of memory"); | |
232 | + dev_err(&iface->dev, "Out of memory\n"); | |
232 | 233 | goto error; |
233 | 234 | } |
234 | 235 | |
... | ... | @@ -241,8 +242,8 @@ |
241 | 242 | pdata->msgdata = kmalloc(ACD_MSG_BUFFER_LEN, GFP_KERNEL); |
242 | 243 | if (!pdata->msgdata) { |
243 | 244 | retval = -ENOMEM; |
244 | - err("appledisplay: Allocating buffer for control messages " | |
245 | - "failed"); | |
245 | + dev_err(&iface->dev, | |
246 | + "Allocating buffer for control messages failed\n"); | |
246 | 247 | goto error; |
247 | 248 | } |
248 | 249 | |
... | ... | @@ -250,7 +251,7 @@ |
250 | 251 | pdata->urb = usb_alloc_urb(0, GFP_KERNEL); |
251 | 252 | if (!pdata->urb) { |
252 | 253 | retval = -ENOMEM; |
253 | - err("appledisplay: Allocating URB failed"); | |
254 | + dev_err(&iface->dev, "Allocating URB failed\n"); | |
254 | 255 | goto error; |
255 | 256 | } |
256 | 257 | |
... | ... | @@ -259,7 +260,7 @@ |
259 | 260 | GFP_KERNEL, &pdata->urb->transfer_dma); |
260 | 261 | if (!pdata->urbdata) { |
261 | 262 | retval = -ENOMEM; |
262 | - err("appledisplay: Allocating URB buffer failed"); | |
263 | + dev_err(&iface->dev, "Allocating URB buffer failed\n"); | |
263 | 264 | goto error; |
264 | 265 | } |
265 | 266 | |
... | ... | @@ -270,7 +271,7 @@ |
270 | 271 | pdata, 1); |
271 | 272 | if (usb_submit_urb(pdata->urb, GFP_KERNEL)) { |
272 | 273 | retval = -EIO; |
273 | - err("appledisplay: Submitting URB failed"); | |
274 | + dev_err(&iface->dev, "Submitting URB failed\n"); | |
274 | 275 | goto error; |
275 | 276 | } |
276 | 277 | |
... | ... | @@ -280,7 +281,7 @@ |
280 | 281 | pdata->bd = backlight_device_register(bl_name, NULL, pdata, |
281 | 282 | &appledisplay_bl_data); |
282 | 283 | if (IS_ERR(pdata->bd)) { |
283 | - err("appledisplay: Backlight registration failed"); | |
284 | + dev_err(&iface->dev, "Backlight registration failed\n"); | |
284 | 285 | goto error; |
285 | 286 | } |
286 | 287 | |
... | ... | @@ -291,7 +292,8 @@ |
291 | 292 | |
292 | 293 | if (brightness < 0) { |
293 | 294 | retval = brightness; |
294 | - err("appledisplay: Error while getting initial brightness: %d", retval); | |
295 | + dev_err(&iface->dev, | |
296 | + "Error while getting initial brightness: %d\n", retval); | |
295 | 297 | goto error; |
296 | 298 | } |
297 | 299 | |
... | ... | @@ -352,7 +354,7 @@ |
352 | 354 | { |
353 | 355 | wq = create_singlethread_workqueue("appledisplay"); |
354 | 356 | if (!wq) { |
355 | - err("Could not create work queue\n"); | |
357 | + printk(KERN_ERR "appledisplay: Could not create work queue\n"); | |
356 | 358 | return -ENOMEM; |
357 | 359 | } |
358 | 360 |
drivers/usb/misc/cypress_cy7c63.c
... | ... | @@ -278,9 +278,9 @@ |
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 | } |
drivers/usb/misc/cytherm.c
... | ... | @@ -422,9 +422,9 @@ |
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 |
drivers/usb/misc/emi26.c
... | ... | @@ -50,7 +50,7 @@ |
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,7 +68,7 @@ |
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,7 +88,8 @@ |
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 | } |
95 | 96 | |
... | ... | @@ -106,14 +107,16 @@ |
106 | 107 | &dev->dev); |
107 | 108 | if (err) { |
108 | 109 | nofw: |
109 | - err( "%s - request_firmware() failed", __func__); | |
110 | + dev_err(&dev->dev, "%s - request_firmware() failed\n", | |
111 | + __func__); | |
110 | 112 | goto wraperr; |
111 | 113 | } |
112 | 114 | |
113 | 115 | /* Assert reset (stop the CPU in the EMI) */ |
114 | 116 | err = emi26_set_reset(dev,1); |
115 | 117 | if (err < 0) { |
116 | - err( "%s - error loading firmware: error = %d", __func__, err); | |
118 | + dev_err(&dev->dev,"%s - error loading firmware: error = %d\n", | |
119 | + __func__, err); | |
117 | 120 | goto wraperr; |
118 | 121 | } |
119 | 122 |