[S390] ccwgroup_driver: remove duplicate members
Sebastian Ott [Wed, 23 Mar 2011 09:16:04 +0000 (10:16 +0100)]
Remove the owner and name members of struct
ccwgroup_driver and convert all drivers to store
this data in the embedded struct device_driver.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

arch/s390/include/asm/ccwgroup.h
drivers/s390/cio/ccwgroup.c
drivers/s390/net/claw.c
drivers/s390/net/ctcm_main.c
drivers/s390/net/lcs.c
drivers/s390/net/qeth_core_main.c

index c79c1e7..f2ea2c5 100644 (file)
@@ -29,8 +29,6 @@ struct ccwgroup_device {
 
 /**
  * struct ccwgroup_driver - driver for ccw group devices
- * @owner: driver owner
- * @name: driver name
  * @max_slaves: maximum number of slave devices
  * @driver_id: unique id
  * @probe: function called on probe
@@ -46,8 +44,6 @@ struct ccwgroup_device {
  * @driver: embedded driver structure
  */
 struct ccwgroup_driver {
-       struct module *owner;
-       char *name;
        int max_slaves;
        unsigned long driver_id;
 
index 2864581..5c56741 100644 (file)
@@ -428,7 +428,7 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const
        gdev = to_ccwgroupdev(dev);
        gdrv = to_ccwgroupdrv(dev->driver);
 
-       if (!try_module_get(gdrv->owner))
+       if (!try_module_get(gdrv->driver.owner))
                return -EINVAL;
 
        ret = strict_strtoul(buf, 0, &value);
@@ -442,7 +442,7 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const
        else
                ret = -EINVAL;
 out:
-       module_put(gdrv->owner);
+       module_put(gdrv->driver.owner);
        return (ret == 0) ? count : ret;
 }
 
@@ -616,8 +616,6 @@ int ccwgroup_driver_register(struct ccwgroup_driver *cdriver)
 {
        /* register our new driver with the core */
        cdriver->driver.bus = &ccwgroup_bus_type;
-       cdriver->driver.name = cdriver->name;
-       cdriver->driver.owner = cdriver->owner;
 
        return driver_register(&cdriver->driver);
 }
index 2e2d2df..9feb62f 100644 (file)
@@ -264,8 +264,10 @@ static struct device *claw_root_dev;
 /* ccwgroup table  */
 
 static struct ccwgroup_driver claw_group_driver = {
-        .owner       = THIS_MODULE,
-        .name        = "claw",
+       .driver = {
+               .owner  = THIS_MODULE,
+               .name   = "claw",
+       },
         .max_slaves  = 2,
         .driver_id   = 0xC3D3C1E6,
         .probe       = claw_probe,
index 97fd480..c189296 100644 (file)
@@ -1774,8 +1774,10 @@ static struct ccw_driver ctcm_ccw_driver = {
 };
 
 static struct ccwgroup_driver ctcm_group_driver = {
-       .owner       = THIS_MODULE,
-       .name        = CTC_DRIVER_NAME,
+       .driver = {
+               .owner  = THIS_MODULE,
+               .name   = CTC_DRIVER_NAME,
+       },
        .max_slaves  = 2,
        .driver_id   = 0xC3E3C3D4,      /* CTCM */
        .probe       = ctcm_probe_device,
index f59429c..7fbc4ad 100644 (file)
@@ -2409,8 +2409,10 @@ static struct ccw_driver lcs_ccw_driver = {
  * LCS ccwgroup driver registration
  */
 static struct ccwgroup_driver lcs_group_driver = {
-       .owner       = THIS_MODULE,
-       .name        = "lcs",
+       .driver = {
+               .owner  = THIS_MODULE,
+               .name   = "lcs",
+       },
        .max_slaves  = 2,
        .driver_id   = 0xD3C3E2,
        .probe       = lcs_probe_device,
index 150b2cd..10a3a3b 100644 (file)
@@ -4430,8 +4430,10 @@ static int qeth_core_restore(struct ccwgroup_device *gdev)
 }
 
 static struct ccwgroup_driver qeth_core_ccwgroup_driver = {
-       .owner = THIS_MODULE,
-       .name = "qeth",
+       .driver = {
+               .owner = THIS_MODULE,
+               .name = "qeth",
+       },
        .driver_id = 0xD8C5E3C8,
        .probe = qeth_core_probe_device,
        .remove = qeth_core_remove_device,