aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-06-20 16:09:50 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 18:44:31 -0500
commit0873c76485c126a4df70a6961fd354b21b7987f7 (patch)
treeabc0acea6c9260c9e1d2590b82d38261e3ae985c /drivers/usb
parent7bc3d635628db100c024aca7f836a18188e9bb62 (diff)
USB: convert usb class devices to real devices
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/file.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c
index f794f07cfb33..01c857ac27af 100644
--- a/drivers/usb/core/file.c
+++ b/drivers/usb/core/file.c
@@ -194,14 +194,13 @@ int usb_register_dev(struct usb_interface *intf,
194 ++temp; 194 ++temp;
195 else 195 else
196 temp = name; 196 temp = name;
197 intf->class_dev = class_device_create(usb_class->class, NULL, 197 intf->usb_dev = device_create(usb_class->class, &intf->dev,
198 MKDEV(USB_MAJOR, minor), 198 MKDEV(USB_MAJOR, minor), "%s", temp);
199 &intf->dev, "%s", temp); 199 if (IS_ERR(intf->usb_dev)) {
200 if (IS_ERR(intf->class_dev)) {
201 spin_lock (&minor_lock); 200 spin_lock (&minor_lock);
202 usb_minors[intf->minor] = NULL; 201 usb_minors[intf->minor] = NULL;
203 spin_unlock (&minor_lock); 202 spin_unlock (&minor_lock);
204 retval = PTR_ERR(intf->class_dev); 203 retval = PTR_ERR(intf->usb_dev);
205 } 204 }
206exit: 205exit:
207 return retval; 206 return retval;
@@ -242,8 +241,8 @@ void usb_deregister_dev(struct usb_interface *intf,
242 spin_unlock (&minor_lock); 241 spin_unlock (&minor_lock);
243 242
244 snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base); 243 snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base);
245 class_device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor)); 244 device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor));
246 intf->class_dev = NULL; 245 intf->usb_dev = NULL;
247 intf->minor = -1; 246 intf->minor = -1;
248 destroy_usb_class(); 247 destroy_usb_class();
249} 248}