diff options
Diffstat (limited to 'drivers/usb/core/file.c')
-rw-r--r-- | drivers/usb/core/file.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 38ed2220c9fc..65ca131cc44c 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c | |||
@@ -68,7 +68,7 @@ static struct file_operations usb_fops = { | |||
68 | .open = usb_open, | 68 | .open = usb_open, |
69 | }; | 69 | }; |
70 | 70 | ||
71 | static struct class_simple *usb_class; | 71 | static struct class *usb_class; |
72 | 72 | ||
73 | int usb_major_init(void) | 73 | int usb_major_init(void) |
74 | { | 74 | { |
@@ -80,9 +80,10 @@ int usb_major_init(void) | |||
80 | goto out; | 80 | goto out; |
81 | } | 81 | } |
82 | 82 | ||
83 | usb_class = class_simple_create(THIS_MODULE, "usb"); | 83 | usb_class = class_create(THIS_MODULE, "usb"); |
84 | if (IS_ERR(usb_class)) { | 84 | if (IS_ERR(usb_class)) { |
85 | err("class_simple_create failed for usb devices"); | 85 | error = PTR_ERR(usb_class); |
86 | err("class_create failed for usb devices"); | ||
86 | unregister_chrdev(USB_MAJOR, "usb"); | 87 | unregister_chrdev(USB_MAJOR, "usb"); |
87 | goto out; | 88 | goto out; |
88 | } | 89 | } |
@@ -95,7 +96,7 @@ out: | |||
95 | 96 | ||
96 | void usb_major_cleanup(void) | 97 | void usb_major_cleanup(void) |
97 | { | 98 | { |
98 | class_simple_destroy(usb_class); | 99 | class_destroy(usb_class); |
99 | devfs_remove("usb"); | 100 | devfs_remove("usb"); |
100 | unregister_chrdev(USB_MAJOR, "usb"); | 101 | unregister_chrdev(USB_MAJOR, "usb"); |
101 | } | 102 | } |
@@ -171,7 +172,7 @@ int usb_register_dev(struct usb_interface *intf, | |||
171 | ++temp; | 172 | ++temp; |
172 | else | 173 | else |
173 | temp = name; | 174 | temp = name; |
174 | intf->class_dev = class_simple_device_add(usb_class, MKDEV(USB_MAJOR, minor), &intf->dev, "%s", temp); | 175 | intf->class_dev = class_device_create(usb_class, MKDEV(USB_MAJOR, minor), &intf->dev, "%s", temp); |
175 | if (IS_ERR(intf->class_dev)) { | 176 | if (IS_ERR(intf->class_dev)) { |
176 | spin_lock (&minor_lock); | 177 | spin_lock (&minor_lock); |
177 | usb_minors[intf->minor] = NULL; | 178 | usb_minors[intf->minor] = NULL; |
@@ -220,7 +221,7 @@ void usb_deregister_dev(struct usb_interface *intf, | |||
220 | 221 | ||
221 | snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base); | 222 | snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base); |
222 | devfs_remove (name); | 223 | devfs_remove (name); |
223 | class_simple_device_remove(MKDEV(USB_MAJOR, intf->minor)); | 224 | class_device_destroy(usb_class, MKDEV(USB_MAJOR, intf->minor)); |
224 | intf->class_dev = NULL; | 225 | intf->class_dev = NULL; |
225 | intf->minor = -1; | 226 | intf->minor = -1; |
226 | } | 227 | } |