Skip to content

Commit

Permalink
USB: usb dev_name() instead of dev->bus_id
Browse files Browse the repository at this point in the history
The bus_id field is going away, use the dev_name() function instead.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Jul 21, 2008
1 parent 36aa811 commit 7071a3c
Show file tree
Hide file tree
Showing 27 changed files with 51 additions and 51 deletions.
6 changes: 3 additions & 3 deletions drivers/usb/core/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
struct usb_device *usb_dev;

/* driver is often null here; dev_dbg() would oops */
pr_debug("usb %s: uevent\n", dev->bus_id);
pr_debug("usb %s: uevent\n", dev_name(dev));

if (is_usb_device(dev))
usb_dev = to_usb_device(dev);
Expand All @@ -596,11 +596,11 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
}

if (usb_dev->devnum < 0) {
pr_debug("usb %s: already deleted?\n", dev->bus_id);
pr_debug("usb %s: already deleted?\n", dev_name(dev));
return -ENODEV;
}
if (!usb_dev->bus) {
pr_debug("usb %s: bus removed?\n", dev->bus_id);
pr_debug("usb %s: bus removed?\n", dev_name(dev));
return -ENODEV;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/core/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ int usb_create_ep_files(struct device *parent,
retval = endpoint_get_minor(ep_dev);
if (retval) {
dev_err(parent, "can not allocate minor number for %s\n",
ep_dev->dev.bus_id);
dev_name(&ep_dev->dev));
goto error_register;
}

Expand Down
10 changes: 5 additions & 5 deletions drivers/usb/core/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int usb_register_dev(struct usb_interface *intf,
int retval = -EINVAL;
int minor_base = class_driver->minor_base;
int minor = 0;
char name[BUS_ID_SIZE];
char name[20];
char *temp;

#ifdef CONFIG_USB_DYNAMIC_MINORS
Expand Down Expand Up @@ -190,9 +190,9 @@ int usb_register_dev(struct usb_interface *intf,
intf->minor = minor;

/* create a usb class device for this usb interface */
snprintf(name, BUS_ID_SIZE, class_driver->name, minor - minor_base);
snprintf(name, sizeof(name), class_driver->name, minor - minor_base);
temp = strrchr(name, '/');
if (temp && (temp[1] != 0x00))
if (temp && (temp[1] != '\0'))
++temp;
else
temp = name;
Expand Down Expand Up @@ -227,7 +227,7 @@ void usb_deregister_dev(struct usb_interface *intf,
struct usb_class_driver *class_driver)
{
int minor_base = class_driver->minor_base;
char name[BUS_ID_SIZE];
char name[20];

#ifdef CONFIG_USB_DYNAMIC_MINORS
minor_base = 0;
Expand All @@ -242,7 +242,7 @@ void usb_deregister_dev(struct usb_interface *intf,
usb_minors[intf->minor] = NULL;
up_write(&minor_rwsem);

snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base);
snprintf(name, sizeof(name), class_driver->name, intf->minor - minor_base);
device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor));
intf->usb_dev = NULL;
intf->minor = -1;
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/core/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,14 +900,14 @@ static int register_root_hub(struct usb_hcd *hcd)
if (retval != sizeof usb_dev->descriptor) {
mutex_unlock(&usb_bus_list_lock);
dev_dbg (parent_dev, "can't read %s device descriptor %d\n",
usb_dev->dev.bus_id, retval);
dev_name(&usb_dev->dev), retval);
return (retval < 0) ? retval : -EMSGSIZE;
}

retval = usb_new_device (usb_dev);
if (retval) {
dev_err (parent_dev, "can't register root hub for %s, %d\n",
usb_dev->dev.bus_id, retval);
dev_name(&usb_dev->dev), retval);
}
mutex_unlock(&usb_bus_list_lock);

Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
if (!device_is_registered(&interface->dev))
continue;
dev_dbg(&dev->dev, "unregistering interface %s\n",
interface->dev.bus_id);
dev_name(&interface->dev));
device_del(&interface->dev);
usb_remove_sysfs_intf_files(interface);
}
Expand Down Expand Up @@ -1631,12 +1631,12 @@ int usb_set_configuration(struct usb_device *dev, int configuration)

