device create: usb: convert device_create to device_create_drvdata

device_create() is race-prone, so use the race-free
device_create_drvdata() instead as device_create() is going away.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman
2008-05-21 12:52:33 -07:00
parent 3d81252ddb
commit bc00bc9242
4 changed files with 11 additions and 9 deletions

View File

@@ -196,8 +196,9 @@ int usb_register_dev(struct usb_interface *intf,
++temp;
else
temp = name;
intf->usb_dev = device_create(usb_class->class, &intf->dev,
MKDEV(USB_MAJOR, minor), "%s", temp);
intf->usb_dev = device_create_drvdata(usb_class->class, &intf->dev,
MKDEV(USB_MAJOR, minor), NULL,
"%s", temp);
if (IS_ERR(intf->usb_dev)) {
down_write(&minor_rwsem);
usb_minors[intf->minor] = NULL;