aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-10-29 20:59:32 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-06 16:52:05 -0500
commite913397202b7551299da20fc8cf7b90c46f61ba3 (patch)
tree367967524f55040a74d36495c0adbfd6a30a087e /drivers
parent9f37952aa0088242db7c19a8e31a6d284e4079e9 (diff)
staging: struct device - replace bus_id with dev_name(), dev_set_name()
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/at76_usb/at76_usb.c2
-rw-r--r--drivers/staging/poch/poch.c2
-rw-r--r--drivers/staging/usbip/stub.h2
-rw-r--r--drivers/staging/usbip/stub_dev.c2
-rw-r--r--drivers/staging/usbip/stub_main.c21
-rw-r--r--drivers/staging/usbip/stub_rx.c4
-rw-r--r--drivers/staging/usbip/vhci_hcd.c2
-rw-r--r--drivers/staging/usbip/vhci_sysfs.c2
8 files changed, 19 insertions, 18 deletions
diff --git a/drivers/staging/at76_usb/at76_usb.c b/drivers/staging/at76_usb/at76_usb.c
index c68d2279d49..185533e5476 100644
--- a/drivers/staging/at76_usb/at76_usb.c
+++ b/drivers/staging/at76_usb/at76_usb.c
@@ -2534,7 +2534,7 @@ static int at76_init_new_device(struct at76_priv *priv,
2534 2534
2535 dev_info(dev, "%s: USB %s, MAC %s, firmware %d.%d.%d-%d\n", 2535 dev_info(dev, "%s: USB %s, MAC %s, firmware %d.%d.%d-%d\n",
2536 wiphy_name(priv->hw->wiphy), 2536 wiphy_name(priv->hw->wiphy),
2537 interface->dev.bus_id, mac2str(priv->mac_addr), 2537 dev_name(&interface->dev), mac2str(priv->mac_addr),
2538 priv->fw_version.major, priv->fw_version.minor, 2538 priv->fw_version.major, priv->fw_version.minor,
2539 priv->fw_version.patch, priv->fw_version.build); 2539 priv->fw_version.patch, priv->fw_version.build);
2540 dev_info(dev, "%s: regulatory domain 0x%02x: %s\n", 2540 dev_info(dev, "%s: regulatory domain 0x%02x: %s\n",
diff --git a/drivers/staging/poch/poch.c b/drivers/staging/poch/poch.c
index 1f14792b917..ec343ef53a8 100644
--- a/drivers/staging/poch/poch.c
+++ b/drivers/staging/poch/poch.c
@@ -1321,7 +1321,7 @@ static int __devinit poch_pci_probe(struct pci_dev *pdev,
1321 } 1321 }
1322 1322
1323 ret = request_irq(pdev->irq, poch_irq_handler, IRQF_SHARED, 1323 ret = request_irq(pdev->irq, poch_irq_handler, IRQF_SHARED,
1324 dev->bus_id, poch_dev); 1324 dev_name(dev), poch_dev);
1325 if (ret) { 1325 if (ret) {
1326 dev_err(dev, "error requesting IRQ %u\n", pdev->irq); 1326 dev_err(dev, "error requesting IRQ %u\n", pdev->irq);
1327 ret = -ENOMEM; 1327 ret = -ENOMEM;
diff --git a/drivers/staging/usbip/stub.h b/drivers/staging/usbip/stub.h
index f541a3a83bd..022d0649ac5 100644
--- a/drivers/staging/usbip/stub.h
+++ b/drivers/staging/usbip/stub.h
@@ -91,5 +91,5 @@ void stub_rx_loop(struct usbip_task *);
91void stub_enqueue_ret_unlink(struct stub_device *, __u32, __u32); 91void stub_enqueue_ret_unlink(struct stub_device *, __u32, __u32);
92 92
93/* stub_main.c */ 93/* stub_main.c */
94int match_busid(char *busid); 94int match_busid(const char *busid);
95void stub_device_cleanup_urbs(struct stub_device *sdev); 95void stub_device_cleanup_urbs(struct stub_device *sdev);
diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c
index ee455a087ea..1e320caf3d1 100644
--- a/drivers/staging/usbip/stub_dev.c
+++ b/drivers/staging/usbip/stub_dev.c
@@ -389,7 +389,7 @@ static int stub_probe(struct usb_interface *interface,
389{ 389{
390 struct usb_device *udev = interface_to_usbdev(interface); 390 struct usb_device *udev = interface_to_usbdev(interface);
391 struct stub_device *sdev = NULL; 391 struct stub_device *sdev = NULL;
392 char *udev_busid = interface->dev.parent->bus_id; 392 const char *udev_busid = dev_name(interface->dev.parent);
393 int err = 0; 393 int err = 0;
394 394
395 dev_dbg(&interface->dev, "Enter\n"); 395 dev_dbg(&interface->dev, "Enter\n");
diff --git a/drivers/staging/usbip/stub_main.c b/drivers/staging/usbip/stub_main.c
index c665d7f1ca9..05e4c606439 100644
--- a/drivers/staging/usbip/stub_main.c
+++ b/drivers/staging/usbip/stub_main.c
@@ -40,11 +40,12 @@ struct kmem_cache *stub_priv_cache;
40 * remote host. 40 * remote host.
41 */ 41 */
42#define MAX_BUSID 16 42#define MAX_BUSID 16
43static char busid_table[MAX_BUSID][BUS_ID_SIZE]; 43#define BUSID_SIZE 20
44static char busid_table[MAX_BUSID][BUSID_SIZE];
44static spinlock_t busid_table_lock; 45static spinlock_t busid_table_lock;
45 46
46 47
47int match_busid(char *busid) 48int match_busid(const char *busid)
48{ 49{
49 int i; 50 int i;
50 51
@@ -52,7 +53,7 @@ int match_busid(char *busid)
52 53
53 for (i = 0; i < MAX_BUSID; i++) 54 for (i = 0; i < MAX_BUSID; i++)
54 if (busid_table[i][0]) 55 if (busid_table[i][0])
55 if (!strncmp(busid_table[i], busid, BUS_ID_SIZE)) { 56 if (!strncmp(busid_table[i], busid, BUSID_SIZE)) {
56 /* already registerd */ 57 /* already registerd */
57 spin_unlock(&busid_table_lock); 58 spin_unlock(&busid_table_lock);
58 return 0; 59 return 0;
@@ -92,7 +93,7 @@ static int add_match_busid(char *busid)
92 93
93 for (i = 0; i < MAX_BUSID; i++) 94 for (i = 0; i < MAX_BUSID; i++)
94 if (!busid_table[i][0]) { 95 if (!busid_table[i][0]) {
95 strncpy(busid_table[i], busid, BUS_ID_SIZE); 96 strncpy(busid_table[i], busid, BUSID_SIZE);
96 spin_unlock(&busid_table_lock); 97 spin_unlock(&busid_table_lock);
97 return 0; 98 return 0;
98 } 99 }
@@ -109,9 +110,9 @@ static int del_match_busid(char *busid)
109 spin_lock(&busid_table_lock); 110 spin_lock(&busid_table_lock);
110 111
111 for (i = 0; i < MAX_BUSID; i++) 112 for (i = 0; i < MAX_BUSID; i++)
112 if (!strncmp(busid_table[i], busid, BUS_ID_SIZE)) { 113 if (!strncmp(busid_table[i], busid, BUSID_SIZE)) {
113 /* found */ 114 /* found */
114 memset(busid_table[i], 0, BUS_ID_SIZE); 115 memset(busid_table[i], 0, BUSID_SIZE);
115 spin_unlock(&busid_table_lock); 116 spin_unlock(&busid_table_lock);
116 return 0; 117 return 0;
117 } 118 }
@@ -125,19 +126,19 @@ static ssize_t store_match_busid(struct device_driver *dev, const char *buf,
125 size_t count) 126 size_t count)
126{ 127{
127 int len; 128 int len;
128 char busid[BUS_ID_SIZE]; 129 char busid[BUSID_SIZE];
129 130
130 if (count < 5) 131 if (count < 5)
131 return -EINVAL; 132 return -EINVAL;
132 133
133 /* strnlen() does not include \0 */ 134 /* strnlen() does not include \0 */
134 len = strnlen(buf + 4, BUS_ID_SIZE); 135 len = strnlen(buf + 4, BUSID_SIZE);
135 136
136 /* busid needs to include \0 termination */ 137 /* busid needs to include \0 termination */
137 if (!(len < BUS_ID_SIZE)) 138 if (!(len < BUSID_SIZE))
138 return -EINVAL; 139 return -EINVAL;
139 140
140 strncpy(busid, buf + 4, BUS_ID_SIZE); 141 strncpy(busid, buf + 4, BUSID_SIZE);
141 142
142 143
143 if (!strncmp(buf, "add ", 4)) { 144 if (!strncmp(buf, "add ", 4)) {
diff --git a/drivers/staging/usbip/stub_rx.c b/drivers/staging/usbip/stub_rx.c
index 36ce898fced..2a2cc0f051c 100644
--- a/drivers/staging/usbip/stub_rx.c
+++ b/drivers/staging/usbip/stub_rx.c
@@ -157,7 +157,7 @@ static int tweak_set_configuration_cmd(struct urb *urb)
157 * A user may need to set a special configuration value before 157 * A user may need to set a special configuration value before
158 * exporting the device. 158 * exporting the device.
159 */ 159 */
160 uinfo("set_configuration (%d) to %s\n", config, urb->dev->dev.bus_id); 160 uinfo("set_configuration (%d) to %s\n", config, dev_name(&urb->dev->dev));
161 uinfo("but, skip!\n"); 161 uinfo("but, skip!\n");
162 162
163 return 0; 163 return 0;
@@ -175,7 +175,7 @@ static int tweak_reset_device_cmd(struct urb *urb)
175 value = le16_to_cpu(req->wValue); 175 value = le16_to_cpu(req->wValue);
176 index = le16_to_cpu(req->wIndex); 176 index = le16_to_cpu(req->wIndex);
177 177
178 uinfo("reset_device (port %d) to %s\n", index, urb->dev->dev.bus_id); 178 uinfo("reset_device (port %d) to %s\n", index, dev_name(&urb->dev->dev));
179 179
180 /* all interfaces should be owned by usbip driver, so just reset it. */ 180 /* all interfaces should be owned by usbip driver, so just reset it. */
181 ret = usb_lock_device_for_reset(urb->dev, NULL); 181 ret = usb_lock_device_for_reset(urb->dev, NULL);
diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
index 5b5a2e348ec..f69ca346aa2 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c
@@ -1091,7 +1091,7 @@ static int vhci_hcd_probe(struct platform_device *pdev)
1091 * Allocate and initialize hcd. 1091 * Allocate and initialize hcd.
1092 * Our private data is also allocated automatically. 1092 * Our private data is also allocated automatically.
1093 */ 1093 */
1094 hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, pdev->dev.bus_id); 1094 hcd = usb_create_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->dev));
1095 if (!hcd) { 1095 if (!hcd) {
1096 uerr("create hcd failed\n"); 1096 uerr("create hcd failed\n");
1097 return -ENOMEM; 1097 return -ENOMEM;
diff --git a/drivers/staging/usbip/vhci_sysfs.c b/drivers/staging/usbip/vhci_sysfs.c
index 24c2851a8f8..0fd33a62d93 100644
--- a/drivers/staging/usbip/vhci_sysfs.c
+++ b/drivers/staging/usbip/vhci_sysfs.c
@@ -60,7 +60,7 @@ static ssize_t show_status(struct device *dev, struct device_attribute *attr,
60 out += sprintf(out, "%03u %08x ", 60 out += sprintf(out, "%03u %08x ",
61 vdev->speed, vdev->devid); 61 vdev->speed, vdev->devid);
62 out += sprintf(out, "%16p ", vdev->ud.tcp_socket); 62 out += sprintf(out, "%16p ", vdev->ud.tcp_socket);
63 out += sprintf(out, "%s", vdev->udev->dev.bus_id); 63 out += sprintf(out, "%s", dev_name(&vdev->udev->dev));
64 64
65 } else 65 } else
66 out += sprintf(out, "000 000 000 0000000000000000 0-0"); 66 out += sprintf(out, "000 000 000 0000000000000000 0-0");