Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kay Sievers and committed by
Greg Kroah-Hartman
e9133972 9f37952a

+19 -18
+1 -1
drivers/staging/at76_usb/at76_usb.c
··· 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",
+1 -1
drivers/staging/poch/poch.c
··· 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;
+1 -1
drivers/staging/usbip/stub.h
··· 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);
+1 -1
drivers/staging/usbip/stub_dev.c
··· 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");
+11 -10
drivers/staging/usbip/stub_main.c
··· 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 ··· 53 52 54 53 for (i = 0; i < MAX_BUSID; i++) 55 54 if (busid_table[i][0]) 56 - if (!strncmp(busid_table[i], busid, BUS_ID_SIZE)) { 55 + if (!strncmp(busid_table[i], busid, BUSID_SIZE)) { 57 56 /* already registerd */ 58 57 spin_unlock(&busid_table_lock); 59 58 return 0; ··· 93 92 94 93 for (i = 0; i < MAX_BUSID; i++) 95 94 if (!busid_table[i][0]) { 96 - strncpy(busid_table[i], busid, BUS_ID_SIZE); 95 + strncpy(busid_table[i], busid, BUSID_SIZE); 97 96 spin_unlock(&busid_table_lock); 98 97 return 0; 99 98 } ··· 110 109 spin_lock(&busid_table_lock); 111 110 112 111 for (i = 0; i < MAX_BUSID; i++) 113 - if (!strncmp(busid_table[i], busid, BUS_ID_SIZE)) { 112 + if (!strncmp(busid_table[i], busid, BUSID_SIZE)) { 114 113 /* found */ 115 - memset(busid_table[i], 0, BUS_ID_SIZE); 114 + memset(busid_table[i], 0, BUSID_SIZE); 116 115 spin_unlock(&busid_table_lock); 117 116 return 0; 118 117 } ··· 126 125 size_t count) 127 126 { 128 127 int len; 129 - char busid[BUS_ID_SIZE]; 128 + char busid[BUSID_SIZE]; 130 129 131 130 if (count < 5) 132 131 return -EINVAL; 133 132 134 133 /* strnlen() does not include \0 */ 135 - len = strnlen(buf + 4, BUS_ID_SIZE); 134 + len = strnlen(buf + 4, BUSID_SIZE); 136 135 137 136 /* busid needs to include \0 termination */ 138 - if (!(len < BUS_ID_SIZE)) 137 + if (!(len < BUSID_SIZE)) 139 138 return -EINVAL; 140 139 141 - strncpy(busid, buf + 4, BUS_ID_SIZE); 140 + strncpy(busid, buf + 4, BUSID_SIZE); 142 141 143 142 144 143 if (!strncmp(buf, "add ", 4)) {
+2 -2
drivers/staging/usbip/stub_rx.c
··· 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 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);
+1 -1
drivers/staging/usbip/vhci_hcd.c
··· 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;
+1 -1
drivers/staging/usbip/vhci_sysfs.c
··· 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");