dev_dbg(&dev->dev,
"adding %s (config #%d, interface %d)\n",
intf->dev.bus_id, configuration,
dev_name(&intf->dev), configuration,
intf->cur_altsetting->desc.bInterfaceNumber);
ret = device_add(&intf->dev);
if (ret != 0) {
dev_err(&dev->dev, "device_add(%s) --> %d\n",
intf->dev.bus_id, ret);
dev_name(&intf->dev), ret);
continue;
}
usb_create_sysfs_intf_files(intf);
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/core/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
* by location for diagnostics, tools, driver model, etc. The
* string is a path along hub ports, from the root. Each device's
* dev->devpath will be stable until USB is re-cabled, and hubs
* are often labeled with these port numbers. The bus_id isn't
* are often labeled with these port numbers. The name isn't
* as stable: bus->busnum changes easily from modprobe order,
* cardbus or pci hotplugging, and so on.
*/
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/dummy_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ static int dummy_hcd_probe(struct platform_device *pdev)

dev_info(&pdev->dev, "%s, driver " DRIVER_VERSION "\n", driver_desc);

hcd = usb_create_hcd(&dummy_hcd, &pdev->dev, pdev->dev.bus_id);
hcd = usb_create_hcd(&dummy_hcd, &pdev->dev, dev_name(&pdev->dev));
if (!hcd)
return -ENOMEM;
the_controller = hcd_to_dummy (hcd);
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,7 @@ static void eth_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *p)
strlcpy(p->driver, shortname, sizeof p->driver);
strlcpy(p->version, DRIVER_VERSION, sizeof p->version);
strlcpy(p->fw_version, dev->gadget->name, sizeof p->fw_version);
strlcpy (p->bus_info, dev->gadget->dev.bus_id, sizeof p->bus_info);
strlcpy (p->bus_info, dev_name(&dev->gadget->dev), sizeof p->bus_info);
}

static u32 eth_get_link(struct net_device *net)
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/file_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -3868,7 +3868,7 @@ static int __init fsg_bind(struct usb_gadget *gadget)
curlun->dev.driver = &fsg_driver.driver;
dev_set_drvdata(&curlun->dev, fsg);
snprintf(curlun->dev.bus_id, BUS_ID_SIZE,
"%s-lun%d", gadget->dev.bus_id, i);
"%s-lun%d", dev_name(&gadget->dev), i);

