Commit e913397202b7551299da20fc8cf7b90c46f61ba3

Authored by Kay Sievers
Committed by Greg Kroah-Hartman
1 parent 9f37952aa0

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>

Showing 8 changed files with 19 additions and 18 deletions Side-by-side Diff

drivers/staging/at76_usb/at76_usb.c
... ... @@ -2534,7 +2534,7 @@
2534 2534  
2535 2535 dev_info(dev, "%s: USB %s, MAC %s, firmware %d.%d.%d-%d\n",
2536 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 2538 priv->fw_version.major, priv->fw_version.minor,
2539 2539 priv->fw_version.patch, priv->fw_version.build);
2540 2540 dev_info(dev, "%s: regulatory domain 0x%02x: %s\n",
drivers/staging/poch/poch.c
... ... @@ -1321,7 +1321,7 @@
1321 1321 }
1322 1322  
1323 1323 ret = request_irq(pdev->irq, poch_irq_handler, IRQF_SHARED,
1324   - dev->bus_id, poch_dev);
  1324 + dev_name(dev), poch_dev);
1325 1325 if (ret) {
1326 1326 dev_err(dev, "error requesting IRQ %u\n", pdev->irq);
1327 1327 ret = -ENOMEM;
drivers/staging/usbip/stub.h
... ... @@ -91,6 +91,6 @@
91 91 void stub_enqueue_ret_unlink(struct stub_device *, __u32, __u32);
92 92  
93 93 /* stub_main.c */
94   -int match_busid(char *busid);
  94 +int match_busid(const char *busid);
95 95 void stub_device_cleanup_urbs(struct stub_device *sdev);
drivers/staging/usbip/stub_dev.c
... ... @@ -389,7 +389,7 @@
389 389 {
390 390 struct usb_device *udev = interface_to_usbdev(interface);
391 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 393 int err = 0;
394 394  
395 395 dev_dbg(&interface->dev, "Enter\n");
drivers/staging/usbip/stub_main.c
... ... @@ -40,11 +40,12 @@
40 40 * remote host.
41 41 */
42 42 #define MAX_BUSID 16
43   -static char busid_table[MAX_BUSID][BUS_ID_SIZE];
  43 +#define BUSID_SIZE 20
  44 +static char busid_table[MAX_BUSID][BUSID_SIZE];
44 45 static spinlock_t busid_table_lock;
45 46  
46 47  
47   -int match_busid(char *busid)
  48 +int match_busid(const char *busid)
48 49 {
49 50 int i;
50 51  
... ... @@ -52,7 +53,7 @@
52 53  
53 54 for (i = 0; i < MAX_BUSID; i++)
54 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 57 /* already registerd */
57 58 spin_unlock(&busid_table_lock);
58 59 return 0;
... ... @@ -92,7 +93,7 @@
92 93  
93 94 for (i = 0; i < MAX_BUSID; i++)
94 95 if (!busid_table[i][0]) {
95   - strncpy(busid_table[i], busid, BUS_ID_SIZE);
  96 + strncpy(busid_table[i], busid, BUSID_SIZE);
96 97 spin_unlock(&busid_table_lock);
97 98 return 0;
98 99 }
99 100  
... ... @@ -109,9 +110,9 @@
109 110 spin_lock(&busid_table_lock);
110 111  
111 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 114 /* found */
114   - memset(busid_table[i], 0, BUS_ID_SIZE);
  115 + memset(busid_table[i], 0, BUSID_SIZE);
115 116 spin_unlock(&busid_table_lock);
116 117 return 0;
117 118 }
118 119  
119 120  
120 121  
... ... @@ -125,19 +126,19 @@
125 126 size_t count)
126 127 {
127 128 int len;
128   - char busid[BUS_ID_SIZE];
  129 + char busid[BUSID_SIZE];
129 130  
130 131 if (count < 5)
131 132 return -EINVAL;
132 133  
133 134 /* strnlen() does not include \0 */
134   - len = strnlen(buf + 4, BUS_ID_SIZE);
  135 + len = strnlen(buf + 4, BUSID_SIZE);
135 136  
136 137 /* busid needs to include \0 termination */
137   - if (!(len < BUS_ID_SIZE))
  138 + if (!(len < BUSID_SIZE))
138 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 144 if (!strncmp(buf, "add ", 4)) {
drivers/staging/usbip/stub_rx.c
... ... @@ -157,7 +157,7 @@
157 157 * A user may need to set a special configuration value before
158 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 161 uinfo("but, skip!\n");
162 162  
163 163 return 0;
... ... @@ -175,7 +175,7 @@
175 175 value = le16_to_cpu(req->wValue);
176 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 180 /* all interfaces should be owned by usbip driver, so just reset it. */
181 181 ret = usb_lock_device_for_reset(urb->dev, NULL);
drivers/staging/usbip/vhci_hcd.c
... ... @@ -1091,7 +1091,7 @@
1091 1091 * Allocate and initialize hcd.
1092 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 1095 if (!hcd) {
1096 1096 uerr("create hcd failed\n");
1097 1097 return -ENOMEM;
drivers/staging/usbip/vhci_sysfs.c
... ... @@ -60,7 +60,7 @@
60 60 out += sprintf(out, "%03u %08x ",
61 61 vdev->speed, vdev->devid);
62 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 65 } else
66 66 out += sprintf(out, "000 000 000 0000000000000000 0-0");