提交 b0b090e5 编写于 作者: G Greg Kroah-Hartman

device create: usb: convert device_create_drvdata to device_create

Now that device_create() has been audited, rename things back to the
original call to be sane.
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 abe9ab8f
...@@ -1729,9 +1729,9 @@ static int usb_classdev_add(struct usb_device *dev) ...@@ -1729,9 +1729,9 @@ static int usb_classdev_add(struct usb_device *dev)
{ {
struct device *cldev; struct device *cldev;
cldev = device_create_drvdata(usb_classdev_class, &dev->dev, cldev = device_create(usb_classdev_class, &dev->dev, dev->dev.devt,
dev->dev.devt, NULL, "usbdev%d.%d", NULL, "usbdev%d.%d", dev->bus->busnum,
dev->bus->busnum, dev->devnum); dev->devnum);
if (IS_ERR(cldev)) if (IS_ERR(cldev))
return PTR_ERR(cldev); return PTR_ERR(cldev);
dev->usb_classdev = cldev; dev->usb_classdev = cldev;
......
...@@ -196,9 +196,9 @@ int usb_register_dev(struct usb_interface *intf, ...@@ -196,9 +196,9 @@ int usb_register_dev(struct usb_interface *intf,
++temp; ++temp;
else else
temp = name; temp = name;
intf->usb_dev = device_create_drvdata(usb_class->class, &intf->dev, intf->usb_dev = device_create(usb_class->class, &intf->dev,
MKDEV(USB_MAJOR, minor), NULL, MKDEV(USB_MAJOR, minor), NULL,
"%s", temp); "%s", temp);
if (IS_ERR(intf->usb_dev)) { if (IS_ERR(intf->usb_dev)) {
down_write(&minor_rwsem); down_write(&minor_rwsem);
usb_minors[intf->minor] = NULL; usb_minors[intf->minor] = NULL;
......
...@@ -818,9 +818,8 @@ static int usb_register_bus(struct usb_bus *bus) ...@@ -818,9 +818,8 @@ static int usb_register_bus(struct usb_bus *bus)
set_bit (busnum, busmap.busmap); set_bit (busnum, busmap.busmap);
bus->busnum = busnum; bus->busnum = busnum;
bus->dev = device_create_drvdata(usb_host_class, bus->controller, bus->dev = device_create(usb_host_class, bus->controller, MKDEV(0, 0),
MKDEV(0, 0), bus, bus, "usb_host%d", busnum);
"usb_host%d", busnum);
result = PTR_ERR(bus->dev); result = PTR_ERR(bus->dev);
if (IS_ERR(bus->dev)) if (IS_ERR(bus->dev))
goto error_create_class_dev; goto error_create_class_dev;
......
...@@ -1360,8 +1360,8 @@ printer_bind(struct usb_gadget *gadget) ...@@ -1360,8 +1360,8 @@ printer_bind(struct usb_gadget *gadget)
/* Setup the sysfs files for the printer gadget. */ /* Setup the sysfs files for the printer gadget. */
dev->pdev = device_create_drvdata(usb_gadget_class, NULL, dev->pdev = device_create(usb_gadget_class, NULL, g_printer_devno,
g_printer_devno, NULL, "g_printer"); NULL, "g_printer");
if (IS_ERR(dev->pdev)) { if (IS_ERR(dev->pdev)) {
ERROR(dev, "Failed to create device: g_printer\n"); ERROR(dev, "Failed to create device: g_printer\n");
goto fail; goto fail;
......
...@@ -595,9 +595,8 @@ static int interfacekit_probe(struct usb_interface *intf, const struct usb_devic ...@@ -595,9 +595,8 @@ static int interfacekit_probe(struct usb_interface *intf, const struct usb_devic
} while(value); } while(value);
kit->dev_no = bit; kit->dev_no = bit;
kit->dev = device_create_drvdata(phidget_class, &kit->udev->dev, kit->dev = device_create(phidget_class, &kit->udev->dev, MKDEV(0, 0),
MKDEV(0, 0), kit, kit, "interfacekit%d", kit->dev_no);
"interfacekit%d", kit->dev_no);
if (IS_ERR(kit->dev)) { if (IS_ERR(kit->dev)) {
rc = PTR_ERR(kit->dev); rc = PTR_ERR(kit->dev);
kit->dev = NULL; kit->dev = NULL;
......
...@@ -365,9 +365,8 @@ static int motorcontrol_probe(struct usb_interface *intf, const struct usb_devic ...@@ -365,9 +365,8 @@ static int motorcontrol_probe(struct usb_interface *intf, const struct usb_devic
} while(value); } while(value);
mc->dev_no = bit; mc->dev_no = bit;
mc->dev = device_create_drvdata(phidget_class, &mc->udev->dev, mc->dev = device_create(phidget_class, &mc->udev->dev, MKDEV(0, 0), mc,
MKDEV(0, 0), mc, "motorcontrol%d", mc->dev_no);
"motorcontrol%d", mc->dev_no);
if (IS_ERR(mc->dev)) { if (IS_ERR(mc->dev)) {
rc = PTR_ERR(mc->dev); rc = PTR_ERR(mc->dev);
mc->dev = NULL; mc->dev = NULL;
......
...@@ -275,9 +275,8 @@ servo_probe(struct usb_interface *interface, const struct usb_device_id *id) ...@@ -275,9 +275,8 @@ servo_probe(struct usb_interface *interface, const struct usb_device_id *id)
} while (value); } while (value);
dev->dev_no = bit; dev->dev_no = bit;
dev->dev = device_create_drvdata(phidget_class, &dev->udev->dev, dev->dev = device_create(phidget_class, &dev->udev->dev, MKDEV(0, 0),
MKDEV(0, 0), dev, dev, "servo%d", dev->dev_no);
"servo%d", dev->dev_no);
if (IS_ERR(dev->dev)) { if (IS_ERR(dev->dev)) {
rc = PTR_ERR(dev->dev); rc = PTR_ERR(dev->dev);
dev->dev = NULL; dev->dev = NULL;
......
...@@ -1162,9 +1162,9 @@ int mon_bin_add(struct mon_bus *mbus, const struct usb_bus *ubus) ...@@ -1162,9 +1162,9 @@ int mon_bin_add(struct mon_bus *mbus, const struct usb_bus *ubus)
if (minor >= MON_BIN_MAX_MINOR) if (minor >= MON_BIN_MAX_MINOR)
return 0; return 0;
dev = device_create_drvdata(mon_bin_class, ubus? ubus->controller: NULL, dev = device_create(mon_bin_class, ubus ? ubus->controller : NULL,
MKDEV(MAJOR(mon_bin_dev0), minor), NULL, MKDEV(MAJOR(mon_bin_dev0), minor), NULL,
"usbmon%d", minor); "usbmon%d", minor);
if (IS_ERR(dev)) if (IS_ERR(dev))
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册