Skip to content

Commit 69a8594

Browse files
committed
USB: remove err() macro from usb core code
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 <[email protected]>
1 parent 9908a32 commit 69a8594

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

drivers/usb/core/devio.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,19 +1777,20 @@ int __init usb_devio_init(void)
17771777
retval = register_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX,
17781778
"usb_device");
17791779
if (retval) {
1780-
err("unable to register minors for usb_device");
1780+
printk(KERN_ERR "Unable to register minors for usb_device\n");
17811781
goto out;
17821782
}
17831783
cdev_init(&usb_device_cdev, &usbdev_file_operations);
17841784
retval = cdev_add(&usb_device_cdev, USB_DEVICE_DEV, USB_DEVICE_MAX);
17851785
if (retval) {
1786-
err("unable to get usb_device major %d", USB_DEVICE_MAJOR);
1786+
printk(KERN_ERR "Unable to get usb_device major %d\n",
1787+
USB_DEVICE_MAJOR);
17871788
goto error_cdev;
17881789
}
17891790
#ifdef CONFIG_USB_DEVICE_CLASS
17901791
usb_classdev_class = class_create(THIS_MODULE, "usb_device");
17911792
if (IS_ERR(usb_classdev_class)) {
1792-
err("unable to register usb_device class");
1793+
printk(KERN_ERR "Unable to register usb_device class\n");
17931794
retval = PTR_ERR(usb_classdev_class);
17941795
cdev_del(&usb_device_cdev);
17951796
usb_classdev_class = NULL;

drivers/usb/core/endpoint.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ static int usb_endpoint_major_init(void)
169169
error = alloc_chrdev_region(&dev, 0, MAX_ENDPOINT_MINORS,
170170
"usb_endpoint");
171171
if (error) {
172-
err("unable to get a dynamic major for usb endpoints");
172+
printk(KERN_ERR "Unable to get a dynamic major for "
173+
"usb endpoints.\n");
173174
return error;
174175
}
175176
usb_endpoint_major = MAJOR(dev);

drivers/usb/core/file.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static int init_usb_class(void)
8686
usb_class->class = class_create(THIS_MODULE, "usb");
8787
if (IS_ERR(usb_class->class)) {
8888
result = IS_ERR(usb_class->class);
89-
err("class_create failed for usb devices");
89+
printk(KERN_ERR "class_create failed for usb devices\n");
9090
kfree(usb_class);
9191
usb_class = NULL;
9292
}
@@ -115,7 +115,8 @@ int usb_major_init(void)
115115

116116
error = register_chrdev(USB_MAJOR, "usb", &usb_fops);
117117
if (error)
118-
err("unable to get major %d for usb devices", USB_MAJOR);
118+
printk(KERN_ERR "Unable to get major %d for usb devices\n",
119+
USB_MAJOR);
119120

120121
return error;
121122
}

drivers/usb/core/inode.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ static int parse_options(struct super_block *s, char *data)
180180
listmode = option & S_IRWXUGO;
181181
break;
182182
default:
183-
err("usbfs: unrecognised mount option \"%s\" "
184-
"or missing value\n", p);
183+
printk(KERN_ERR "usbfs: unrecognised mount option "
184+
"\"%s\" or missing value\n", p);
185185
return -EINVAL;
186186
}
187187
}
@@ -601,7 +601,7 @@ static int create_special_files (void)
601601
/* create the devices special file */
602602
retval = simple_pin_fs(&usb_fs_type, &usbfs_mount, &usbfs_mount_count);
603603
if (retval) {
604-
err ("Unable to get usbfs mount");
604+
printk(KERN_ERR "Unable to get usbfs mount\n");
605605
goto exit;
606606
}
607607

@@ -613,7 +613,7 @@ static int create_special_files (void)
613613
NULL, &usbfs_devices_fops,
614614
listuid, listgid);
615615
if (devices_usbfs_dentry == NULL) {
616-
err ("Unable to create devices usbfs file");
616+
printk(KERN_ERR "Unable to create devices usbfs file\n");
617617
retval = -ENODEV;
618618
goto error_clean_mounts;
619619
}
@@ -665,7 +665,7 @@ static void usbfs_add_bus(struct usb_bus *bus)
665665
bus->usbfs_dentry = fs_create_file (name, busmode | S_IFDIR, parent,
666666
bus, NULL, busuid, busgid);
667667
if (bus->usbfs_dentry == NULL) {
668-
err ("error creating usbfs bus entry");
668+
printk(KERN_ERR "Error creating usbfs bus entry\n");
669669
return;
670670
}
671671
}
@@ -696,7 +696,7 @@ static void usbfs_add_device(struct usb_device *dev)
696696
&usbdev_file_operations,
697697
devuid, devgid);
698698
if (dev->usbfs_dentry == NULL) {
699-
err ("error creating usbfs device entry");
699+
printk(KERN_ERR "Error creating usbfs device entry\n");
700700
return;
701701
}
702702

drivers/usb/core/urb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct urb *usb_alloc_urb(int iso_packets, gfp_t mem_flags)
7070
iso_packets * sizeof(struct usb_iso_packet_descriptor),
7171
mem_flags);
7272
if (!urb) {
73-
err("alloc_urb: kmalloc failed");
73+
printk(KERN_ERR "alloc_urb: kmalloc failed\n");
7474
return NULL;
7575
}
7676
usb_init_urb(urb);
@@ -407,7 +407,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
407407

408408
/* fail if submitter gave bogus flags */
409409
if (urb->transfer_flags != orig_flags) {
410-
err("BOGUS urb flags, %x --> %x",
410+
dev_err(&dev->dev, "BOGUS urb flags, %x --> %x\n",
411411
orig_flags, urb->transfer_flags);
412412
return -EINVAL;
413413
}

0 commit comments

Comments
 (0)