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
+2 -2
View File
@@ -1360,8 +1360,8 @@ printer_bind(struct usb_gadget *gadget)
/* Setup the sysfs files for the printer gadget. */
dev->pdev = device_create(usb_gadget_class, NULL, g_printer_devno,
"g_printer");
dev->pdev = device_create_drvdata(usb_gadget_class, NULL,
g_printer_devno, NULL, "g_printer");
if (IS_ERR(dev->pdev)) {
ERROR(dev, "Failed to create device: g_printer\n");
goto fail;