aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/enclosure.c8
-rw-r--r--drivers/scsi/NCR_D700.c2
-rw-r--r--drivers/scsi/advansys.c2
-rw-r--r--drivers/scsi/aic94xx/aic94xx_tmf.c2
-rw-r--r--drivers/scsi/hosts.c6
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c4
-rw-r--r--drivers/scsi/ipr.c2
-rw-r--r--drivers/scsi/ipr.h2
-rw-r--r--drivers/scsi/lasi700.c3
-rw-r--r--drivers/scsi/libsas/sas_discover.c2
-rw-r--r--drivers/scsi/libsas/sas_dump.c2
-rw-r--r--drivers/scsi/libsas/sas_port.c2
-rw-r--r--drivers/scsi/raid_class.c3
-rw-r--r--drivers/scsi/scsi_debug.c4
-rw-r--r--drivers/scsi/scsi_ioctl.c9
-rw-r--r--drivers/scsi/scsi_scan.c7
-rw-r--r--drivers/scsi/scsi_sysfs.c12
-rw-r--r--drivers/scsi/scsi_transport_fc.c18
-rw-r--r--drivers/scsi/scsi_transport_iscsi.c11
-rw-r--r--drivers/scsi/scsi_transport_sas.c42
-rw-r--r--drivers/scsi/scsi_transport_srp.c2
-rw-r--r--drivers/scsi/sd.c2
-rw-r--r--drivers/scsi/ses.c2
-rw-r--r--drivers/scsi/sim710.c4
-rw-r--r--drivers/scsi/sni_53c710.c3
-rw-r--r--drivers/scsi/zalon.c4
26 files changed, 79 insertions, 81 deletions
diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c
index 0736cff9d97a..3cf61ece71d7 100644
--- a/drivers/misc/enclosure.c
+++ b/drivers/misc/enclosure.c
@@ -119,7 +119,7 @@ enclosure_register(struct device *dev, const char *name, int components,
119 edev->edev.class = &enclosure_class; 119 edev->edev.class = &enclosure_class;
120 edev->edev.parent = get_device(dev); 120 edev->edev.parent = get_device(dev);
121 edev->cb = cb; 121 edev->cb = cb;
122 snprintf(edev->edev.bus_id, BUS_ID_SIZE, "%s", name); 122 dev_set_name(&edev->edev, name);
123 err = device_register(&edev->edev); 123 err = device_register(&edev->edev);
124 if (err) 124 if (err)
125 goto err; 125 goto err;
@@ -170,7 +170,7 @@ EXPORT_SYMBOL_GPL(enclosure_unregister);
170static void enclosure_link_name(struct enclosure_component *cdev, char *name) 170static void enclosure_link_name(struct enclosure_component *cdev, char *name)
171{ 171{
172 strcpy(name, "enclosure_device:"); 172 strcpy(name, "enclosure_device:");
173 strcat(name, cdev->cdev.bus_id); 173 strcat(name, dev_name(&cdev->cdev));
174} 174}
175 175
176static void enclosure_remove_links(struct enclosure_component *cdev) 176static void enclosure_remove_links(struct enclosure_component *cdev)
@@ -256,9 +256,9 @@ enclosure_component_register(struct enclosure_device *edev,
256 cdev = &ecomp->cdev; 256 cdev = &ecomp->cdev;
257 cdev->parent = get_device(&edev->edev); 257 cdev->parent = get_device(&edev->edev);
258 if (name) 258 if (name)
259 snprintf(cdev->bus_id, BUS_ID_SIZE, "%s", name); 259 dev_set_name(cdev, name);
260 else 260 else
261 snprintf(cdev->bus_id, BUS_ID_SIZE, "%u", number); 261 dev_set_name(cdev, "%u", number);
262 262
263 cdev->release = enclosure_component_release; 263 cdev->release = enclosure_component_release;
264 cdev->groups = enclosure_groups; 264 cdev->groups = enclosure_groups;
diff --git a/drivers/scsi/NCR_D700.c b/drivers/scsi/NCR_D700.c
index 9e64b21ef637..c889d8458684 100644
--- a/drivers/scsi/NCR_D700.c
+++ b/drivers/scsi/NCR_D700.c
@@ -318,7 +318,7 @@ NCR_D700_probe(struct device *dev)
318 return -ENOMEM; 318 return -ENOMEM;
319 319
320 p->dev = dev; 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 if (request_irq(irq, NCR_D700_intr, IRQF_SHARED, p->name, p)) { 322 if (request_irq(irq, NCR_D700_intr, IRQF_SHARED, p->name, p)) {
323 printk(KERN_ERR "D700: request_irq failed\n"); 323 printk(KERN_ERR "D700: request_irq failed\n");
324 kfree(p); 324 kfree(p);
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 2f602720193e..7507d8bc57a1 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -2527,7 +2527,7 @@ static void asc_prt_scsi_host(struct Scsi_Host *s)
2527{ 2527{
2528 struct asc_board *boardp = shost_priv(s); 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 printk(" host_busy %u, host_no %d, last_reset %d,\n", 2531 printk(" host_busy %u, host_no %d, last_reset %d,\n",
2532 s->host_busy, s->host_no, (unsigned)s->last_reset); 2532 s->host_busy, s->host_no, (unsigned)s->last_reset);
2533 2533
diff --git a/drivers/scsi/aic94xx/aic94xx_tmf.c b/drivers/scsi/aic94xx/aic94xx_tmf.c
index d4640ef6d44f..78eb86fc6276 100644
--- a/drivers/scsi/aic94xx/aic94xx_tmf.c
+++ b/drivers/scsi/aic94xx/aic94xx_tmf.c
@@ -189,7 +189,7 @@ int asd_I_T_nexus_reset(struct domain_device *dev)
189 asd_clear_nexus_I_T(dev, NEXUS_PHASE_PRE); 189 asd_clear_nexus_I_T(dev, NEXUS_PHASE_PRE);
190 /* send a hard reset */ 190 /* send a hard reset */
191 ASD_DPRINTK("sending %s reset to %s\n", 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 res = sas_phy_reset(phy, reset_type); 193 res = sas_phy_reset(phy, reset_type);
194 if (res == TMF_RESP_FUNC_COMPLETE) { 194 if (res == TMF_RESP_FUNC_COMPLETE) {
195 /* wait for the maximum settle time */ 195 /* wait for the maximum settle time */
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 3fdbb13e80a8..aa670a1d1513 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -388,8 +388,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
388 shost->dma_boundary = 0xffffffff; 388 shost->dma_boundary = 0xffffffff;
389 389
390 device_initialize(&shost->shost_gendev); 390 device_initialize(&shost->shost_gendev);
391 snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d", 391 dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
392 shost->host_no);
393#ifndef CONFIG_SYSFS_DEPRECATED 392#ifndef CONFIG_SYSFS_DEPRECATED
394 shost->shost_gendev.bus = &scsi_bus_type; 393 shost->shost_gendev.bus = &scsi_bus_type;
395#endif 394#endif
@@ -398,8 +397,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
398 device_initialize(&shost->shost_dev); 397 device_initialize(&shost->shost_dev);
399 shost->shost_dev.parent = &shost->shost_gendev; 398 shost->shost_dev.parent = &shost->shost_gendev;
400 shost->shost_dev.class = &shost_class; 399 shost->shost_dev.class = &shost_class;
401 snprintf(shost->shost_dev.bus_id, BUS_ID_SIZE, "host%d", 400 dev_set_name(&shost->shost_dev, "host%d", shost->host_no);
402 shost->host_no);
403 shost->shost_dev.groups = scsi_sysfs_shost_attr_groups; 401 shost->shost_dev.groups = scsi_sysfs_shost_attr_groups;
404 402
405 shost->ehandler = kthread_run(scsi_error_handler, shost, 403 shost->ehandler = kthread_run(scsi_error_handler, shost,
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 44f202f33101..253414e190a7 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -1145,10 +1145,10 @@ static void ibmvfc_set_login_info(struct ibmvfc_host *vhost)
1145 login_info->async.len = vhost->async_crq.size * sizeof(*vhost->async_crq.msgs); 1145 login_info->async.len = vhost->async_crq.size * sizeof(*vhost->async_crq.msgs);
1146 strncpy(login_info->partition_name, vhost->partition_name, IBMVFC_MAX_NAME); 1146 strncpy(login_info->partition_name, vhost->partition_name, IBMVFC_MAX_NAME);
1147 strncpy(login_info->device_name, 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 location = of_get_property(of_node, "ibm,loc-code", NULL); 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 strncpy(login_info->drc_name, location, IBMVFC_MAX_NAME); 1152 strncpy(login_info->drc_name, location, IBMVFC_MAX_NAME);
1153} 1153}
1154 1154
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 0edfb1fa63ce..841f460edbc4 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -2184,7 +2184,7 @@ static void ipr_dump_location_data(struct ipr_ioa_cfg *ioa_cfg,
2184 sizeof(struct ipr_dump_entry_header); 2184 sizeof(struct ipr_dump_entry_header);
2185 driver_dump->location_entry.hdr.data_type = IPR_DUMP_DATA_TYPE_ASCII; 2185 driver_dump->location_entry.hdr.data_type = IPR_DUMP_DATA_TYPE_ASCII;
2186 driver_dump->location_entry.hdr.id = IPR_DUMP_LOCATION_ID; 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 driver_dump->hdr.num_entries++; 2188 driver_dump->hdr.num_entries++;
2189} 2189}
2190 2190
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 59459141b437..8f872f816fe4 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -1272,7 +1272,7 @@ struct ipr_dump_entry_header {
1272 1272
1273struct ipr_dump_location_entry { 1273struct ipr_dump_location_entry {
1274 struct ipr_dump_entry_header hdr; 1274 struct ipr_dump_entry_header hdr;
1275 u8 location[BUS_ID_SIZE]; 1275 u8 location[20];
1276}__attribute__((packed)); 1276}__attribute__((packed));
1277 1277
1278struct ipr_dump_trace_entry { 1278struct ipr_dump_trace_entry {
diff --git a/drivers/scsi/lasi700.c b/drivers/scsi/lasi700.c
index 3126824da36d..4a4e6954ec79 100644
--- a/drivers/scsi/lasi700.c
+++ b/drivers/scsi/lasi700.c
@@ -103,8 +103,7 @@ lasi700_probe(struct parisc_device *dev)
103 103
104 hostdata = kzalloc(sizeof(*hostdata), GFP_KERNEL); 104 hostdata = kzalloc(sizeof(*hostdata), GFP_KERNEL);
105 if (!hostdata) { 105 if (!hostdata) {
106 printk(KERN_ERR "%s: Failed to allocate host data\n", 106 dev_printk(KERN_ERR, dev, "Failed to allocate host data\n");
107 dev->dev.bus_id);
108 return -ENOMEM; 107 return -ENOMEM;
109 } 108 }
110 109
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
index 709a6f75ca9d..facc5bfcf7db 100644
--- a/drivers/scsi/libsas/sas_discover.c
+++ b/drivers/scsi/libsas/sas_discover.c
@@ -169,7 +169,7 @@ int sas_notify_lldd_dev_found(struct domain_device *dev)
169 if (res) { 169 if (res) {
170 printk("sas: driver on pcidev %s cannot handle " 170 printk("sas: driver on pcidev %s cannot handle "
171 "device %llx, error:%d\n", 171 "device %llx, error:%d\n",
172 sas_ha->dev->bus_id, 172 dev_name(sas_ha->dev),
173 SAS_ADDR(dev->sas_addr), res); 173 SAS_ADDR(dev->sas_addr), res);
174 } 174 }
175 } 175 }
diff --git a/drivers/scsi/libsas/sas_dump.c b/drivers/scsi/libsas/sas_dump.c
index bf34a236f946..c17c25030f1c 100644
--- a/drivers/scsi/libsas/sas_dump.c
+++ b/drivers/scsi/libsas/sas_dump.c
@@ -56,7 +56,7 @@ void sas_dprint_phye(int phyid, enum phy_event pe)
56 56
57void sas_dprint_hae(struct sas_ha_struct *sas_ha, enum ha_event he) 57void 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 sas_hae_str[he]); 60 sas_hae_str[he]);
61} 61}
62 62
diff --git a/drivers/scsi/libsas/sas_port.c b/drivers/scsi/libsas/sas_port.c
index 139935a121b4..e6ac59c023f1 100644
--- a/drivers/scsi/libsas/sas_port.c
+++ b/drivers/scsi/libsas/sas_port.c
@@ -113,7 +113,7 @@ static void sas_form_port(struct asd_sas_phy *phy)
113 sas_port_add_phy(port->port, phy->phy); 113 sas_port_add_phy(port->port, phy->phy);
114 114
115 SAS_DPRINTK("%s added to %s, phy_mask:0x%x (%16llx)\n", 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 port->phy_mask, 117 port->phy_mask,
118 SAS_ADDR(port->attached_sas_addr)); 118 SAS_ADDR(port->attached_sas_addr));
119 119
diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c
index 913a931176ef..8e5c169b03fb 100644
--- a/drivers/scsi/raid_class.c
+++ b/drivers/scsi/raid_class.c
@@ -237,8 +237,7 @@ int raid_component_add(struct raid_template *r,struct device *raid_dev,
237 rc->dev.parent = get_device(component_dev); 237 rc->dev.parent = get_device(component_dev);
238 rc->num = rd->component_count++; 238 rc->num = rd->component_count++;
239 239
240 snprintf(rc->dev.bus_id, sizeof(rc->dev.bus_id), 240 dev_set_name(&rc->dev, "component-%d", rc->num);
241 "component-%d", rc->num);
242 list_add_tail(&rc->node, &rd->component_list); 241 list_add_tail(&rc->node, &rd->component_list);
243 rc->dev.class = &raid_class.class; 242 rc->dev.class = &raid_class.class;
244 err = device_add(&rc->dev); 243 err = device_add(&rc->dev);
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 27c633f55794..6eebd0bbe8a8 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -2508,7 +2508,7 @@ static void pseudo_0_release(struct device *dev)
2508} 2508}
2509 2509
2510static struct device pseudo_primary = { 2510static struct device pseudo_primary = {
2511 .bus_id = "pseudo_0", 2511 .init_name = "pseudo_0",
2512 .release = pseudo_0_release, 2512 .release = pseudo_0_release,
2513}; 2513};
2514 2514
@@ -2680,7 +2680,7 @@ static int sdebug_add_adapter(void)
2680 sdbg_host->dev.bus = &pseudo_lld_bus; 2680 sdbg_host->dev.bus = &pseudo_lld_bus;
2681 sdbg_host->dev.parent = &pseudo_primary; 2681 sdbg_host->dev.parent = &pseudo_primary;
2682 sdbg_host->dev.release = &sdebug_release_adapter; 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 error = device_register(&sdbg_host->dev); 2685 error = device_register(&sdbg_host->dev);
2686 2686
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 2ae4f8fc5831..b98f763931c5 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -167,10 +167,17 @@ EXPORT_SYMBOL(scsi_set_medium_removal);
167static int scsi_ioctl_get_pci(struct scsi_device *sdev, void __user *arg) 167static int scsi_ioctl_get_pci(struct scsi_device *sdev, void __user *arg)
168{ 168{
169 struct device *dev = scsi_get_device(sdev->host); 169 struct device *dev = scsi_get_device(sdev->host);
170 const char *name;
170 171
171 if (!dev) 172 if (!dev)
172 return -ENXIO; 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
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 18486b51668d..f8493f219bc9 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -411,8 +411,7 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
411 device_initialize(dev); 411 device_initialize(dev);
412 starget->reap_ref = 1; 412 starget->reap_ref = 1;
413 dev->parent = get_device(parent); 413 dev->parent = get_device(parent);
414 sprintf(dev->bus_id, "target%d:%d:%d", 414 dev_set_name(dev, "target%d:%d:%d", shost->host_no, channel, id);
415 shost->host_no, channel, id);
416#ifndef CONFIG_SYSFS_DEPRECATED 415#ifndef CONFIG_SYSFS_DEPRECATED
417 dev->bus = &scsi_bus_type; 416 dev->bus = &scsi_bus_type;
418#endif 417#endif
@@ -1021,7 +1020,7 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
1021 if (rescan || !scsi_device_created(sdev)) { 1020 if (rescan || !scsi_device_created(sdev)) {
1022 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO 1021 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO
1023 "scsi scan: device exists on %s\n", 1022 "scsi scan: device exists on %s\n",
1024 sdev->sdev_gendev.bus_id)); 1023 dev_name(&sdev->sdev_gendev)));
1025 if (sdevp) 1024 if (sdevp)
1026 *sdevp = sdev; 1025 *sdevp = sdev;
1027 else 1026 else
@@ -1160,7 +1159,7 @@ static void scsi_sequential_lun_scan(struct scsi_target *starget,
1160 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 1159 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
1161 1160
1162 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: Sequential scan of" 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 max_dev_lun = min(max_scsi_luns, shost->max_lun); 1164 max_dev_lun = min(max_scsi_luns, shost->max_lun);
1166 /* 1165 /*
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 93c28f30bbd7..da63802cbf9d 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1079,16 +1079,14 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev)
1079 device_initialize(&sdev->sdev_gendev); 1079 device_initialize(&sdev->sdev_gendev);
1080 sdev->sdev_gendev.bus = &scsi_bus_type; 1080 sdev->sdev_gendev.bus = &scsi_bus_type;
1081 sdev->sdev_gendev.type = &scsi_dev_type; 1081 sdev->sdev_gendev.type = &scsi_dev_type;
1082 sprintf(sdev->sdev_gendev.bus_id,"%d:%d:%d:%d", 1082 dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%d",
1083 sdev->host->host_no, sdev->channel, sdev->id, 1083 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
1084 sdev->lun); 1084
1085
1086 device_initialize(&sdev->sdev_dev); 1085 device_initialize(&sdev->sdev_dev);
1087 sdev->sdev_dev.parent = &sdev->sdev_gendev; 1086 sdev->sdev_dev.parent = &sdev->sdev_gendev;
1088 sdev->sdev_dev.class = &sdev_class; 1087 sdev->sdev_dev.class = &sdev_class;
1089 snprintf(sdev->sdev_dev.bus_id, BUS_ID_SIZE, 1088 dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%d",
1090 "%d:%d:%d:%d", sdev->host->host_no, 1089 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
1091 sdev->channel, sdev->id, sdev->lun);
1092 sdev->scsi_level = starget->scsi_level; 1090 sdev->scsi_level = starget->scsi_level;
1093 transport_setup_device(&sdev->sdev_gendev); 1091 transport_setup_device(&sdev->sdev_gendev);
1094 spin_lock_irqsave(shost->host_lock, flags); 1092 spin_lock_irqsave(shost->host_lock, flags);
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 062304de4854..dcef78776503 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -2486,8 +2486,8 @@ fc_rport_create(struct Scsi_Host *shost, int channel,
2486 device_initialize(dev); /* takes self reference */ 2486 device_initialize(dev); /* takes self reference */
2487 dev->parent = get_device(&shost->shost_gendev); /* parent reference */ 2487 dev->parent = get_device(&shost->shost_gendev); /* parent reference */
2488 dev->release = fc_rport_dev_release; 2488 dev->release = fc_rport_dev_release;
2489 sprintf(dev->bus_id, "rport-%d:%d-%d", 2489 dev_set_name(dev, "rport-%d:%d-%d",
2490 shost->host_no, channel, rport->number); 2490 shost->host_no, channel, rport->number);
2491 transport_setup_device(dev); 2491 transport_setup_device(dev);
2492 2492
2493 error = device_add(dev); 2493 error = device_add(dev);
@@ -3164,8 +3164,8 @@ fc_vport_setup(struct Scsi_Host *shost, int channel, struct device *pdev,
3164 device_initialize(dev); /* takes self reference */ 3164 device_initialize(dev); /* takes self reference */
3165 dev->parent = get_device(pdev); /* takes parent reference */ 3165 dev->parent = get_device(pdev); /* takes parent reference */
3166 dev->release = fc_vport_dev_release; 3166 dev->release = fc_vport_dev_release;
3167 sprintf(dev->bus_id, "vport-%d:%d-%d", 3167 dev_set_name(dev, "vport-%d:%d-%d",
3168 shost->host_no, channel, vport->number); 3168 shost->host_no, channel, vport->number);
3169 transport_setup_device(dev); 3169 transport_setup_device(dev);
3170 3170
3171 error = device_add(dev); 3171 error = device_add(dev);
@@ -3188,19 +3188,19 @@ fc_vport_setup(struct Scsi_Host *shost, int channel, struct device *pdev,
3188 */ 3188 */
3189 if (pdev != &shost->shost_gendev) { 3189 if (pdev != &shost->shost_gendev) {
3190 error = sysfs_create_link(&shost->shost_gendev.kobj, 3190 error = sysfs_create_link(&shost->shost_gendev.kobj,
3191 &dev->kobj, dev->bus_id); 3191 &dev->kobj, dev_name(dev));
3192 if (error) 3192 if (error)
3193 printk(KERN_ERR 3193 printk(KERN_ERR
3194 "%s: Cannot create vport symlinks for " 3194 "%s: Cannot create vport symlinks for "
3195 "%s, err=%d\n", 3195 "%s, err=%d\n",
3196 __func__, dev->bus_id, error); 3196 __func__, dev_name(dev), error);
3197 } 3197 }
3198 spin_lock_irqsave(shost->host_lock, flags); 3198 spin_lock_irqsave(shost->host_lock, flags);
3199 vport->flags &= ~FC_VPORT_CREATING; 3199 vport->flags &= ~FC_VPORT_CREATING;
3200 spin_unlock_irqrestore(shost->host_lock, flags); 3200 spin_unlock_irqrestore(shost->host_lock, flags);
3201 3201
3202 dev_printk(KERN_NOTICE, pdev, 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 shost->host_no, channel); 3204 shost->host_no, channel);
3205 3205
3206 *ret_vport = vport; 3206 *ret_vport = vport;
@@ -3297,7 +3297,7 @@ fc_vport_terminate(struct fc_vport *vport)
3297 return stat; 3297 return stat;
3298 3298
3299 if (dev->parent != &shost->shost_gendev) 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 transport_remove_device(dev); 3301 transport_remove_device(dev);
3302 device_del(dev); 3302 device_del(dev);
3303 transport_destroy_device(dev); 3303 transport_destroy_device(dev);
@@ -3329,7 +3329,7 @@ fc_vport_sched_delete(struct work_struct *work)
3329 dev_printk(KERN_ERR, vport->dev.parent, 3329 dev_printk(KERN_ERR, vport->dev.parent,
3330 "%s: %s could not be deleted created via " 3330 "%s: %s could not be deleted created via "
3331 "shost%d channel %d - error %d\n", __func__, 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 vport->channel, stat); 3333 vport->channel, stat);
3334} 3334}
3335 3335
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 4a803ebaf508..75c9297694cb 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -187,8 +187,7 @@ iscsi_create_endpoint(int dd_size)
187 187
188 ep->id = id; 188 ep->id = id;
189 ep->dev.class = &iscsi_endpoint_class; 189 ep->dev.class = &iscsi_endpoint_class;
190 snprintf(ep->dev.bus_id, BUS_ID_SIZE, "ep-%llu", 190 dev_set_name(&ep->dev, "ep-%llu", (unsigned long long) id);
191 (unsigned long long) id);
192 err = device_register(&ep->dev); 191 err = device_register(&ep->dev);
193 if (err) 192 if (err)
194 goto free_ep; 193 goto free_ep;
@@ -724,8 +723,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
724 } 723 }
725 session->target_id = id; 724 session->target_id = id;
726 725
727 snprintf(session->dev.bus_id, BUS_ID_SIZE, "session%u", 726 dev_set_name(&session->dev, "session%u", session->sid);
728 session->sid);
729 err = device_add(&session->dev); 727 err = device_add(&session->dev);
730 if (err) { 728 if (err) {
731 iscsi_cls_session_printk(KERN_ERR, session, 729 iscsi_cls_session_printk(KERN_ERR, session,
@@ -898,8 +896,7 @@ iscsi_create_conn(struct iscsi_cls_session *session, int dd_size, uint32_t cid)
898 if (!get_device(&session->dev)) 896 if (!get_device(&session->dev))
899 goto free_conn; 897 goto free_conn;
900 898
901 snprintf(conn->dev.bus_id, BUS_ID_SIZE, "connection%d:%u", 899 dev_set_name(&conn->dev, "connection%d:%u", session->sid, cid);
902 session->sid, cid);
903 conn->dev.parent = &session->dev; 900 conn->dev.parent = &session->dev;
904 conn->dev.release = iscsi_conn_release; 901 conn->dev.release = iscsi_conn_release;
905 err = device_register(&conn->dev); 902 err = device_register(&conn->dev);
@@ -1816,7 +1813,7 @@ iscsi_register_transport(struct iscsi_transport *tt)
1816 priv->t.create_work_queue = 1; 1813 priv->t.create_work_queue = 1;
1817 1814
1818 priv->dev.class = &iscsi_transport_class; 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 err = device_register(&priv->dev); 1817 err = device_register(&priv->dev);
1821 if (err) 1818 if (err)
1822 goto free_priv; 1819 goto free_priv;
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index 366609386be1..50988cbf7b2d 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -207,7 +207,7 @@ static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy)
207 struct request_queue *q; 207 struct request_queue *q;
208 int error; 208 int error;
209 struct device *dev; 209 struct device *dev;
210 char namebuf[BUS_ID_SIZE]; 210 char namebuf[20];
211 const char *name; 211 const char *name;
212 void (*release)(struct device *); 212 void (*release)(struct device *);
213 213
@@ -219,7 +219,7 @@ static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy)
219 if (rphy) { 219 if (rphy) {
220 q = blk_init_queue(sas_non_host_smp_request, NULL); 220 q = blk_init_queue(sas_non_host_smp_request, NULL);
221 dev = &rphy->dev; 221 dev = &rphy->dev;
222 name = dev->bus_id; 222 name = dev_name(dev);
223 release = NULL; 223 release = NULL;
224 } else { 224 } else {
225 q = blk_init_queue(sas_host_smp_request, NULL); 225 q = blk_init_queue(sas_host_smp_request, NULL);
@@ -629,10 +629,10 @@ struct sas_phy *sas_phy_alloc(struct device *parent, int number)
629 INIT_LIST_HEAD(&phy->port_siblings); 629 INIT_LIST_HEAD(&phy->port_siblings);
630 if (scsi_is_sas_expander_device(parent)) { 630 if (scsi_is_sas_expander_device(parent)) {
631 struct sas_rphy *rphy = dev_to_rphy(parent); 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 rphy->scsi_target_id, number); 633 rphy->scsi_target_id, number);
634 } else 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 transport_setup_device(&phy->dev); 637 transport_setup_device(&phy->dev);
638 638
@@ -770,7 +770,7 @@ static void sas_port_create_link(struct sas_port *port,
770 int res; 770 int res;
771 771
772 res = sysfs_create_link(&port->dev.kobj, &phy->dev.kobj, 772 res = sysfs_create_link(&port->dev.kobj, &phy->dev.kobj,
773 phy->dev.bus_id); 773 dev_name(&phy->dev));
774 if (res) 774 if (res)
775 goto err; 775 goto err;
776 res = sysfs_create_link(&phy->dev.kobj, &port->dev.kobj, "port"); 776 res = sysfs_create_link(&phy->dev.kobj, &port->dev.kobj, "port");
@@ -785,7 +785,7 @@ err:
785static void sas_port_delete_link(struct sas_port *port, 785static void sas_port_delete_link(struct sas_port *port,
786 struct sas_phy *phy) 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 sysfs_remove_link(&phy->dev.kobj, "port"); 789 sysfs_remove_link(&phy->dev.kobj, "port");
790} 790}
791 791
@@ -821,11 +821,11 @@ struct sas_port *sas_port_alloc(struct device *parent, int port_id)
821 821
822 if (scsi_is_sas_expander_device(parent)) { 822 if (scsi_is_sas_expander_device(parent)) {
823 struct sas_rphy *rphy = dev_to_rphy(parent); 823 struct sas_rphy *rphy = dev_to_rphy(parent);
824 sprintf(port->dev.bus_id, "port-%d:%d:%d", shost->host_no, 824 dev_set_name(&port->dev, "port-%d:%d:%d", shost->host_no,
825 rphy->scsi_target_id, port->port_identifier); 825 rphy->scsi_target_id, port->port_identifier);
826 } else 826 } else
827 sprintf(port->dev.bus_id, "port-%d:%d", shost->host_no, 827 dev_set_name(&port->dev, "port-%d:%d", shost->host_no,
828 port->port_identifier); 828 port->port_identifier);
829 829
830 transport_setup_device(&port->dev); 830 transport_setup_device(&port->dev);
831 831
@@ -935,7 +935,7 @@ void sas_port_delete(struct sas_port *port)
935 if (port->is_backlink) { 935 if (port->is_backlink) {
936 struct device *parent = port->dev.parent; 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 port->is_backlink = 0; 939 port->is_backlink = 0;
940 } 940 }
941 941
@@ -984,7 +984,8 @@ void sas_port_add_phy(struct sas_port *port, struct sas_phy *phy)
984 /* If this trips, you added a phy that was already 984 /* If this trips, you added a phy that was already
985 * part of a different port */ 985 * part of a different port */
986 if (unlikely(tmp != phy)) { 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 BUG(); 989 BUG();
989 } 990 }
990 } else { 991 } else {
@@ -1023,7 +1024,7 @@ void sas_port_mark_backlink(struct sas_port *port)
1023 return; 1024 return;
1024 port->is_backlink = 1; 1025 port->is_backlink = 1;
1025 res = sysfs_create_link(&port->dev.kobj, &parent->kobj, 1026 res = sysfs_create_link(&port->dev.kobj, &parent->kobj,
1026 parent->bus_id); 1027 dev_name(parent));
1027 if (res) 1028 if (res)
1028 goto err; 1029 goto err;
1029 return; 1030 return;
@@ -1367,11 +1368,12 @@ struct sas_rphy *sas_end_device_alloc(struct sas_port *parent)
1367 rdev->rphy.dev.release = sas_end_device_release; 1368 rdev->rphy.dev.release = sas_end_device_release;
1368 if (scsi_is_sas_expander_device(parent->dev.parent)) { 1369 if (scsi_is_sas_expander_device(parent->dev.parent)) {
1369 struct sas_rphy *rphy = dev_to_rphy(parent->dev.parent); 1370 struct sas_rphy *rphy = dev_to_rphy(parent->dev.parent);
1370 sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d:%d", 1371 dev_set_name(&rdev->rphy.dev, "end_device-%d:%d:%d",
1371 shost->host_no, rphy->scsi_target_id, parent->port_identifier); 1372 shost->host_no, rphy->scsi_target_id,
1373 parent->port_identifier);
1372 } else 1374 } else
1373 sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d", 1375 dev_set_name(&rdev->rphy.dev, "end_device-%d:%d",
1374 shost->host_no, parent->port_identifier); 1376 shost->host_no, parent->port_identifier);
1375 rdev->rphy.identify.device_type = SAS_END_DEVICE; 1377 rdev->rphy.identify.device_type = SAS_END_DEVICE;
1376 sas_rphy_initialize(&rdev->rphy); 1378 sas_rphy_initialize(&rdev->rphy);
1377 transport_setup_device(&rdev->rphy.dev); 1379 transport_setup_device(&rdev->rphy.dev);
@@ -1411,8 +1413,8 @@ struct sas_rphy *sas_expander_alloc(struct sas_port *parent,
1411 mutex_lock(&sas_host->lock); 1413 mutex_lock(&sas_host->lock);
1412 rdev->rphy.scsi_target_id = sas_host->next_expander_id++; 1414 rdev->rphy.scsi_target_id = sas_host->next_expander_id++;
1413 mutex_unlock(&sas_host->lock); 1415 mutex_unlock(&sas_host->lock);
1414 sprintf(rdev->rphy.dev.bus_id, "expander-%d:%d", 1416 dev_set_name(&rdev->rphy.dev, "expander-%d:%d",
1415 shost->host_no, rdev->rphy.scsi_target_id); 1417 shost->host_no, rdev->rphy.scsi_target_id);
1416 rdev->rphy.identify.device_type = type; 1418 rdev->rphy.identify.device_type = type;
1417 sas_rphy_initialize(&rdev->rphy); 1419 sas_rphy_initialize(&rdev->rphy);
1418 transport_setup_device(&rdev->rphy.dev); 1420 transport_setup_device(&rdev->rphy.dev);
@@ -1445,7 +1447,7 @@ int sas_rphy_add(struct sas_rphy *rphy)
1445 transport_add_device(&rphy->dev); 1447 transport_add_device(&rphy->dev);
1446 transport_configure_device(&rphy->dev); 1448 transport_configure_device(&rphy->dev);
1447 if (sas_bsg_initialize(shost, rphy)) 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 mutex_lock(&sas_host->lock); 1453 mutex_lock(&sas_host->lock);
diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c
index 8a7af951d98a..21a045e0559f 100644
--- a/drivers/scsi/scsi_transport_srp.c
+++ b/drivers/scsi/scsi_transport_srp.c
@@ -212,7 +212,7 @@ struct srp_rport *srp_rport_add(struct Scsi_Host *shost,
212 rport->roles = ids->roles; 212 rport->roles = ids->roles;
213 213
214 id = atomic_inc_return(&to_srp_host_attrs(shost)->next_port_id); 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 transport_setup_device(&rport->dev); 217 transport_setup_device(&rport->dev);
218 218
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 62b28d58e65e..835aebf78710 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1876,7 +1876,7 @@ static int sd_probe(struct device *dev)
1876 device_initialize(&sdkp->dev); 1876 device_initialize(&sdkp->dev);
1877 sdkp->dev.parent = &sdp->sdev_gendev; 1877 sdkp->dev.parent = &sdp->sdev_gendev;
1878 sdkp->dev.class = &sd_disk_class; 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 if (device_add(&sdkp->dev)) 1881 if (device_add(&sdkp->dev))
1882 goto out_free_index; 1882 goto out_free_index;
diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index 7f0df29f3a64..e946e05db7f7 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -526,7 +526,7 @@ static int ses_intf_add(struct device *cdev,
526 if (!scomp) 526 if (!scomp)
527 goto err_free; 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 components, &ses_enclosure_callbacks); 530 components, &ses_enclosure_callbacks);
531 if (IS_ERR(edev)) { 531 if (IS_ERR(edev)) {
532 err = PTR_ERR(edev); 532 err = PTR_ERR(edev);
diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c
index d63d229e2323..6dc8b846c112 100644
--- a/drivers/scsi/sim710.c
+++ b/drivers/scsi/sim710.c
@@ -102,7 +102,7 @@ sim710_probe_common(struct device *dev, unsigned long base_addr,
102 struct NCR_700_Host_Parameters *hostdata = 102 struct NCR_700_Host_Parameters *hostdata =
103 kzalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL); 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 printk(KERN_NOTICE "sim710: irq = %d, clock = %d, base = 0x%lx, scsi_id = %d\n", 106 printk(KERN_NOTICE "sim710: irq = %d, clock = %d, base = 0x%lx, scsi_id = %d\n",
107 irq, clock, base_addr, scsi_id); 107 irq, clock, base_addr, scsi_id);
108 108
@@ -305,7 +305,7 @@ sim710_eisa_probe(struct device *dev)
305 scsi_id = ffs(val) - 1; 305 scsi_id = ffs(val) - 1;
306 306
307 if(scsi_id > 7 || (val & ~(1<<scsi_id)) != 0) { 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 scsi_id = 7; 309 scsi_id = 7;
310 } 310 }
311 } else { 311 } else {
diff --git a/drivers/scsi/sni_53c710.c b/drivers/scsi/sni_53c710.c
index 2bbef4c45a0d..77f0b2cdaa94 100644
--- a/drivers/scsi/sni_53c710.c
+++ b/drivers/scsi/sni_53c710.c
@@ -78,8 +78,7 @@ static int __init snirm710_probe(struct platform_device *dev)
78 base = res->start; 78 base = res->start;
79 hostdata = kzalloc(sizeof(*hostdata), GFP_KERNEL); 79 hostdata = kzalloc(sizeof(*hostdata), GFP_KERNEL);
80 if (!hostdata) { 80 if (!hostdata) {
81 printk(KERN_ERR "%s: Failed to allocate host data\n", 81 dev_printk(KERN_ERR, dev, "Failed to allocate host data\n");
82 dev->dev.bus_id);
83 return -ENOMEM; 82 return -ENOMEM;
84 } 83 }
85 84
diff --git a/drivers/scsi/zalon.c b/drivers/scsi/zalon.c
index 3c4a300494a4..a8d61a62522e 100644
--- a/drivers/scsi/zalon.c
+++ b/drivers/scsi/zalon.c
@@ -137,8 +137,8 @@ zalon_probe(struct parisc_device *dev)
137 goto fail; 137 goto fail;
138 138
139 if (request_irq(dev->irq, ncr53c8xx_intr, IRQF_SHARED, "zalon", host)) { 139 if (request_irq(dev->irq, ncr53c8xx_intr, IRQF_SHARED, "zalon", host)) {
140 printk(KERN_ERR "%s: irq problem with %d, detaching\n ", 140 dev_printk(KERN_ERR, dev, "irq problem with %d, detaching\n ",
141 dev->dev.bus_id, dev->irq); 141 dev->irq);
142 goto fail; 142 goto fail;
143 } 143 }
144 144