diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-08-14 12:37:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-17 17:41:11 -0400 |
commit | 69a85942ff2df8e1ee0a3b6afe8b1d85dce58333 (patch) | |
tree | 27b0d35194c258e66d063dea78a3fa467916cbef | |
parent | 9908a32e94de2141463e104c9924279ed3509447 (diff) |
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 <gregkh@suse.de>
-rw-r--r-- | drivers/usb/core/devio.c | 7 | ||||
-rw-r--r-- | drivers/usb/core/endpoint.c | 3 | ||||
-rw-r--r-- | drivers/usb/core/file.c | 5 | ||||
-rw-r--r-- | drivers/usb/core/inode.c | 12 | ||||
-rw-r--r-- | drivers/usb/core/urb.c | 4 |
5 files changed, 17 insertions, 14 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 7f621149f9f2..2bccefebff1b 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -1777,19 +1777,20 @@ int __init usb_devio_init(void) | |||
1777 | retval = register_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX, | 1777 | retval = register_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX, |
1778 | "usb_device"); | 1778 | "usb_device"); |
1779 | if (retval) { | 1779 | if (retval) { |
1780 | err("unable to register minors for usb_device"); | 1780 | printk(KERN_ERR "Unable to register minors for usb_device\n"); |
1781 | goto out; | 1781 | goto out; |
1782 | } | 1782 | } |
1783 | cdev_init(&usb_device_cdev, &usbdev_file_operations); | 1783 | cdev_init(&usb_device_cdev, &usbdev_file_operations); |
1784 | retval = cdev_add(&usb_device_cdev, USB_DEVICE_DEV, USB_DEVICE_MAX); | 1784 | retval = cdev_add(&usb_device_cdev, USB_DEVICE_DEV, USB_DEVICE_MAX); |
1785 | if (retval) { | 1785 | 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); | ||
1787 | goto error_cdev; | 1788 | goto error_cdev; |
1788 | } | 1789 | } |
1789 | #ifdef CONFIG_USB_DEVICE_CLASS | 1790 | #ifdef CONFIG_USB_DEVICE_CLASS |
1790 | usb_classdev_class = class_create(THIS_MODULE, "usb_device"); | 1791 | usb_classdev_class = class_create(THIS_MODULE, "usb_device"); |
1791 | if (IS_ERR(usb_classdev_class)) { | 1792 | 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"); |
1793 | retval = PTR_ERR(usb_classdev_class); | 1794 | retval = PTR_ERR(usb_classdev_class); |
1794 | cdev_del(&usb_device_cdev); | 1795 | cdev_del(&usb_device_cdev); |
1795 | usb_classdev_class = NULL; | 1796 | usb_classdev_class = NULL; |
diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index 22912136fc14..946fae43d622 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c | |||
@@ -169,7 +169,8 @@ static int usb_endpoint_major_init(void) | |||
169 | error = alloc_chrdev_region(&dev, 0, MAX_ENDPOINT_MINORS, | 169 | error = alloc_chrdev_region(&dev, 0, MAX_ENDPOINT_MINORS, |
170 | "usb_endpoint"); | 170 | "usb_endpoint"); |
171 | if (error) { | 171 | 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"); | ||
173 | return error; | 174 | return error; |
174 | } | 175 | } |
175 | usb_endpoint_major = MAJOR(dev); | 176 | usb_endpoint_major = MAJOR(dev); |
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 55f7f310924b..997e659ff693 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c | |||
@@ -86,7 +86,7 @@ static int init_usb_class(void) | |||
86 | usb_class->class = class_create(THIS_MODULE, "usb"); | 86 | usb_class->class = class_create(THIS_MODULE, "usb"); |
87 | if (IS_ERR(usb_class->class)) { | 87 | if (IS_ERR(usb_class->class)) { |
88 | result = IS_ERR(usb_class->class); | 88 | 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"); |
90 | kfree(usb_class); | 90 | kfree(usb_class); |
91 | usb_class = NULL; | 91 | usb_class = NULL; |
92 | } | 92 | } |
@@ -115,7 +115,8 @@ int usb_major_init(void) | |||
115 | 115 | ||
116 | error = register_chrdev(USB_MAJOR, "usb", &usb_fops); | 116 | error = register_chrdev(USB_MAJOR, "usb", &usb_fops); |
117 | if (error) | 117 | 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); | ||
119 | 120 | ||
120 | return error; | 121 | return error; |
121 | } | 122 | } |
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 2cf2dc8528d8..94632264dccf 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
@@ -180,8 +180,8 @@ static int parse_options(struct super_block *s, char *data) | |||
180 | listmode = option & S_IRWXUGO; | 180 | listmode = option & S_IRWXUGO; |
181 | break; | 181 | break; |
182 | default: | 182 | default: |
183 | err("usbfs: unrecognised mount option \"%s\" " | 183 | printk(KERN_ERR "usbfs: unrecognised mount option " |
184 | "or missing value\n", p); | 184 | "\"%s\" or missing value\n", p); |
185 | return -EINVAL; | 185 | return -EINVAL; |
186 | } | 186 | } |
187 | } | 187 | } |
@@ -601,7 +601,7 @@ static int create_special_files (void) | |||
601 | /* create the devices special file */ | 601 | /* create the devices special file */ |
602 | retval = simple_pin_fs(&usb_fs_type, &usbfs_mount, &usbfs_mount_count); | 602 | retval = simple_pin_fs(&usb_fs_type, &usbfs_mount, &usbfs_mount_count); |
603 | if (retval) { | 603 | if (retval) { |
604 | err ("Unable to get usbfs mount"); | 604 | printk(KERN_ERR "Unable to get usbfs mount\n"); |
605 | goto exit; | 605 | goto exit; |
606 | } | 606 | } |
607 | 607 | ||
@@ -613,7 +613,7 @@ static int create_special_files (void) | |||
613 | NULL, &usbfs_devices_fops, | 613 | NULL, &usbfs_devices_fops, |
614 | listuid, listgid); | 614 | listuid, listgid); |
615 | if (devices_usbfs_dentry == NULL) { | 615 | if (devices_usbfs_dentry == NULL) { |
616 | err ("Unable to create devices usbfs file"); | 616 | printk(KERN_ERR "Unable to create devices usbfs file\n"); |
617 | retval = -ENODEV; | 617 | retval = -ENODEV; |
618 | goto error_clean_mounts; | 618 | goto error_clean_mounts; |
619 | } | 619 | } |
@@ -665,7 +665,7 @@ static void usbfs_add_bus(struct usb_bus *bus) | |||
665 | bus->usbfs_dentry = fs_create_file (name, busmode | S_IFDIR, parent, | 665 | bus->usbfs_dentry = fs_create_file (name, busmode | S_IFDIR, parent, |
666 | bus, NULL, busuid, busgid); | 666 | bus, NULL, busuid, busgid); |
667 | if (bus->usbfs_dentry == NULL) { | 667 | if (bus->usbfs_dentry == NULL) { |
668 | err ("error creating usbfs bus entry"); | 668 | printk(KERN_ERR "Error creating usbfs bus entry\n"); |
669 | return; | 669 | return; |
670 | } | 670 | } |
671 | } | 671 | } |
@@ -696,7 +696,7 @@ static void usbfs_add_device(struct usb_device *dev) | |||
696 | &usbdev_file_operations, | 696 | &usbdev_file_operations, |
697 | devuid, devgid); | 697 | devuid, devgid); |
698 | if (dev->usbfs_dentry == NULL) { | 698 | if (dev->usbfs_dentry == NULL) { |
699 | err ("error creating usbfs device entry"); | 699 | printk(KERN_ERR "Error creating usbfs device entry\n"); |
700 | return; | 700 | return; |
701 | } | 701 | } |
702 | 702 | ||
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index 175d528f4029..f2638009a464 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -70,7 +70,7 @@ struct urb *usb_alloc_urb(int iso_packets, gfp_t mem_flags) | |||
70 | iso_packets * sizeof(struct usb_iso_packet_descriptor), | 70 | iso_packets * sizeof(struct usb_iso_packet_descriptor), |
71 | mem_flags); | 71 | mem_flags); |
72 | if (!urb) { | 72 | if (!urb) { |
73 | err("alloc_urb: kmalloc failed"); | 73 | printk(KERN_ERR "alloc_urb: kmalloc failed\n"); |
74 | return NULL; | 74 | return NULL; |
75 | } | 75 | } |
76 | usb_init_urb(urb); | 76 | usb_init_urb(urb); |
@@ -407,7 +407,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
407 | 407 | ||
408 | /* fail if submitter gave bogus flags */ | 408 | /* fail if submitter gave bogus flags */ |
409 | if (urb->transfer_flags != orig_flags) { | 409 | if (urb->transfer_flags != orig_flags) { |
410 | err("BOGUS urb flags, %x --> %x", | 410 | dev_err(&dev->dev, "BOGUS urb flags, %x --> %x\n", |
411 | orig_flags, urb->transfer_flags); | 411 | orig_flags, urb->transfer_flags); |
412 | return -EINVAL; | 412 | return -EINVAL; |
413 | } | 413 | } |