[S390] bus_id -> dev_set_name() changes
authorCornelia Huck <cornelia.huck@de.ibm.com>
Fri, 10 Oct 2008 19:33:10 +0000 (21:33 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 10 Oct 2008 19:33:50 +0000 (21:33 +0200)
Convert most s390 users setting bus_id to dev_set_name().
css and ccw busses are deferred since they need some special
treatment.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dcssblk.c
drivers/s390/char/vmlogrdr.c
drivers/s390/cio/ccwgroup.c
drivers/s390/cio/chp.c
drivers/s390/cio/css.c
drivers/s390/crypto/ap_bus.c
drivers/s390/net/netiucv.c
drivers/s390/s390_rdev.c
drivers/s390/scsi/zfcp_aux.c

index 2aca79e952b0b28e5cba729a90cd1756b4990905..ea4272c8c677813be816604662b82f751253ffca 100644 (file)
@@ -343,7 +343,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
        }
 
        strcpy(dev_info->segment_name, local_buf);
-       strlcpy(dev_info->dev.bus_id, local_buf, BUS_ID_SIZE);
+       dev_set_name(&dev_info->dev, local_buf);
        dev_info->dev.release = dcssblk_release_segment;
        INIT_LIST_HEAD(&dev_info->lh);
 
index 036e650e8b9c53b5a8bc2dac305ed714b44d4c6e..42173cc34610f41417b877387dd052517638b6b8 100644 (file)
@@ -724,8 +724,7 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
 
        dev = kzalloc(sizeof(struct device), GFP_KERNEL);
        if (dev) {
-               snprintf(dev->bus_id, BUS_ID_SIZE, "%s",
-                        priv->internal_name);
+               dev_set_name(dev, priv->internal_name);
                dev->bus = &iucv_bus;
                dev->parent = iucv_root;
                dev->driver = &vmlogrdr_driver;
index e17b462ace03e7ca30ceb8201f9d85c594c69850..3ac2c2019f5e28ffae89e7c0d07f965be297f500 100644 (file)
@@ -269,8 +269,7 @@ int ccwgroup_create_from_string(struct device *root, unsigned int creator_id,
                goto error;
        }
 
-       snprintf (gdev->dev.bus_id, BUS_ID_SIZE, "%s",
-                       dev_name(&gdev->cdev[0]->dev));
+       dev_set_name(&gdev->dev, "%s", dev_name(&gdev->cdev[0]->dev));
 
        rc = device_add(&gdev->dev);
        if (rc)
index f1216cf6fa8fdd098cc3bc9c145d352fb907059d..1246f61a5338afadca17a9debd0ce4217f8af336 100644 (file)
@@ -393,8 +393,7 @@ int chp_new(struct chp_id chpid)
        chp->state = 1;
        chp->dev.parent = &channel_subsystems[chpid.cssid]->device;
        chp->dev.release = chp_release;
-       snprintf(chp->dev.bus_id, BUS_ID_SIZE, "chp%x.%02x", chpid.cssid,
-                chpid.id);
+       dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id);
 
        /* Obtain channel path description and fill it in. */
        ret = chsc_determine_base_channel_path_desc(chpid, &chp->desc);
index 1261e1a9e8cd518f78aa44754a00318182de2ad8..76bbb1e74c2988c025d695c3927fc690ca067ba6 100644 (file)
@@ -698,7 +698,7 @@ static int __init setup_css(int nr)
                return -ENOMEM;
        css->pseudo_subchannel->dev.parent = &css->device;
        css->pseudo_subchannel->dev.release = css_subchannel_release;
-       sprintf(css->pseudo_subchannel->dev.bus_id, "defunct");
+       dev_set_name(&css->pseudo_subchannel->dev, "defunct");
        ret = cio_create_sch_lock(css->pseudo_subchannel);
        if (ret) {
                kfree(css->pseudo_subchannel);
@@ -707,7 +707,7 @@ static int __init setup_css(int nr)
        mutex_init(&css->mutex);
        css->valid = 1;
        css->cssid = nr;
-       sprintf(css->device.bus_id, "css%x", nr);
+       dev_set_name(&css->device, "css%x", nr);
        css->device.release = channel_subsystem_release;
        tod_high = (u32) (get_clock() >> 32);
        css_generate_pgid(css, tod_high);
index 62b6b55230d0d4e509910df984de16364b8c99f9..326db1e827c4dbe41f70419a9af53b1a997a7e7a 100644 (file)
@@ -892,8 +892,8 @@ static void ap_scan_bus(struct work_struct *unused)
 
                ap_dev->device.bus = &ap_bus_type;
                ap_dev->device.parent = ap_root_device;
-               snprintf(ap_dev->device.bus_id, BUS_ID_SIZE, "card%02x",
-                        AP_QID_DEVICE(ap_dev->qid));
+               dev_set_name(&ap_dev->device, "card%02x",
+                            AP_QID_DEVICE(ap_dev->qid));
                ap_dev->device.release = ap_device_release;
                rc = device_register(&ap_dev->device);
                if (rc) {
index 9242b5acc66ba8f63e0344569a8e9cf5e6c478e5..0fea51e34b5751b06f2ddc728c2116c8d6d3f3b7 100644 (file)
@@ -1724,7 +1724,7 @@ static int netiucv_register_device(struct net_device *ndev)
        IUCV_DBF_TEXT(trace, 3, __func__);
 
        if (dev) {
-               snprintf(dev->bus_id, BUS_ID_SIZE, "net%s", ndev->name);
+               dev_set_name(dev, "net%s", ndev->name);
                dev->bus = &iucv_bus;
                dev->parent = iucv_root;
                /*
index 3c7145d9f9a1f74189b655b54afbae05c8d22202..64371c05a3b37a1cac8ca1df37bb4b93389953d1 100644 (file)
@@ -30,7 +30,7 @@ s390_root_dev_register(const char *name)
        dev = kzalloc(sizeof(struct device), GFP_KERNEL);
        if (!dev)
                return ERR_PTR(-ENOMEM);
-       strncpy(dev->bus_id, name, min(strlen(name), (size_t)BUS_ID_SIZE));
+       dev_set_name(dev, name);
        dev->release = s390_root_dev_release;
        ret = device_register(dev);
        if (ret) {
index 24255e42dc30bbb4aa6283c31ac1ea170a62b661..3b56220fb900291df60b56284191b6e66119a02d 100644 (file)
@@ -283,8 +283,8 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun)
        unit->port = port;
        unit->fcp_lun = fcp_lun;
 
-       snprintf(unit->sysfs_device.bus_id, BUS_ID_SIZE, "0x%016llx",
-                (unsigned long long) fcp_lun);
+       dev_set_name(&unit->sysfs_device, "0x%016llx",
+                    (unsigned long long) fcp_lun);
        unit->sysfs_device.parent = &port->sysfs_device;
        unit->sysfs_device.release = zfcp_sysfs_unit_release;
        dev_set_drvdata(&unit->sysfs_device, unit);
@@ -610,8 +610,7 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn,
        atomic_set_mask(status | ZFCP_STATUS_COMMON_REMOVE, &port->status);
        atomic_set(&port->refcount, 0);
 
-       snprintf(port->sysfs_device.bus_id, BUS_ID_SIZE, "0x%016llx",
-                (unsigned long long) wwpn);
+       dev_set_name(&port->sysfs_device, "0x%016llx", wwpn);
        port->sysfs_device.parent = &adapter->ccw_device->dev;
 
        port->sysfs_device.release = zfcp_sysfs_port_release;