Commit 69a85942 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9908a32e
...@@ -1777,19 +1777,20 @@ int __init usb_devio_init(void) ...@@ -1777,19 +1777,20 @@ int __init usb_devio_init(void)
retval = register_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX, retval = register_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX,
"usb_device"); "usb_device");
if (retval) { if (retval) {
err("unable to register minors for usb_device"); printk(KERN_ERR "Unable to register minors for usb_device\n");
goto out; goto out;
} }
cdev_init(&usb_device_cdev, &usbdev_file_operations); cdev_init(&usb_device_cdev, &usbdev_file_operations);
retval = cdev_add(&usb_device_cdev, USB_DEVICE_DEV, USB_DEVICE_MAX); retval = cdev_add(&usb_device_cdev, USB_DEVICE_DEV, USB_DEVICE_MAX);
if (retval) { if (retval) {
err("unable to get usb_device major %d", USB_DEVICE_MAJOR); printk(KERN_ERR "Unable to get usb_device major %d\n",
USB_DEVICE_MAJOR);
goto error_cdev; goto error_cdev;
} }
#ifdef CONFIG_USB_DEVICE_CLASS #ifdef CONFIG_USB_DEVICE_CLASS
usb_classdev_class = class_create(THIS_MODULE, "usb_device"); usb_classdev_class = class_create(THIS_MODULE, "usb_device");
if (IS_ERR(usb_classdev_class)) { if (IS_ERR(usb_classdev_class)) {
err("unable to register usb_device class"); printk(KERN_ERR "Unable to register usb_device class\n");
retval = PTR_ERR(usb_classdev_class); retval = PTR_ERR(usb_classdev_class);
cdev_del(&usb_device_cdev); cdev_del(&usb_device_cdev);
usb_classdev_class = NULL; usb_classdev_class = NULL;
......
...@@ -169,7 +169,8 @@ static int usb_endpoint_major_init(void) ...@@ -169,7 +169,8 @@ static int usb_endpoint_major_init(void)
error = alloc_chrdev_region(&dev, 0, MAX_ENDPOINT_MINORS, error = alloc_chrdev_region(&dev, 0, MAX_ENDPOINT_MINORS,
"usb_endpoint"); "usb_endpoint");
if (error) { if (error) {
err("unable to get a dynamic major for usb endpoints"); printk(KERN_ERR "Unable to get a dynamic major for "
"usb endpoints.\n");
return error; return error;
} }
usb_endpoint_major = MAJOR(dev); usb_endpoint_major = MAJOR(dev);
......
...@@ -86,7 +86,7 @@ static int init_usb_class(void) ...@@ -86,7 +86,7 @@ static int init_usb_class(void)
usb_class->class = class_create(THIS_MODULE, "usb"); usb_class->class = class_create(THIS_MODULE, "usb");
if (IS_ERR(usb_class->class)) { if (IS_ERR(usb_class->class)) {
result = IS_ERR(usb_class->class); result = IS_ERR(usb_class->class);
err("class_create failed for usb devices"); printk(KERN_ERR "class_create failed for usb devices\n");
kfree(usb_class); kfree(usb_class);
usb_class = NULL; usb_class = NULL;
} }
...@@ -115,7 +115,8 @@ int usb_major_init(void) ...@@ -115,7 +115,8 @@ int usb_major_init(void)
error = register_chrdev(USB_MAJOR, "usb", &usb_fops); error = register_chrdev(USB_MAJOR, "usb", &usb_fops);
if (error) if (error)
err("unable to get major %d for usb devices", USB_MAJOR); printk(KERN_ERR "Unable to get major %d for usb devices\n",
USB_MAJOR);
return error; return error;
} }
......
...@@ -180,8 +180,8 @@ static int parse_options(struct super_block *s, char *data) ...@@ -180,8 +180,8 @@ static int parse_options(struct super_block *s, char *data)
listmode = option & S_IRWXUGO; listmode = option & S_IRWXUGO;
break; break;
default: default:
err("usbfs: unrecognised mount option \"%s\" " printk(KERN_ERR "usbfs: unrecognised mount option "
"or missing value\n", p); "\"%s\" or missing value\n", p);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -601,7 +601,7 @@ static int create_special_files (void) ...@@ -601,7 +601,7 @@ static int create_special_files (void)
/* create the devices special file */ /* create the devices special file */
retval = simple_pin_fs(&usb_fs_type, &usbfs_mount, &usbfs_mount_count); retval = simple_pin_fs(&usb_fs_type, &usbfs_mount, &usbfs_mount_count);
if (retval) { if (retval) {
err ("Unable to get usbfs mount"); printk(KERN_ERR "Unable to get usbfs mount\n");
goto exit; goto exit;
} }
...@@ -613,7 +613,7 @@ static int create_special_files (void) ...@@ -613,7 +613,7 @@ static int create_special_files (void)
NULL, &usbfs_devices_fops, NULL, &usbfs_devices_fops,
listuid, listgid); listuid, listgid);
if (devices_usbfs_dentry == NULL) { if (devices_usbfs_dentry == NULL) {
err ("Unable to create devices usbfs file"); printk(KERN_ERR "Unable to create devices usbfs file\n");
retval = -ENODEV; retval = -ENODEV;
goto error_clean_mounts; goto error_clean_mounts;
} }
...@@ -665,7 +665,7 @@ static void usbfs_add_bus(struct usb_bus *bus) ...@@ -665,7 +665,7 @@ static void usbfs_add_bus(struct usb_bus *bus)
bus->usbfs_dentry = fs_create_file (name, busmode | S_IFDIR, parent, bus->usbfs_dentry = fs_create_file (name, busmode | S_IFDIR, parent,
bus, NULL, busuid, busgid); bus, NULL, busuid, busgid);
if (bus->usbfs_dentry == NULL) { if (bus->usbfs_dentry == NULL) {
err ("error creating usbfs bus entry"); printk(KERN_ERR "Error creating usbfs bus entry\n");
return; return;
} }
} }
...@@ -696,7 +696,7 @@ static void usbfs_add_device(struct usb_device *dev) ...@@ -696,7 +696,7 @@ static void usbfs_add_device(struct usb_device *dev)
&usbdev_file_operations, &usbdev_file_operations,
devuid, devgid); devuid, devgid);
if (dev->usbfs_dentry == NULL) { if (dev->usbfs_dentry == NULL) {
err ("error creating usbfs device entry"); printk(KERN_ERR "Error creating usbfs device entry\n");
return; return;
} }
......
...@@ -70,7 +70,7 @@ struct urb *usb_alloc_urb(int iso_packets, gfp_t mem_flags) ...@@ -70,7 +70,7 @@ struct urb *usb_alloc_urb(int iso_packets, gfp_t mem_flags)
iso_packets * sizeof(struct usb_iso_packet_descriptor), iso_packets * sizeof(struct usb_iso_packet_descriptor),
mem_flags); mem_flags);
if (!urb) { if (!urb) {
err("alloc_urb: kmalloc failed"); printk(KERN_ERR "alloc_urb: kmalloc failed\n");
return NULL; return NULL;
} }
usb_init_urb(urb); usb_init_urb(urb);
...@@ -407,7 +407,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) ...@@ -407,7 +407,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
/* fail if submitter gave bogus flags */ /* fail if submitter gave bogus flags */
if (urb->transfer_flags != orig_flags) { if (urb->transfer_flags != orig_flags) {
err("BOGUS urb flags, %x --> %x", dev_err(&dev->dev, "BOGUS urb flags, %x --> %x\n",
orig_flags, urb->transfer_flags); orig_flags, urb->transfer_flags);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment