Commit 71610f55fa4db63dbf5385929a47c9fb2451f332

Authored by Kay Sievers
Committed by James Bottomley
1 parent b58602a4ba

[SCSI] struct device - replace bus_id with dev_name(), dev_set_name()

[jejb: limit ioctl to returning 20 characters to avoid overrun
       on long device names and add a few more conversions]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

Showing 26 changed files with 79 additions and 81 deletions Side-by-side Diff

drivers/misc/enclosure.c
... ... @@ -119,7 +119,7 @@
119 119 edev->edev.class = &enclosure_class;
120 120 edev->edev.parent = get_device(dev);
121 121 edev->cb = cb;
122   - snprintf(edev->edev.bus_id, BUS_ID_SIZE, "%s", name);
  122 + dev_set_name(&edev->edev, name);
123 123 err = device_register(&edev->edev);
124 124 if (err)
125 125 goto err;
... ... @@ -170,7 +170,7 @@
170 170 static void enclosure_link_name(struct enclosure_component *cdev, char *name)
171 171 {
172 172 strcpy(name, "enclosure_device:");
173   - strcat(name, cdev->cdev.bus_id);
  173 + strcat(name, dev_name(&cdev->cdev));
174 174 }
175 175  
176 176 static void enclosure_remove_links(struct enclosure_component *cdev)
177 177  
... ... @@ -256,9 +256,9 @@
256 256 cdev = &ecomp->cdev;
257 257 cdev->parent = get_device(&edev->edev);
258 258 if (name)
259   - snprintf(cdev->bus_id, BUS_ID_SIZE, "%s", name);
  259 + dev_set_name(cdev, name);
260 260 else
261   - snprintf(cdev->bus_id, BUS_ID_SIZE, "%u", number);
  261 + dev_set_name(cdev, "%u", number);
262 262  
263 263 cdev->release = enclosure_component_release;
264 264 cdev->groups = enclosure_groups;
drivers/scsi/NCR_D700.c
... ... @@ -318,7 +318,7 @@
318 318 return -ENOMEM;
319 319  
320 320 p->dev = dev;
321   - snprintf(p->name, sizeof(p->name), "D700(%s)", dev->bus_id);
  321 + snprintf(p->name, sizeof(p->name), "D700(%s)", dev_name(dev));
322 322 if (request_irq(irq, NCR_D700_intr, IRQF_SHARED, p->name, p)) {
323 323 printk(KERN_ERR "D700: request_irq failed\n");
324 324 kfree(p);
drivers/scsi/advansys.c
... ... @@ -2527,7 +2527,7 @@
2527 2527 {
2528 2528 struct asc_board *boardp = shost_priv(s);
2529 2529  
2530   - printk("Scsi_Host at addr 0x%p, device %s\n", s, boardp->dev->bus_id);
  2530 + printk("Scsi_Host at addr 0x%p, device %s\n", s, dev_name(boardp->dev));
2531 2531 printk(" host_busy %u, host_no %d, last_reset %d,\n",
2532 2532 s->host_busy, s->host_no, (unsigned)s->last_reset);
2533 2533  
drivers/scsi/aic94xx/aic94xx_tmf.c
... ... @@ -189,7 +189,7 @@
189 189 asd_clear_nexus_I_T(dev, NEXUS_PHASE_PRE);
190 190 /* send a hard reset */
191 191 ASD_DPRINTK("sending %s reset to %s\n",
192   - reset_type ? "hard" : "soft", phy->dev.bus_id);
  192 + reset_type ? "hard" : "soft", dev_name(&phy->dev));
193 193 res = sas_phy_reset(phy, reset_type);
194 194 if (res == TMF_RESP_FUNC_COMPLETE) {
195 195 /* wait for the maximum settle time */
drivers/scsi/hosts.c
... ... @@ -388,8 +388,7 @@
388 388 shost->dma_boundary = 0xffffffff;
389 389  
390 390 device_initialize(&shost->shost_gendev);
391   - snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d",
392   - shost->host_no);
  391 + dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
393 392 #ifndef CONFIG_SYSFS_DEPRECATED
394 393 shost->shost_gendev.bus = &scsi_bus_type;
395 394 #endif
... ... @@ -398,8 +397,7 @@
398 397 device_initialize(&shost->shost_dev);
399 398 shost->shost_dev.parent = &shost->shost_gendev;
400 399 shost->shost_dev.class = &shost_class;
401   - snprintf(shost->shost_dev.bus_id, BUS_ID_SIZE, "host%d",
402   - shost->host_no);
  400 + dev_set_name(&shost->shost_dev, "host%d", shost->host_no);
403 401 shost->shost_dev.groups = scsi_sysfs_shost_attr_groups;
404 402  
405 403 shost->ehandler = kthread_run(scsi_error_handler, shost,
drivers/scsi/ibmvscsi/ibmvfc.c
... ... @@ -1145,10 +1145,10 @@
1145 1145 login_info->async.len = vhost->async_crq.size * sizeof(*vhost->async_crq.msgs);
1146 1146 strncpy(login_info->partition_name, vhost->partition_name, IBMVFC_MAX_NAME);
1147 1147 strncpy(login_info->device_name,
1148   - vhost->host->shost_gendev.bus_id, IBMVFC_MAX_NAME);
  1148 + dev_name(&vhost->host->shost_gendev), IBMVFC_MAX_NAME);
1149 1149  
1150 1150 location = of_get_property(of_node, "ibm,loc-code", NULL);
1151   - location = location ? location : vhost->dev->bus_id;
  1151 + location = location ? location : dev_name(vhost->dev);
1152 1152 strncpy(login_info->drc_name, location, IBMVFC_MAX_NAME);
1153 1153 }
1154 1154  
... ... @@ -2184,7 +2184,7 @@
2184 2184 sizeof(struct ipr_dump_entry_header);
2185 2185 driver_dump->location_entry.hdr.data_type = IPR_DUMP_DATA_TYPE_ASCII;
2186 2186 driver_dump->location_entry.hdr.id = IPR_DUMP_LOCATION_ID;
2187   - strcpy(driver_dump->location_entry.location, ioa_cfg->pdev->dev.bus_id);
  2187 + strcpy(driver_dump->location_entry.location, dev_name(&ioa_cfg->pdev->dev));
2188 2188 driver_dump->hdr.num_entries++;
2189 2189 }
2190 2190  
... ... @@ -1272,7 +1272,7 @@
1272 1272  
1273 1273 struct ipr_dump_location_entry {
1274 1274 struct ipr_dump_entry_header hdr;
1275   - u8 location[BUS_ID_SIZE];
  1275 + u8 location[20];
1276 1276 }__attribute__((packed));
1277 1277  
1278 1278 struct ipr_dump_trace_entry {
drivers/scsi/lasi700.c
... ... @@ -103,8 +103,7 @@
103 103  
104 104 hostdata = kzalloc(sizeof(*hostdata), GFP_KERNEL);
105 105 if (!hostdata) {
106   - printk(KERN_ERR "%s: Failed to allocate host data\n",
107   - dev->dev.bus_id);
  106 + dev_printk(KERN_ERR, dev, "Failed to allocate host data\n");
108 107 return -ENOMEM;
109 108 }
110 109  
drivers/scsi/libsas/sas_discover.c
... ... @@ -169,7 +169,7 @@
169 169 if (res) {
170 170 printk("sas: driver on pcidev %s cannot handle "
171 171 "device %llx, error:%d\n",
172   - sas_ha->dev->bus_id,
  172 + dev_name(sas_ha->dev),
173 173 SAS_ADDR(dev->sas_addr), res);
174 174 }
175 175 }
drivers/scsi/libsas/sas_dump.c
... ... @@ -56,7 +56,7 @@
56 56  
57 57 void sas_dprint_hae(struct sas_ha_struct *sas_ha, enum ha_event he)
58 58 {
59   - SAS_DPRINTK("ha %s: %s event\n", sas_ha->dev->bus_id,
  59 + SAS_DPRINTK("ha %s: %s event\n", dev_name(sas_ha->dev),
60 60 sas_hae_str[he]);
61 61 }
62 62  
drivers/scsi/libsas/sas_port.c
... ... @@ -113,7 +113,7 @@
113 113 sas_port_add_phy(port->port, phy->phy);
114 114  
115 115 SAS_DPRINTK("%s added to %s, phy_mask:0x%x (%16llx)\n",
116   - phy->phy->dev.bus_id,port->port->dev.bus_id,
  116 + dev_name(&phy->phy->dev), dev_name(&port->port->dev),
117 117 port->phy_mask,
118 118 SAS_ADDR(port->attached_sas_addr));
119 119  
drivers/scsi/raid_class.c
... ... @@ -237,8 +237,7 @@
237 237 rc->dev.parent = get_device(component_dev);
238 238 rc->num = rd->component_count++;
239 239  
240   - snprintf(rc->dev.bus_id, sizeof(rc->dev.bus_id),
241   - "component-%d", rc->num);
  240 + dev_set_name(&rc->dev, "component-%d", rc->num);
242 241 list_add_tail(&rc->node, &rd->component_list);
243 242 rc->dev.class = &raid_class.class;
244 243 err = device_add(&rc->dev);
drivers/scsi/scsi_debug.c
... ... @@ -2508,7 +2508,7 @@
2508 2508 }
2509 2509  
2510 2510 static struct device pseudo_primary = {
2511   - .bus_id = "pseudo_0",
  2511 + .init_name = "pseudo_0",
2512 2512 .release = pseudo_0_release,
2513 2513 };
2514 2514  
... ... @@ -2680,7 +2680,7 @@
2680 2680 sdbg_host->dev.bus = &pseudo_lld_bus;
2681 2681 sdbg_host->dev.parent = &pseudo_primary;
2682 2682 sdbg_host->dev.release = &sdebug_release_adapter;
2683   - sprintf(sdbg_host->dev.bus_id, "adapter%d", scsi_debug_add_host);
  2683 + dev_set_name(&sdbg_host->dev, "adapter%d", scsi_debug_add_host);
2684 2684  
2685 2685 error = device_register(&sdbg_host->dev);
2686 2686  
drivers/scsi/scsi_ioctl.c
... ... @@ -167,10 +167,17 @@
167 167 static int scsi_ioctl_get_pci(struct scsi_device *sdev, void __user *arg)
168 168 {
169 169 struct device *dev = scsi_get_device(sdev->host);
  170 + const char *name;
170 171  
171 172 if (!dev)
172 173 return -ENXIO;
173   - return copy_to_user(arg, dev->bus_id, sizeof(dev->bus_id))? -EFAULT: 0;
  174 +
  175 + name = dev_name(dev);
  176 +
  177 + /* compatibility with old ioctl which only returned
  178 + * 20 characters */
  179 + return copy_to_user(arg, name, min(strlen(name), (size_t)20))
  180 + ? -EFAULT: 0;
174 181 }
175 182  
176 183  
drivers/scsi/scsi_scan.c
... ... @@ -411,8 +411,7 @@
411 411 device_initialize(dev);
412 412 starget->reap_ref = 1;
413 413 dev->parent = get_device(parent);
414   - sprintf(dev->bus_id, "target%d:%d:%d",
415   - shost->host_no, channel, id);
  414 + dev_set_name(dev, "target%d:%d:%d", shost->host_no, channel, id);
416 415 #ifndef CONFIG_SYSFS_DEPRECATED
417 416 dev->bus = &scsi_bus_type;
418 417 #endif
... ... @@ -1021,7 +1020,7 @@
1021 1020 if (rescan || !scsi_device_created(sdev)) {
1022 1021 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO
1023 1022 "scsi scan: device exists on %s\n",
1024   - sdev->sdev_gendev.bus_id));
  1023 + dev_name(&sdev->sdev_gendev)));
1025 1024 if (sdevp)
1026 1025 *sdevp = sdev;
1027 1026 else
... ... @@ -1160,7 +1159,7 @@
1160 1159 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
1161 1160  
1162 1161 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: Sequential scan of"
1163   - "%s\n", starget->dev.bus_id));
  1162 + "%s\n", dev_name(&starget->dev)));
1164 1163  
1165 1164 max_dev_lun = min(max_scsi_luns, shost->max_lun);
1166 1165 /*
drivers/scsi/scsi_sysfs.c
... ... @@ -1079,16 +1079,14 @@
1079 1079 device_initialize(&sdev->sdev_gendev);
1080 1080 sdev->sdev_gendev.bus = &scsi_bus_type;
1081 1081 sdev->sdev_gendev.type = &scsi_dev_type;
1082   - sprintf(sdev->sdev_gendev.bus_id,"%d:%d:%d:%d",
1083   - sdev->host->host_no, sdev->channel, sdev->id,
1084   - sdev->lun);
1085   -
  1082 + dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%d",
  1083 + sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
  1084 +
1086 1085 device_initialize(&sdev->sdev_dev);
1087 1086 sdev->sdev_dev.parent = &sdev->sdev_gendev;
1088 1087 sdev->sdev_dev.class = &sdev_class;
1089   - snprintf(sdev->sdev_dev.bus_id, BUS_ID_SIZE,
1090   - "%d:%d:%d:%d", sdev->host->host_no,
1091   - sdev->channel, sdev->id, sdev->lun);
  1088 + dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%d",
  1089 + sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
1092 1090 sdev->scsi_level = starget->scsi_level;
1093 1091 transport_setup_device(&sdev->sdev_gendev);
1094 1092 spin_lock_irqsave(shost->host_lock, flags);
drivers/scsi/scsi_transport_fc.c
... ... @@ -2486,8 +2486,8 @@
2486 2486 device_initialize(dev); /* takes self reference */
2487 2487 dev->parent = get_device(&shost->shost_gendev); /* parent reference */
2488 2488 dev->release = fc_rport_dev_release;
2489   - sprintf(dev->bus_id, "rport-%d:%d-%d",
2490   - shost->host_no, channel, rport->number);
  2489 + dev_set_name(dev, "rport-%d:%d-%d",
  2490 + shost->host_no, channel, rport->number);
2491 2491 transport_setup_device(dev);
2492 2492  
2493 2493 error = device_add(dev);
... ... @@ -3164,8 +3164,8 @@
3164 3164 device_initialize(dev); /* takes self reference */
3165 3165 dev->parent = get_device(pdev); /* takes parent reference */
3166 3166 dev->release = fc_vport_dev_release;
3167   - sprintf(dev->bus_id, "vport-%d:%d-%d",
3168   - shost->host_no, channel, vport->number);
  3167 + dev_set_name(dev, "vport-%d:%d-%d",
  3168 + shost->host_no, channel, vport->number);
3169 3169 transport_setup_device(dev);
3170 3170  
3171 3171 error = device_add(dev);
3172 3172  
3173 3173  
... ... @@ -3188,19 +3188,19 @@
3188 3188 */
3189 3189 if (pdev != &shost->shost_gendev) {
3190 3190 error = sysfs_create_link(&shost->shost_gendev.kobj,
3191   - &dev->kobj, dev->bus_id);
  3191 + &dev->kobj, dev_name(dev));
3192 3192 if (error)
3193 3193 printk(KERN_ERR
3194 3194 "%s: Cannot create vport symlinks for "
3195 3195 "%s, err=%d\n",
3196   - __func__, dev->bus_id, error);
  3196 + __func__, dev_name(dev), error);
3197 3197 }
3198 3198 spin_lock_irqsave(shost->host_lock, flags);
3199 3199 vport->flags &= ~FC_VPORT_CREATING;
3200 3200 spin_unlock_irqrestore(shost->host_lock, flags);
3201 3201  
3202 3202 dev_printk(KERN_NOTICE, pdev,
3203   - "%s created via shost%d channel %d\n", dev->bus_id,
  3203 + "%s created via shost%d channel %d\n", dev_name(dev),
3204 3204 shost->host_no, channel);
3205 3205  
3206 3206 *ret_vport = vport;
... ... @@ -3297,7 +3297,7 @@
3297 3297 return stat;
3298 3298  
3299 3299 if (dev->parent != &shost->shost_gendev)
3300   - sysfs_remove_link(&shost->shost_gendev.kobj, dev->bus_id);
  3300 + sysfs_remove_link(&shost->shost_gendev.kobj, dev_name(dev));
3301 3301 transport_remove_device(dev);
3302 3302 device_del(dev);
3303 3303 transport_destroy_device(dev);
... ... @@ -3329,7 +3329,7 @@
3329 3329 dev_printk(KERN_ERR, vport->dev.parent,
3330 3330 "%s: %s could not be deleted created via "
3331 3331 "shost%d channel %d - error %d\n", __func__,
3332   - vport->dev.bus_id, vport->shost->host_no,
  3332 + dev_name(&vport->dev), vport->shost->host_no,
3333 3333 vport->channel, stat);
3334 3334 }
3335 3335  
drivers/scsi/scsi_transport_iscsi.c
... ... @@ -187,8 +187,7 @@
187 187  
188 188 ep->id = id;
189 189 ep->dev.class = &iscsi_endpoint_class;
190   - snprintf(ep->dev.bus_id, BUS_ID_SIZE, "ep-%llu",
191   - (unsigned long long) id);
  190 + dev_set_name(&ep->dev, "ep-%llu", (unsigned long long) id);
192 191 err = device_register(&ep->dev);
193 192 if (err)
194 193 goto free_ep;
... ... @@ -724,8 +723,7 @@
724 723 }
725 724 session->target_id = id;
726 725  
727   - snprintf(session->dev.bus_id, BUS_ID_SIZE, "session%u",
728   - session->sid);
  726 + dev_set_name(&session->dev, "session%u", session->sid);
729 727 err = device_add(&session->dev);
730 728 if (err) {
731 729 iscsi_cls_session_printk(KERN_ERR, session,
... ... @@ -898,8 +896,7 @@
898 896 if (!get_device(&session->dev))
899 897 goto free_conn;
900 898  
901   - snprintf(conn->dev.bus_id, BUS_ID_SIZE, "connection%d:%u",
902   - session->sid, cid);
  899 + dev_set_name(&conn->dev, "connection%d:%u", session->sid, cid);
903 900 conn->dev.parent = &session->dev;
904 901 conn->dev.release = iscsi_conn_release;
905 902 err = device_register(&conn->dev);
... ... @@ -1816,7 +1813,7 @@
1816 1813 priv->t.create_work_queue = 1;
1817 1814  
1818 1815 priv->dev.class = &iscsi_transport_class;
1819   - snprintf(priv->dev.bus_id, BUS_ID_SIZE, "%s", tt->name);
  1816 + dev_set_name(&priv->dev, "%s", tt->name);
1820 1817 err = device_register(&priv->dev);
1821 1818 if (err)
1822 1819 goto free_priv;
drivers/scsi/scsi_transport_sas.c
... ... @@ -207,7 +207,7 @@
207 207 struct request_queue *q;
208 208 int error;
209 209 struct device *dev;
210   - char namebuf[BUS_ID_SIZE];
  210 + char namebuf[20];
211 211 const char *name;
212 212 void (*release)(struct device *);
213 213  
... ... @@ -219,7 +219,7 @@
219 219 if (rphy) {
220 220 q = blk_init_queue(sas_non_host_smp_request, NULL);
221 221 dev = &rphy->dev;
222   - name = dev->bus_id;
  222 + name = dev_name(dev);
223 223 release = NULL;
224 224 } else {
225 225 q = blk_init_queue(sas_host_smp_request, NULL);
226 226  
... ... @@ -629,10 +629,10 @@
629 629 INIT_LIST_HEAD(&phy->port_siblings);
630 630 if (scsi_is_sas_expander_device(parent)) {
631 631 struct sas_rphy *rphy = dev_to_rphy(parent);
632   - sprintf(phy->dev.bus_id, "phy-%d:%d:%d", shost->host_no,
  632 + dev_set_name(&phy->dev, "phy-%d:%d:%d", shost->host_no,
633 633 rphy->scsi_target_id, number);
634 634 } else
635   - sprintf(phy->dev.bus_id, "phy-%d:%d", shost->host_no, number);
  635 + dev_set_name(&phy->dev, "phy-%d:%d", shost->host_no, number);
636 636  
637 637 transport_setup_device(&phy->dev);
638 638  
... ... @@ -770,7 +770,7 @@
770 770 int res;
771 771  
772 772 res = sysfs_create_link(&port->dev.kobj, &phy->dev.kobj,
773   - phy->dev.bus_id);
  773 + dev_name(&phy->dev));
774 774 if (res)
775 775 goto err;
776 776 res = sysfs_create_link(&phy->dev.kobj, &port->dev.kobj, "port");
... ... @@ -785,7 +785,7 @@
785 785 static void sas_port_delete_link(struct sas_port *port,
786 786 struct sas_phy *phy)
787 787 {
788   - sysfs_remove_link(&port->dev.kobj, phy->dev.bus_id);
  788 + sysfs_remove_link(&port->dev.kobj, dev_name(&phy->dev));
789 789 sysfs_remove_link(&phy->dev.kobj, "port");
790 790 }
791 791  
792 792  
... ... @@ -821,11 +821,11 @@
821 821  
822 822 if (scsi_is_sas_expander_device(parent)) {
823 823 struct sas_rphy *rphy = dev_to_rphy(parent);
824   - sprintf(port->dev.bus_id, "port-%d:%d:%d", shost->host_no,
825   - rphy->scsi_target_id, port->port_identifier);
  824 + dev_set_name(&port->dev, "port-%d:%d:%d", shost->host_no,
  825 + rphy->scsi_target_id, port->port_identifier);
826 826 } else
827   - sprintf(port->dev.bus_id, "port-%d:%d", shost->host_no,
828   - port->port_identifier);
  827 + dev_set_name(&port->dev, "port-%d:%d", shost->host_no,
  828 + port->port_identifier);
829 829  
830 830 transport_setup_device(&port->dev);
831 831  
... ... @@ -935,7 +935,7 @@
935 935 if (port->is_backlink) {
936 936 struct device *parent = port->dev.parent;
937 937  
938   - sysfs_remove_link(&port->dev.kobj, parent->bus_id);
  938 + sysfs_remove_link(&port->dev.kobj, dev_name(parent));
939 939 port->is_backlink = 0;
940 940 }
941 941  
... ... @@ -984,7 +984,8 @@
984 984 /* If this trips, you added a phy that was already
985 985 * part of a different port */
986 986 if (unlikely(tmp != phy)) {
987   - dev_printk(KERN_ERR, &port->dev, "trying to add phy %s fails: it's already part of another port\n", phy->dev.bus_id);
  987 + dev_printk(KERN_ERR, &port->dev, "trying to add phy %s fails: it's already part of another port\n",
  988 + dev_name(&phy->dev));
988 989 BUG();
989 990 }
990 991 } else {
... ... @@ -1023,7 +1024,7 @@
1023 1024 return;
1024 1025 port->is_backlink = 1;
1025 1026 res = sysfs_create_link(&port->dev.kobj, &parent->kobj,
1026   - parent->bus_id);
  1027 + dev_name(parent));
1027 1028 if (res)
1028 1029 goto err;
1029 1030 return;
1030 1031  
... ... @@ -1367,11 +1368,12 @@
1367 1368 rdev->rphy.dev.release = sas_end_device_release;
1368 1369 if (scsi_is_sas_expander_device(parent->dev.parent)) {
1369 1370 struct sas_rphy *rphy = dev_to_rphy(parent->dev.parent);
1370   - sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d:%d",
1371   - shost->host_no, rphy->scsi_target_id, parent->port_identifier);
  1371 + dev_set_name(&rdev->rphy.dev, "end_device-%d:%d:%d",
  1372 + shost->host_no, rphy->scsi_target_id,
  1373 + parent->port_identifier);
1372 1374 } else
1373   - sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d",
1374   - shost->host_no, parent->port_identifier);
  1375 + dev_set_name(&rdev->rphy.dev, "end_device-%d:%d",
  1376 + shost->host_no, parent->port_identifier);
1375 1377 rdev->rphy.identify.device_type = SAS_END_DEVICE;
1376 1378 sas_rphy_initialize(&rdev->rphy);
1377 1379 transport_setup_device(&rdev->rphy.dev);
... ... @@ -1411,8 +1413,8 @@
1411 1413 mutex_lock(&sas_host->lock);
1412 1414 rdev->rphy.scsi_target_id = sas_host->next_expander_id++;
1413 1415 mutex_unlock(&sas_host->lock);
1414   - sprintf(rdev->rphy.dev.bus_id, "expander-%d:%d",
1415   - shost->host_no, rdev->rphy.scsi_target_id);
  1416 + dev_set_name(&rdev->rphy.dev, "expander-%d:%d",
  1417 + shost->host_no, rdev->rphy.scsi_target_id);
1416 1418 rdev->rphy.identify.device_type = type;
1417 1419 sas_rphy_initialize(&rdev->rphy);
1418 1420 transport_setup_device(&rdev->rphy.dev);
... ... @@ -1445,7 +1447,7 @@
1445 1447 transport_add_device(&rphy->dev);
1446 1448 transport_configure_device(&rphy->dev);
1447 1449 if (sas_bsg_initialize(shost, rphy))
1448   - printk("fail to a bsg device %s\n", rphy->dev.bus_id);
  1450 + printk("fail to a bsg device %s\n", dev_name(&rphy->dev));
1449 1451  
1450 1452  
1451 1453 mutex_lock(&sas_host->lock);
drivers/scsi/scsi_transport_srp.c
... ... @@ -212,7 +212,7 @@
212 212 rport->roles = ids->roles;
213 213  
214 214 id = atomic_inc_return(&to_srp_host_attrs(shost)->next_port_id);
215   - sprintf(rport->dev.bus_id, "port-%d:%d", shost->host_no, id);
  215 + dev_set_name(&rport->dev, "port-%d:%d", shost->host_no, id);
216 216  
217 217 transport_setup_device(&rport->dev);
218 218  
... ... @@ -1876,7 +1876,7 @@
1876 1876 device_initialize(&sdkp->dev);
1877 1877 sdkp->dev.parent = &sdp->sdev_gendev;
1878 1878 sdkp->dev.class = &sd_disk_class;
1879   - strncpy(sdkp->dev.bus_id, sdp->sdev_gendev.bus_id, BUS_ID_SIZE);
  1879 + dev_set_name(&sdkp->dev, dev_name(&sdp->sdev_gendev));
1880 1880  
1881 1881 if (device_add(&sdkp->dev))
1882 1882 goto out_free_index;
... ... @@ -526,7 +526,7 @@
526 526 if (!scomp)
527 527 goto err_free;
528 528  
529   - edev = enclosure_register(cdev->parent, sdev->sdev_gendev.bus_id,
  529 + edev = enclosure_register(cdev->parent, dev_name(&sdev->sdev_gendev),
530 530 components, &ses_enclosure_callbacks);
531 531 if (IS_ERR(edev)) {
532 532 err = PTR_ERR(edev);
drivers/scsi/sim710.c
... ... @@ -102,7 +102,7 @@
102 102 struct NCR_700_Host_Parameters *hostdata =
103 103 kzalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
104 104  
105   - printk(KERN_NOTICE "sim710: %s\n", dev->bus_id);
  105 + printk(KERN_NOTICE "sim710: %s\n", dev_name(dev));
106 106 printk(KERN_NOTICE "sim710: irq = %d, clock = %d, base = 0x%lx, scsi_id = %d\n",
107 107 irq, clock, base_addr, scsi_id);
108 108  
... ... @@ -305,7 +305,7 @@
305 305 scsi_id = ffs(val) - 1;
306 306  
307 307 if(scsi_id > 7 || (val & ~(1<<scsi_id)) != 0) {
308   - printk(KERN_ERR "sim710.c, EISA card %s has incorrect scsi_id, setting to 7\n", dev->bus_id);
  308 + printk(KERN_ERR "sim710.c, EISA card %s has incorrect scsi_id, setting to 7\n", dev_name(dev));
309 309 scsi_id = 7;
310 310 }
311 311 } else {
drivers/scsi/sni_53c710.c
... ... @@ -78,8 +78,7 @@
78 78 base = res->start;
79 79 hostdata = kzalloc(sizeof(*hostdata), GFP_KERNEL);
80 80 if (!hostdata) {
81   - printk(KERN_ERR "%s: Failed to allocate host data\n",
82   - dev->dev.bus_id);
  81 + dev_printk(KERN_ERR, dev, "Failed to allocate host data\n");
83 82 return -ENOMEM;
84 83 }
85 84  
drivers/scsi/zalon.c
... ... @@ -137,8 +137,8 @@
137 137 goto fail;
138 138  
139 139 if (request_irq(dev->irq, ncr53c8xx_intr, IRQF_SHARED, "zalon", host)) {
140   - printk(KERN_ERR "%s: irq problem with %d, detaching\n ",
141   - dev->dev.bus_id, dev->irq);
  140 + dev_printk(KERN_ERR, dev, "irq problem with %d, detaching\n ",
  141 + dev->irq);
142 142 goto fail;
143 143 }
144 144