Commit 0031a06e authored by Kay Sievers's avatar Kay Sievers Committed by Greg Kroah-Hartman

USB: usb dev_set_name() instead of dev->bus_id

The bus_id field is going away, use the dev_set_name() function
to set it properly.
Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7071a3ce
...@@ -307,7 +307,7 @@ int usb_create_ep_files(struct device *parent, ...@@ -307,7 +307,7 @@ int usb_create_ep_files(struct device *parent,
ep_dev->dev.class = ep_class->class; ep_dev->dev.class = ep_class->class;
ep_dev->dev.parent = parent; ep_dev->dev.parent = parent;
ep_dev->dev.release = ep_device_release; ep_dev->dev.release = ep_device_release;
snprintf(ep_dev->dev.bus_id, BUS_ID_SIZE, "usbdev%d.%d_ep%02x", dev_set_name(&ep_dev->dev, "usbdev%d.%d_ep%02x",
udev->bus->busnum, udev->devnum, udev->bus->busnum, udev->devnum,
endpoint->desc.bEndpointAddress); endpoint->desc.bEndpointAddress);
......
...@@ -1611,7 +1611,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration) ...@@ -1611,7 +1611,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
intf->dev.dma_mask = dev->dev.dma_mask; intf->dev.dma_mask = dev->dev.dma_mask;
device_initialize(&intf->dev); device_initialize(&intf->dev);
mark_quiesced(intf); mark_quiesced(intf);
sprintf(&intf->dev.bus_id[0], "%d-%s:%d.%d", dev_set_name(&intf->dev, "%d-%s:%d.%d",
dev->bus->busnum, dev->devpath, dev->bus->busnum, dev->devpath,
configuration, alt->desc.bInterfaceNumber); configuration, alt->desc.bInterfaceNumber);
} }
......
...@@ -316,7 +316,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent, ...@@ -316,7 +316,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
dev->devpath[0] = '0'; dev->devpath[0] = '0';
dev->dev.parent = bus->controller; dev->dev.parent = bus->controller;
sprintf(&dev->dev.bus_id[0], "usb%d", bus->busnum); dev_set_name(&dev->dev, "usb%d", bus->busnum);
root_hub = 1; root_hub = 1;
} else { } else {
/* match any labeling on the hubs; it's one-based */ /* match any labeling on the hubs; it's one-based */
...@@ -328,8 +328,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent, ...@@ -328,8 +328,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
"%s.%d", parent->devpath, port1); "%s.%d", parent->devpath, port1);
dev->dev.parent = &parent->dev; dev->dev.parent = &parent->dev;
sprintf(&dev->dev.bus_id[0], "%d-%s", dev_set_name(&dev->dev, "%d-%s", bus->busnum, dev->devpath);
bus->busnum, dev->devpath);
/* hub driver sets up TT records */ /* hub driver sets up TT records */
} }
......
...@@ -3342,7 +3342,7 @@ static int udc_probe(struct udc *dev) ...@@ -3342,7 +3342,7 @@ static int udc_probe(struct udc *dev)
spin_lock_init(&dev->lock); spin_lock_init(&dev->lock);
dev->gadget.ops = &udc_ops; dev->gadget.ops = &udc_ops;
strcpy(dev->gadget.dev.bus_id, "gadget"); dev_set_name(&dev->gadget.dev, "gadget");
dev->gadget.dev.release = gadget_release; dev->gadget.dev.release = gadget_release;
dev->gadget.name = name; dev->gadget.name = name;
dev->gadget.name = name; dev->gadget.name = name;
......
...@@ -862,7 +862,7 @@ static int dummy_udc_probe (struct platform_device *pdev) ...@@ -862,7 +862,7 @@ static int dummy_udc_probe (struct platform_device *pdev)
/* maybe claim OTG support, though we won't complete HNP */ /* maybe claim OTG support, though we won't complete HNP */
dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0); dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0);
strcpy (dum->gadget.dev.bus_id, "gadget"); dev_set_name(&dum->gadget.dev, "gadget");
dum->gadget.dev.parent = &pdev->dev; dum->gadget.dev.parent = &pdev->dev;
dum->gadget.dev.release = dummy_gadget_release; dum->gadget.dev.release = dummy_gadget_release;
rc = device_register (&dum->gadget.dev); rc = device_register (&dum->gadget.dev);
......
...@@ -3867,8 +3867,8 @@ static int __init fsg_bind(struct usb_gadget *gadget) ...@@ -3867,8 +3867,8 @@ static int __init fsg_bind(struct usb_gadget *gadget)
curlun->dev.parent = &gadget->dev; curlun->dev.parent = &gadget->dev;
curlun->dev.driver = &fsg_driver.driver; curlun->dev.driver = &fsg_driver.driver;
dev_set_drvdata(&curlun->dev, fsg); dev_set_drvdata(&curlun->dev, fsg);
snprintf(curlun->dev.bus_id, BUS_ID_SIZE, dev_set_name(&curlun->dev,"%s-lun%d",
"%s-lun%d", dev_name(&gadget->dev), i); dev_name(&gadget->dev), i);
if ((rc = device_register(&curlun->dev)) != 0) { if ((rc = device_register(&curlun->dev)) != 0) {
INFO(fsg, "failed to register LUN%d: %d\n", i, rc); INFO(fsg, "failed to register LUN%d: %d\n", i, rc);
......
...@@ -2331,7 +2331,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev) ...@@ -2331,7 +2331,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
udc_controller->gadget.name = driver_name; udc_controller->gadget.name = driver_name;
/* Setup gadget.dev and register with kernel */ /* Setup gadget.dev and register with kernel */
strcpy(udc_controller->gadget.dev.bus_id, "gadget"); dev_set_name(&udc_controller->gadget.dev, "gadget");
udc_controller->gadget.dev.release = fsl_udc_release; udc_controller->gadget.dev.release = fsl_udc_release;
udc_controller->gadget.dev.parent = &pdev->dev; udc_controller->gadget.dev.parent = &pdev->dev;
ret = device_register(&udc_controller->gadget.dev); ret = device_register(&udc_controller->gadget.dev);
......
...@@ -1790,7 +1790,7 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1790,7 +1790,7 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
dev->gadget.ops = &goku_ops; dev->gadget.ops = &goku_ops;
/* the "gadget" abstracts/virtualizes the controller */ /* the "gadget" abstracts/virtualizes the controller */
strcpy(dev->gadget.dev.bus_id, "gadget"); dev_set_name(&dev->gadget.dev, "gadget");
dev->gadget.dev.parent = &pdev->dev; dev->gadget.dev.parent = &pdev->dev;
dev->gadget.dev.dma_mask = pdev->dev.dma_mask; dev->gadget.dev.dma_mask = pdev->dev.dma_mask;
dev->gadget.dev.release = gadget_release; dev->gadget.dev.release = gadget_release;
......
...@@ -1593,7 +1593,7 @@ static int __init m66592_probe(struct platform_device *pdev) ...@@ -1593,7 +1593,7 @@ static int __init m66592_probe(struct platform_device *pdev)
m66592->gadget.ops = &m66592_gadget_ops; m66592->gadget.ops = &m66592_gadget_ops;
device_initialize(&m66592->gadget.dev); device_initialize(&m66592->gadget.dev);
strcpy(m66592->gadget.dev.bus_id, "gadget"); dev_set_name(&m66592->gadget, "gadget");
m66592->gadget.is_dualspeed = 1; m66592->gadget.is_dualspeed = 1;
m66592->gadget.dev.parent = &pdev->dev; m66592->gadget.dev.parent = &pdev->dev;
m66592->gadget.dev.dma_mask = pdev->dev.dma_mask; m66592->gadget.dev.dma_mask = pdev->dev.dma_mask;
......
...@@ -2768,7 +2768,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2768,7 +2768,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
dev->gadget.is_dualspeed = 1; dev->gadget.is_dualspeed = 1;
/* the "gadget" abstracts/virtualizes the controller */ /* the "gadget" abstracts/virtualizes the controller */
strcpy (dev->gadget.dev.bus_id, "gadget"); dev_set_name(&dev->gadget.dev, "gadget");
dev->gadget.dev.parent = &pdev->dev; dev->gadget.dev.parent = &pdev->dev;
dev->gadget.dev.dma_mask = pdev->dev.dma_mask; dev->gadget.dev.dma_mask = pdev->dev.dma_mask;
dev->gadget.dev.release = gadget_release; dev->gadget.dev.release = gadget_release;
......
...@@ -2686,7 +2686,7 @@ omap_udc_setup(struct platform_device *odev, struct otg_transceiver *xceiv) ...@@ -2686,7 +2686,7 @@ omap_udc_setup(struct platform_device *odev, struct otg_transceiver *xceiv)
udc->gadget.name = driver_name; udc->gadget.name = driver_name;
device_initialize(&udc->gadget.dev); device_initialize(&udc->gadget.dev);
strcpy (udc->gadget.dev.bus_id, "gadget"); dev_set_name(&udc->gadget.dev, "gadget");
udc->gadget.dev.release = omap_udc_release; udc->gadget.dev.release = omap_udc_release;
udc->gadget.dev.parent = &odev->dev; udc->gadget.dev.parent = &odev->dev;
if (use_dma) if (use_dma)
......
...@@ -2195,7 +2195,7 @@ struct usb_hcd *isp1760_register(u64 res_start, u64 res_len, int irq, ...@@ -2195,7 +2195,7 @@ struct usb_hcd *isp1760_register(u64 res_start, u64 res_len, int irq,
/* prevent usb-core allocating DMA pages */ /* prevent usb-core allocating DMA pages */
dev->dma_mask = NULL; dev->dma_mask = NULL;
hcd = usb_create_hcd(&isp1760_hc_driver, dev, dev->bus_id); hcd = usb_create_hcd(&isp1760_hc_driver, dev, dev_name(dev));
if (!hcd) if (!hcd)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
...@@ -938,7 +938,7 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -938,7 +938,7 @@ int usb_serial_probe(struct usb_interface *interface,
port->dev.bus = &usb_serial_bus_type; port->dev.bus = &usb_serial_bus_type;
port->dev.release = &port_release; port->dev.release = &port_release;
snprintf (&port->dev.bus_id[0], sizeof(port->dev.bus_id), "ttyUSB%d", port->number); dev_set_name(&port->dev, "ttyUSB%d", port->number);
dbg ("%s - registering %s", __func__, dev_name(&port->dev)); dbg ("%s - registering %s", __func__, dev_name(&port->dev));
retval = device_register(&port->dev); retval = device_register(&port->dev);
if (retval) if (retval)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment