diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-05-02 00:02:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-21 18:15:46 -0400 |
commit | 7071a3ce0ca058ad2a9e3e8c33f30fb0bce62005 (patch) | |
tree | 6e269adae8630b505a69efd0b8351440ef6b69b8 /drivers/usb/core | |
parent | 36aa81172edba8a3a8ecedbd1f56d41774ce2e08 (diff) |
USB: usb dev_name() instead of dev->bus_id
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>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/driver.c | 6 | ||||
-rw-r--r-- | drivers/usb/core/endpoint.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/file.c | 10 | ||||
-rw-r--r-- | drivers/usb/core/hcd.c | 4 | ||||
-rw-r--r-- | drivers/usb/core/message.c | 6 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 1e56f1cfa6dc..d0b37d776afe 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -586,7 +586,7 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
586 | struct usb_device *usb_dev; | 586 | struct usb_device *usb_dev; |
587 | 587 | ||
588 | /* driver is often null here; dev_dbg() would oops */ | 588 | /* driver is often null here; dev_dbg() would oops */ |
589 | pr_debug("usb %s: uevent\n", dev->bus_id); | 589 | pr_debug("usb %s: uevent\n", dev_name(dev)); |
590 | 590 | ||
591 | if (is_usb_device(dev)) | 591 | if (is_usb_device(dev)) |
592 | usb_dev = to_usb_device(dev); | 592 | usb_dev = to_usb_device(dev); |
@@ -596,11 +596,11 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
596 | } | 596 | } |
597 | 597 | ||
598 | if (usb_dev->devnum < 0) { | 598 | if (usb_dev->devnum < 0) { |
599 | pr_debug("usb %s: already deleted?\n", dev->bus_id); | 599 | pr_debug("usb %s: already deleted?\n", dev_name(dev)); |
600 | return -ENODEV; | 600 | return -ENODEV; |
601 | } | 601 | } |
602 | if (!usb_dev->bus) { | 602 | if (!usb_dev->bus) { |
603 | pr_debug("usb %s: bus removed?\n", dev->bus_id); | 603 | pr_debug("usb %s: bus removed?\n", dev_name(dev)); |
604 | return -ENODEV; | 604 | return -ENODEV; |
605 | } | 605 | } |
606 | 606 | ||
diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index fae55a31e26d..f600aec3fb3c 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c | |||
@@ -296,7 +296,7 @@ int usb_create_ep_files(struct device *parent, | |||
296 | retval = endpoint_get_minor(ep_dev); | 296 | retval = endpoint_get_minor(ep_dev); |
297 | if (retval) { | 297 | if (retval) { |
298 | dev_err(parent, "can not allocate minor number for %s\n", | 298 | dev_err(parent, "can not allocate minor number for %s\n", |
299 | ep_dev->dev.bus_id); | 299 | dev_name(&ep_dev->dev)); |
300 | goto error_register; | 300 | goto error_register; |
301 | } | 301 | } |
302 | 302 | ||
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index c6a95395e52a..913fb8667899 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c | |||
@@ -150,7 +150,7 @@ int usb_register_dev(struct usb_interface *intf, | |||
150 | int retval = -EINVAL; | 150 | int retval = -EINVAL; |
151 | int minor_base = class_driver->minor_base; | 151 | int minor_base = class_driver->minor_base; |
152 | int minor = 0; | 152 | int minor = 0; |
153 | char name[BUS_ID_SIZE]; | 153 | char name[20]; |
154 | char *temp; | 154 | char *temp; |
155 | 155 | ||
156 | #ifdef CONFIG_USB_DYNAMIC_MINORS | 156 | #ifdef CONFIG_USB_DYNAMIC_MINORS |
@@ -190,9 +190,9 @@ int usb_register_dev(struct usb_interface *intf, | |||
190 | intf->minor = minor; | 190 | intf->minor = minor; |
191 | 191 | ||
192 | /* create a usb class device for this usb interface */ | 192 | /* create a usb class device for this usb interface */ |
193 | snprintf(name, BUS_ID_SIZE, class_driver->name, minor - minor_base); | 193 | snprintf(name, sizeof(name), class_driver->name, minor - minor_base); |
194 | temp = strrchr(name, '/'); | 194 | temp = strrchr(name, '/'); |
195 | if (temp && (temp[1] != 0x00)) | 195 | if (temp && (temp[1] != '\0')) |
196 | ++temp; | 196 | ++temp; |
197 | else | 197 | else |
198 | temp = name; | 198 | temp = name; |
@@ -227,7 +227,7 @@ void usb_deregister_dev(struct usb_interface *intf, | |||
227 | struct usb_class_driver *class_driver) | 227 | struct usb_class_driver *class_driver) |
228 | { | 228 | { |
229 | int minor_base = class_driver->minor_base; | 229 | int minor_base = class_driver->minor_base; |
230 | char name[BUS_ID_SIZE]; | 230 | char name[20]; |
231 | 231 | ||
232 | #ifdef CONFIG_USB_DYNAMIC_MINORS | 232 | #ifdef CONFIG_USB_DYNAMIC_MINORS |
233 | minor_base = 0; | 233 | minor_base = 0; |
@@ -242,7 +242,7 @@ void usb_deregister_dev(struct usb_interface *intf, | |||
242 | usb_minors[intf->minor] = NULL; | 242 | usb_minors[intf->minor] = NULL; |
243 | up_write(&minor_rwsem); | 243 | up_write(&minor_rwsem); |
244 | 244 | ||
245 | snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base); | 245 | snprintf(name, sizeof(name), class_driver->name, intf->minor - minor_base); |
246 | device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor)); | 246 | device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor)); |
247 | intf->usb_dev = NULL; | 247 | intf->usb_dev = NULL; |
248 | intf->minor = -1; | 248 | intf->minor = -1; |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 07f7bedf4dca..f7bfd72ef115 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -900,14 +900,14 @@ static int register_root_hub(struct usb_hcd *hcd) | |||
900 | if (retval != sizeof usb_dev->descriptor) { | 900 | if (retval != sizeof usb_dev->descriptor) { |
901 | mutex_unlock(&usb_bus_list_lock); | 901 | mutex_unlock(&usb_bus_list_lock); |
902 | dev_dbg (parent_dev, "can't read %s device descriptor %d\n", | 902 | dev_dbg (parent_dev, "can't read %s device descriptor %d\n", |
903 | usb_dev->dev.bus_id, retval); | 903 | dev_name(&usb_dev->dev), retval); |
904 | return (retval < 0) ? retval : -EMSGSIZE; | 904 | return (retval < 0) ? retval : -EMSGSIZE; |
905 | } | 905 | } |
906 | 906 | ||
907 | retval = usb_new_device (usb_dev); | 907 | retval = usb_new_device (usb_dev); |
908 | if (retval) { | 908 | if (retval) { |
909 | dev_err (parent_dev, "can't register root hub for %s, %d\n", | 909 | dev_err (parent_dev, "can't register root hub for %s, %d\n", |
910 | usb_dev->dev.bus_id, retval); | 910 | dev_name(&usb_dev->dev), retval); |
911 | } | 911 | } |
912 | mutex_unlock(&usb_bus_list_lock); | 912 | mutex_unlock(&usb_bus_list_lock); |
913 | 913 | ||
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index fe47d145255a..1141a4918e88 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1090,7 +1090,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) | |||
1090 | if (!device_is_registered(&interface->dev)) | 1090 | if (!device_is_registered(&interface->dev)) |
1091 | continue; | 1091 | continue; |
1092 | dev_dbg(&dev->dev, "unregistering interface %s\n", | 1092 | dev_dbg(&dev->dev, "unregistering interface %s\n", |
1093 | interface->dev.bus_id); | 1093 | dev_name(&interface->dev)); |
1094 | device_del(&interface->dev); | 1094 | device_del(&interface->dev); |
1095 | usb_remove_sysfs_intf_files(interface); | 1095 | usb_remove_sysfs_intf_files(interface); |
1096 | } | 1096 | } |
@@ -1631,12 +1631,12 @@ free_interfaces: | |||
1631 | 1631 | ||
1632 | dev_dbg(&dev->dev, | 1632 | dev_dbg(&dev->dev, |
1633 | "adding %s (config #%d, interface %d)\n", | 1633 | "adding %s (config #%d, interface %d)\n", |
1634 | intf->dev.bus_id, configuration, | 1634 | dev_name(&intf->dev), configuration, |
1635 | intf->cur_altsetting->desc.bInterfaceNumber); | 1635 | intf->cur_altsetting->desc.bInterfaceNumber); |
1636 | ret = device_add(&intf->dev); | 1636 | ret = device_add(&intf->dev); |
1637 | if (ret != 0) { | 1637 | if (ret != 0) { |
1638 | dev_err(&dev->dev, "device_add(%s) --> %d\n", | 1638 | dev_err(&dev->dev, "device_add(%s) --> %d\n", |
1639 | intf->dev.bus_id, ret); | 1639 | dev_name(&intf->dev), ret); |
1640 | continue; | 1640 | continue; |
1641 | } | 1641 | } |
1642 | usb_create_sysfs_intf_files(intf); | 1642 | usb_create_sysfs_intf_files(intf); |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 325774375837..3aca6d5afcdf 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -308,7 +308,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent, | |||
308 | * by location for diagnostics, tools, driver model, etc. The | 308 | * by location for diagnostics, tools, driver model, etc. The |
309 | * string is a path along hub ports, from the root. Each device's | 309 | * string is a path along hub ports, from the root. Each device's |
310 | * dev->devpath will be stable until USB is re-cabled, and hubs | 310 | * dev->devpath will be stable until USB is re-cabled, and hubs |
311 | * are often labeled with these port numbers. The bus_id isn't | 311 | * are often labeled with these port numbers. The name isn't |
312 | * as stable: bus->busnum changes easily from modprobe order, | 312 | * as stable: bus->busnum changes easily from modprobe order, |
313 | * cardbus or pci hotplugging, and so on. | 313 | * cardbus or pci hotplugging, and so on. |
314 | */ | 314 | */ |