Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71610f55 authored by Kay Sievers's avatar Kay Sievers Committed by James Bottomley
Browse files

[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: default avatarKay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent b58602a4
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ enclosure_register(struct device *dev, const char *name, int components,
	edev->edev.class = &enclosure_class;
	edev->edev.parent = get_device(dev);
	edev->cb = cb;
	snprintf(edev->edev.bus_id, BUS_ID_SIZE, "%s", name);
	dev_set_name(&edev->edev, name);
	err = device_register(&edev->edev);
	if (err)
		goto err;
@@ -170,7 +170,7 @@ EXPORT_SYMBOL_GPL(enclosure_unregister);
static void enclosure_link_name(struct enclosure_component *cdev, char *name)
{
	strcpy(name, "enclosure_device:");
	strcat(name, cdev->cdev.bus_id);
	strcat(name, dev_name(&cdev->cdev));
}

static void enclosure_remove_links(struct enclosure_component *cdev)
@@ -256,9 +256,9 @@ enclosure_component_register(struct enclosure_device *edev,
	cdev = &ecomp->cdev;
	cdev->parent = get_device(&edev->edev);
	if (name)
		snprintf(cdev->bus_id, BUS_ID_SIZE, "%s", name);
		dev_set_name(cdev, name);
	else
		snprintf(cdev->bus_id, BUS_ID_SIZE, "%u", number);
		dev_set_name(cdev, "%u", number);

	cdev->release = enclosure_component_release;
	cdev->groups = enclosure_groups;
+1 −1
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ NCR_D700_probe(struct device *dev)
		return -ENOMEM;

	p->dev = dev;
	snprintf(p->name, sizeof(p->name), "D700(%s)", dev->bus_id);
	snprintf(p->name, sizeof(p->name), "D700(%s)", dev_name(dev));
	if (request_irq(irq, NCR_D700_intr, IRQF_SHARED, p->name, p)) {
		printk(KERN_ERR "D700: request_irq failed\n");
		kfree(p);
+1 −1
Original line number Diff line number Diff line
@@ -2527,7 +2527,7 @@ static void asc_prt_scsi_host(struct Scsi_Host *s)
{
	struct asc_board *boardp = shost_priv(s);

	printk("Scsi_Host at addr 0x%p, device %s\n", s, boardp->dev->bus_id);
	printk("Scsi_Host at addr 0x%p, device %s\n", s, dev_name(boardp->dev));
	printk(" host_busy %u, host_no %d, last_reset %d,\n",
	       s->host_busy, s->host_no, (unsigned)s->last_reset);

+1 −1
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ int asd_I_T_nexus_reset(struct domain_device *dev)
	asd_clear_nexus_I_T(dev, NEXUS_PHASE_PRE);
	/* send a hard reset */
	ASD_DPRINTK("sending %s reset to %s\n",
		    reset_type ? "hard" : "soft", phy->dev.bus_id);
		    reset_type ? "hard" : "soft", dev_name(&phy->dev));
	res = sas_phy_reset(phy, reset_type);
	if (res == TMF_RESP_FUNC_COMPLETE) {
		/* wait for the maximum settle time */
+2 −4
Original line number Diff line number Diff line
@@ -388,8 +388,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
		shost->dma_boundary = 0xffffffff;

	device_initialize(&shost->shost_gendev);
	snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d",
		shost->host_no);
	dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
#ifndef CONFIG_SYSFS_DEPRECATED
	shost->shost_gendev.bus = &scsi_bus_type;
#endif
@@ -398,8 +397,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
	device_initialize(&shost->shost_dev);
	shost->shost_dev.parent = &shost->shost_gendev;
	shost->shost_dev.class = &shost_class;
	snprintf(shost->shost_dev.bus_id, BUS_ID_SIZE, "host%d",
		 shost->host_no);
	dev_set_name(&shost->shost_dev, "host%d", shost->host_no);
	shost->shost_dev.groups = scsi_sysfs_shost_attr_groups;

	shost->ehandler = kthread_run(scsi_error_handler, shost,
Loading