diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-21 15:52:33 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-22 00:54:46 -0400 |
commit | bc00bc924295f02295fe5eeeba3618ba0d0db1ef (patch) | |
tree | d13f926c627f2d892c20b714288ff85aeae89e37 /drivers/usb/core | |
parent | 3d81252ddb10f63ae4db713d9b32faabe641b850 (diff) |
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>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/devio.c | 6 | ||||
-rw-r--r-- | drivers/usb/core/file.c | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 6fbc8f5ab80c..20290c5b1562 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -1729,9 +1729,9 @@ static int usb_classdev_add(struct usb_device *dev) | |||
1729 | { | 1729 | { |
1730 | struct device *cldev; | 1730 | struct device *cldev; |
1731 | 1731 | ||
1732 | cldev = device_create(usb_classdev_class, &dev->dev, dev->dev.devt, | 1732 | cldev = device_create_drvdata(usb_classdev_class, &dev->dev, |
1733 | "usbdev%d.%d", dev->bus->busnum, | 1733 | dev->dev.devt, NULL, "usbdev%d.%d", |
1734 | dev->devnum); | 1734 | dev->bus->busnum, dev->devnum); |
1735 | if (IS_ERR(cldev)) | 1735 | if (IS_ERR(cldev)) |
1736 | return PTR_ERR(cldev); | 1736 | return PTR_ERR(cldev); |
1737 | dev->usb_classdev = cldev; | 1737 | dev->usb_classdev = cldev; |
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 913fb8667899..6b1b229e38cd 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c | |||
@@ -196,8 +196,9 @@ int usb_register_dev(struct usb_interface *intf, | |||
196 | ++temp; | 196 | ++temp; |
197 | else | 197 | else |
198 | temp = name; | 198 | temp = name; |
199 | intf->usb_dev = device_create(usb_class->class, &intf->dev, | 199 | intf->usb_dev = device_create_drvdata(usb_class->class, &intf->dev, |
200 | MKDEV(USB_MAJOR, minor), "%s", temp); | 200 | MKDEV(USB_MAJOR, minor), NULL, |
201 | "%s", temp); | ||
201 | if (IS_ERR(intf->usb_dev)) { | 202 | if (IS_ERR(intf->usb_dev)) { |
202 | down_write(&minor_rwsem); | 203 | down_write(&minor_rwsem); |
203 | usb_minors[intf->minor] = NULL; | 204 | usb_minors[intf->minor] = NULL; |