if ((rc = device_register(&curlun->dev)) != 0) {
INFO(fsg, "failed to register LUN%d: %d\n", i, rc);
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/lh7a40x_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,7 @@ static const struct usb_gadget_ops lh7a40x_udc_ops = {

static void nop_release(struct device *dev)
{
DEBUG("%s %s\n", __func__, dev->bus_id);
DEBUG("%s %s\n", __func__, dev_name(dev));
}

static struct lh7a40x_udc memory = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/pxa25x_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ pxa25x_udc_irq(int irq, void *_dev)

static void nop_release (struct device *dev)
{
DMSG("%s %s\n", __func__, dev->bus_id);
DMSG("%s %s\n", __func__, dev_name(dev));
}

/* this uses load-time allocation and initialization (instead of
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/host/ehci-dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
"%s\n"
"SUSPENDED (no register access)\n",
hcd->self.controller->bus->name,
hcd->self.controller->bus_id,
dev_name(hcd->self.controller),
hcd->product_desc);
goto done;
}
Expand All @@ -688,7 +688,7 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
"%s\n"
"EHCI %x.%02x, hcd state %d\n",
hcd->self.controller->bus->name,
hcd->self.controller->bus_id,
dev_name(hcd->self.controller),
hcd->product_desc,
i >> 8, i & 0x0ff, hcd->state);
size -= temp;
Expand Down
12 changes: 6 additions & 6 deletions drivers/usb/host/ehci-fsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver,
pdata = (struct fsl_usb2_platform_data *)pdev->dev.platform_data;
if (!pdata) {
dev_err(&pdev->dev,
"No platform data for %s.\n", pdev->dev.bus_id);
"No platform data for %s.\n", dev_name(&pdev->dev));
return -ENODEV;
}

Expand All @@ -69,20 +69,20 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver,
(pdata->operating_mode == FSL_USB2_DR_OTG))) {
dev_err(&pdev->dev,
"Non Host Mode configured for %s. Wrong driver linked.\n",
pdev->dev.bus_id);
dev_name(&pdev->dev));
return -ENODEV;
}

res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res) {
dev_err(&pdev->dev,
"Found HC with no IRQ. Check %s setup!\n",
pdev->dev.bus_id);
dev_name(&pdev->dev));
return -ENODEV;
}
irq = res->start;

hcd = usb_create_hcd(driver, &pdev->dev, pdev->dev.bus_id);
hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
if (!hcd) {
retval = -ENOMEM;
goto err1;
Expand All @@ -92,7 +92,7 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver,
if (!res) {
dev_err(&pdev->dev,
"Found HC with no register addr. Check %s setup!\n",
pdev->dev.bus_id);
dev_name(&pdev->dev));
retval = -ENODEV;
goto err2;
}
Expand Down Expand Up @@ -132,7 +132,7 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver,
err2:
usb_put_hcd(hcd);
err1:
dev_err(&pdev->dev, "init %s fail, %d\n", pdev->dev.bus_id, retval);
dev_err(&pdev->dev, "init %s fail, %d\n", dev_name(&pdev->dev), retval);
return retval;
}

Expand Down
8 changes: 4 additions & 4 deletions drivers/usb/host/ehci-ixp4xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ static int ixp4xx_ehci_probe(struct platform_device *pdev)
if (!res) {
dev_err(&pdev->dev,
"Found HC with no IRQ. Check %s setup!\n",
pdev->dev.bus_id);
dev_name(&pdev->dev));
return -ENODEV;
}
irq = res->start;

hcd = usb_create_hcd(driver, &pdev->dev, pdev->dev.bus_id);
hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
if (!hcd) {
retval = -ENOMEM;
goto fail_create_hcd;
Expand All @@ -92,7 +92,7 @@ static int ixp4xx_ehci_probe(struct platform_device *pdev)
if (!res) {
dev_err(&pdev->dev,
"Found HC with no register addr. Check %s setup!\n",
pdev->dev.bus_id);
dev_name(&pdev->dev));
retval = -ENODEV;
goto fail_request_resource;
}
Expand Down Expand Up @@ -126,7 +126,7 @@ static int ixp4xx_ehci_probe(struct platform_device *pdev)
fail_request_resource:
usb_put_hcd(hcd);
fail_create_hcd:
dev_err(&pdev->dev, "init %s fail, %d\n", pdev->dev.bus_id, retval);
dev_err(&pdev->dev, "init %s fail, %d\n", dev_name(&pdev->dev), retval);
return retval;
}

Expand Down
8 changes: 4 additions & 4 deletions drivers/usb/host/ehci-orion.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static int __init ehci_orion_drv_probe(struct platform_device *pdev)
if (irq <= 0) {
dev_err(&pdev->dev,
"Found HC with no IRQ. Check %s setup!\n",
pdev->dev.bus_id);
dev_name(&pdev->dev));
err = -ENODEV;
goto err1;
}
Expand All @@ -213,7 +213,7 @@ static int __init ehci_orion_drv_probe(struct platform_device *pdev)
if (!res) {
dev_err(&pdev->dev,
"Found HC with no register addr. Check %s setup!\n",
pdev->dev.bus_id);
dev_name(&pdev->dev));
err = -ENODEV;
goto err1;
}
Expand All @@ -233,7 +233,7 @@ static int __init ehci_orion_drv_probe(struct platform_device *pdev)
}

hcd = usb_create_hcd(&ehci_orion_hc_driver,
&pdev->dev, pdev->dev.bus_id);
&pdev->dev, dev_name(&pdev->dev));
if (!hcd) {
err = -ENOMEM;
goto err3;
Expand Down Expand Up @@ -276,7 +276,7 @@ static int __init ehci_orion_drv_probe(struct platform_device *pdev)
release_mem_region(res->start, res->end - res->start + 1);
err1:
dev_err(&pdev->dev, "init %s fail, %d\n",
pdev->dev.bus_id, err);
dev_name(&pdev->dev), err);

return err;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-ps3.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)

dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */

hcd = usb_create_hcd(&ps3_ehci_hc_driver, &dev->core, dev->core.bus_id);
hcd = usb_create_hcd(&ps3_ehci_hc_driver, &dev->core, dev_name(&dev->core));

if (!hcd) {
dev_dbg(&dev->core, "%s:%d: usb_create_hcd failed\n", __func__,
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/isp116x-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,7 @@ static int __devinit isp116x_probe(struct platform_device *pdev)
}

/* allocate and initialize hcd */
hcd = usb_create_hcd(&isp116x_hc_driver, &pdev->dev, pdev->dev.bus_id);
hcd = usb_create_hcd(&isp116x_hc_driver, &pdev->dev, dev_name(&pdev->dev));
if (!hcd) {
ret = -ENOMEM;
goto err5;
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/host/isp1760-if.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static int of_isp1760_probe(struct of_device *dev,
return -ENXIO;

res = request_mem_region(memory.start, memory.end - memory.start + 1,
dev->dev.bus_id);
dev_name(&dev->dev));
if (!res)
return -EBUSY;

Expand All @@ -56,7 +56,7 @@ static int of_isp1760_probe(struct of_device *dev,
oirq.size);

hcd = isp1760_register(memory.start, res_len, virq,
IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev->dev.bus_id);
IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev));
if (IS_ERR(hcd)) {
ret = PTR_ERR(hcd);
goto release_reg;
Expand Down Expand Up @@ -200,7 +200,7 @@ static int __devinit isp1761_pci_probe(struct pci_dev *dev,

dev->dev.dma_mask = NULL;
hcd = isp1760_register(pci_mem_phy0, length, dev->irq,
IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev->dev.bus_id);
IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev));
pci_set_drvdata(dev, hcd);
if (!hcd)
return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ohci-dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
"%s\n"
"%s version " DRIVER_VERSION "\n",
hcd->self.controller->bus->name,
hcd->self.controller->bus_id,
dev_name(hcd->self.controller),
hcd->product_desc,
hcd_name);

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ohci-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ static int usb_hcd_omap_probe (const struct hc_driver *driver,
}


hcd = usb_create_hcd (driver, &pdev->dev, pdev->dev.bus_id);
hcd = usb_create_hcd (driver, &pdev->dev, dev_name(&pdev->dev));
if (!hcd) {
retval = -ENOMEM;
goto err0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ohci-pnx4008.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ static int __devinit usb_hcd_pnx4008_probe(struct platform_device *pdev)
while ((__raw_readl(USB_OTG_CLK_STAT) & USB_CLOCK_MASK) !=
USB_CLOCK_MASK) ;

hcd = usb_create_hcd (driver, &pdev->dev, pdev->dev.bus_id);
hcd = usb_create_hcd (driver, &pdev->dev, dev_name(&pdev->dev));
if (!hcd) {
err("Failed to allocate HC buffer");
ret = -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ohci-ps3.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static int ps3_ohci_probe(struct ps3_system_bus_device *dev)

dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */

hcd = usb_create_hcd(&ps3_ohci_hc_driver, &dev->core, dev->core.bus_id);
hcd = usb_create_hcd(&ps3_ohci_hc_driver, &dev->core, dev_name(&dev->core));

if (!hcd) {
dev_dbg(&dev->core, "%s:%d: usb_create_hcd failed\n", __func__,
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ohci-sm501.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev)
goto err2;
}

hcd = usb_create_hcd(driver, &pdev->dev, pdev->dev.bus_id);
hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
if (!hcd) {
retval = -ENOMEM;
goto err2;
Expand Down
Loading

0 comments on commit 7071a3c

Please sign in to comment.