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

USB: iowarrior: Convert local dbg macro to dev_dbg

Use a more standard logging style.

Add terminating newlines to formats.
Remove __func__ as that can be added via dynamic debug.
Remove now unnecessary debug module parameter.
Remove the dbg macro too.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Joe Perches and committed by
Greg Kroah-Hartman
549e8350 e2b86c1d

+17 -21
+17 -21
drivers/usb/misc/iowarrior.c
··· 51 51 */ 52 52 #define MAX_WRITES_IN_FLIGHT 4 53 53 54 - /* Use our own dbg macro */ 55 - #undef dbg 56 - #define dbg( format, arg... ) do { if( debug ) printk( KERN_DEBUG __FILE__ ": " format "\n" , ## arg ); } while ( 0 ) 57 - 58 54 MODULE_AUTHOR(DRIVER_AUTHOR); 59 55 MODULE_DESCRIPTION(DRIVER_DESC); 60 56 MODULE_LICENSE("GPL"); 61 57 62 58 /* Module parameters */ 63 59 static DEFINE_MUTEX(iowarrior_mutex); 64 - static bool debug = 0; 65 - module_param(debug, bool, 0644); 66 - MODULE_PARM_DESC(debug, "debug=1 enables debugging messages"); 67 60 68 61 static struct usb_driver iowarrior_driver; 69 62 static DEFINE_MUTEX(iowarrior_open_disc_lock); ··· 228 235 if (status && 229 236 !(status == -ENOENT || 230 237 status == -ECONNRESET || status == -ESHUTDOWN)) { 231 - dbg("%s - nonzero write bulk status received: %d", 232 - __func__, status); 238 + dev_dbg(&dev->interface->dev, 239 + "nonzero write bulk status received: %d\n", status); 233 240 } 234 241 /* free up our allocated buffer */ 235 242 usb_free_coherent(urb->dev, urb->transfer_buffer_length, ··· 244 251 */ 245 252 static inline void iowarrior_delete(struct iowarrior *dev) 246 253 { 247 - dbg("%s - minor %d", __func__, dev->minor); 254 + dev_dbg(&dev->interface->dev, "minor %d\n", dev->minor); 248 255 kfree(dev->int_in_buffer); 249 256 usb_free_urb(dev->int_in_urb); 250 257 kfree(dev->read_queue); ··· 281 288 if (dev == NULL || !dev->present) 282 289 return -ENODEV; 283 290 284 - dbg("%s - minor %d, count = %zd", __func__, dev->minor, count); 291 + dev_dbg(&dev->interface->dev, "minor %d, count = %zd\n", 292 + dev->minor, count); 285 293 286 294 /* read count must be packet size (+ time stamp) */ 287 295 if ((count != dev->report_size) ··· 350 356 retval = -ENODEV; 351 357 goto exit; 352 358 } 353 - dbg("%s - minor %d, count = %zd", __func__, dev->minor, count); 359 + dev_dbg(&dev->interface->dev, "minor %d, count = %zd\n", 360 + dev->minor, count); 354 361 /* if count is 0 we're already done */ 355 362 if (count == 0) { 356 363 retval = 0; ··· 413 418 int_out_urb = usb_alloc_urb(0, GFP_KERNEL); 414 419 if (!int_out_urb) { 415 420 retval = -ENOMEM; 416 - dbg("%s Unable to allocate urb ", __func__); 421 + dev_dbg(&dev->interface->dev, 422 + "Unable to allocate urb\n"); 417 423 goto error_no_urb; 418 424 } 419 425 buf = usb_alloc_coherent(dev->udev, dev->report_size, 420 426 GFP_KERNEL, &int_out_urb->transfer_dma); 421 427 if (!buf) { 422 428 retval = -ENOMEM; 423 - dbg("%s Unable to allocate buffer ", __func__); 429 + dev_dbg(&dev->interface->dev, 430 + "Unable to allocate buffer\n"); 424 431 goto error_no_buffer; 425 432 } 426 433 usb_fill_int_urb(int_out_urb, dev->udev, ··· 438 441 } 439 442 retval = usb_submit_urb(int_out_urb, GFP_KERNEL); 440 443 if (retval) { 441 - dbg("%s submit error %d for urb nr.%d", __func__, 442 - retval, atomic_read(&dev->write_busy)); 444 + dev_dbg(&dev->interface->dev, 445 + "submit error %d for urb nr.%d\n", 446 + retval, atomic_read(&dev->write_busy)); 443 447 goto error; 444 448 } 445 449 /* submit was ok */ ··· 500 502 goto error_out; 501 503 } 502 504 503 - dbg("%s - minor %d, cmd 0x%.4x, arg %ld", __func__, dev->minor, cmd, 504 - arg); 505 + dev_dbg(&dev->interface->dev, "minor %d, cmd 0x%.4x, arg %ld\n", 506 + dev->minor, cmd, arg); 505 507 506 508 retval = 0; 507 509 io_res = 0; ··· 599 601 int subminor; 600 602 int retval = 0; 601 603 602 - dbg("%s", __func__); 603 - 604 604 mutex_lock(&iowarrior_mutex); 605 605 subminor = iminor(inode); 606 606 ··· 658 662 return -ENODEV; 659 663 } 660 664 661 - dbg("%s - minor %d", __func__, dev->minor); 665 + dev_dbg(&dev->interface->dev, "minor %d\n", dev->minor); 662 666 663 667 /* lock our device */ 664 668 mutex_lock(&dev->mutex);