Commit 3bda058b authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky

[S390] ccw_driver: remove duplicate members

Remove the owner and name members of struct
ccw_driver and convert all drivers to store
this data in the embedded struct device_driver.
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 9a26513e
...@@ -112,7 +112,6 @@ enum uc_todo { ...@@ -112,7 +112,6 @@ enum uc_todo {
/** /**
* struct ccw driver - device driver for channel attached devices * struct ccw driver - device driver for channel attached devices
* @owner: owning module
* @ids: ids supported by this driver * @ids: ids supported by this driver
* @probe: function called on probe * @probe: function called on probe
* @remove: function called on remove * @remove: function called on remove
...@@ -128,10 +127,8 @@ enum uc_todo { ...@@ -128,10 +127,8 @@ enum uc_todo {
* @restore: callback for restoring after hibernation * @restore: callback for restoring after hibernation
* @uc_handler: callback for unit check handler * @uc_handler: callback for unit check handler
* @driver: embedded device driver structure * @driver: embedded device driver structure
* @name: device driver name
*/ */
struct ccw_driver { struct ccw_driver {
struct module *owner;
struct ccw_device_id *ids; struct ccw_device_id *ids;
int (*probe) (struct ccw_device *); int (*probe) (struct ccw_device *);
void (*remove) (struct ccw_device *); void (*remove) (struct ccw_device *);
...@@ -147,7 +144,6 @@ struct ccw_driver { ...@@ -147,7 +144,6 @@ struct ccw_driver {
int (*restore)(struct ccw_device *); int (*restore)(struct ccw_device *);
enum uc_todo (*uc_handler) (struct ccw_device *, struct irb *); enum uc_todo (*uc_handler) (struct ccw_device *, struct irb *);
struct device_driver driver; struct device_driver driver;
char *name;
}; };
extern struct ccw_device *get_ccwdev_by_busid(struct ccw_driver *cdrv, extern struct ccw_device *get_ccwdev_by_busid(struct ccw_driver *cdrv,
......
...@@ -3982,8 +3982,10 @@ static int dasd_eckd_reload_device(struct dasd_device *device) ...@@ -3982,8 +3982,10 @@ static int dasd_eckd_reload_device(struct dasd_device *device)
} }
static struct ccw_driver dasd_eckd_driver = { static struct ccw_driver dasd_eckd_driver = {
.driver = {
.name = "dasd-eckd", .name = "dasd-eckd",
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.ids = dasd_eckd_ids, .ids = dasd_eckd_ids,
.probe = dasd_eckd_probe, .probe = dasd_eckd_probe,
.remove = dasd_generic_remove, .remove = dasd_generic_remove,
......
...@@ -65,8 +65,10 @@ dasd_fba_set_online(struct ccw_device *cdev) ...@@ -65,8 +65,10 @@ dasd_fba_set_online(struct ccw_device *cdev)
} }
static struct ccw_driver dasd_fba_driver = { static struct ccw_driver dasd_fba_driver = {
.driver = {
.name = "dasd-fba", .name = "dasd-fba",
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.ids = dasd_fba_ids, .ids = dasd_fba_ids,
.probe = dasd_fba_probe, .probe = dasd_fba_probe,
.remove = dasd_generic_remove, .remove = dasd_generic_remove,
......
...@@ -764,8 +764,10 @@ static struct ccw_device_id raw3215_id[] = { ...@@ -764,8 +764,10 @@ static struct ccw_device_id raw3215_id[] = {
}; };
static struct ccw_driver raw3215_ccw_driver = { static struct ccw_driver raw3215_ccw_driver = {
.driver = {
.name = "3215", .name = "3215",
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.ids = raw3215_id, .ids = raw3215_id,
.probe = &raw3215_probe, .probe = &raw3215_probe,
.remove = &raw3215_remove, .remove = &raw3215_remove,
......
...@@ -1388,8 +1388,10 @@ static struct ccw_device_id raw3270_id[] = { ...@@ -1388,8 +1388,10 @@ static struct ccw_device_id raw3270_id[] = {
}; };
static struct ccw_driver raw3270_ccw_driver = { static struct ccw_driver raw3270_ccw_driver = {
.driver = {
.name = "3270", .name = "3270",
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.ids = raw3270_id, .ids = raw3270_id,
.probe = &raw3270_probe, .probe = &raw3270_probe,
.remove = &raw3270_remove, .remove = &raw3270_remove,
......
...@@ -1320,8 +1320,10 @@ tape_34xx_online(struct ccw_device *cdev) ...@@ -1320,8 +1320,10 @@ tape_34xx_online(struct ccw_device *cdev)
} }
static struct ccw_driver tape_34xx_driver = { static struct ccw_driver tape_34xx_driver = {
.driver = {
.name = "tape_34xx", .name = "tape_34xx",
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.ids = tape_34xx_ids, .ids = tape_34xx_ids,
.probe = tape_generic_probe, .probe = tape_generic_probe,
.remove = tape_generic_remove, .remove = tape_generic_remove,
......
...@@ -1761,8 +1761,10 @@ tape_3590_online(struct ccw_device *cdev) ...@@ -1761,8 +1761,10 @@ tape_3590_online(struct ccw_device *cdev)
} }
static struct ccw_driver tape_3590_driver = { static struct ccw_driver tape_3590_driver = {
.driver = {
.name = "tape_3590", .name = "tape_3590",
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.ids = tape_3590_ids, .ids = tape_3590_ids,
.probe = tape_generic_probe, .probe = tape_generic_probe,
.remove = tape_generic_remove, .remove = tape_generic_remove,
......
...@@ -64,8 +64,10 @@ static int ur_set_offline(struct ccw_device *cdev); ...@@ -64,8 +64,10 @@ static int ur_set_offline(struct ccw_device *cdev);
static int ur_pm_suspend(struct ccw_device *cdev); static int ur_pm_suspend(struct ccw_device *cdev);
static struct ccw_driver ur_driver = { static struct ccw_driver ur_driver = {
.driver = {
.name = "vmur", .name = "vmur",
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.ids = ur_ids, .ids = ur_ids,
.probe = ur_probe, .probe = ur_probe,
.remove = ur_remove, .remove = ur_remove,
......
...@@ -547,7 +547,7 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr, ...@@ -547,7 +547,7 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr,
if (atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0) if (atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0)
return -EAGAIN; return -EAGAIN;
if (cdev->drv && !try_module_get(cdev->drv->owner)) { if (cdev->drv && !try_module_get(cdev->drv->driver.owner)) {
atomic_set(&cdev->private->onoff, 0); atomic_set(&cdev->private->onoff, 0);
return -EINVAL; return -EINVAL;
} }
...@@ -573,7 +573,7 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr, ...@@ -573,7 +573,7 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr,
} }
out: out:
if (cdev->drv) if (cdev->drv)
module_put(cdev->drv->owner); module_put(cdev->drv->driver.owner);
atomic_set(&cdev->private->onoff, 0); atomic_set(&cdev->private->onoff, 0);
return (ret < 0) ? ret : count; return (ret < 0) ? ret : count;
} }
...@@ -1993,8 +1993,6 @@ int ccw_driver_register(struct ccw_driver *cdriver) ...@@ -1993,8 +1993,6 @@ int ccw_driver_register(struct ccw_driver *cdriver)
struct device_driver *drv = &cdriver->driver; struct device_driver *drv = &cdriver->driver;
drv->bus = &ccw_bus_type; drv->bus = &ccw_bus_type;
drv->name = cdriver->name;
drv->owner = cdriver->owner;
return driver_register(drv); return driver_register(drv);
} }
......
...@@ -282,8 +282,10 @@ static struct ccw_device_id claw_ids[] = { ...@@ -282,8 +282,10 @@ static struct ccw_device_id claw_ids[] = {
MODULE_DEVICE_TABLE(ccw, claw_ids); MODULE_DEVICE_TABLE(ccw, claw_ids);
static struct ccw_driver claw_ccw_driver = { static struct ccw_driver claw_ccw_driver = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "claw", .name = "claw",
},
.ids = claw_ids, .ids = claw_ids,
.probe = ccwgroup_probe_ccwdev, .probe = ccwgroup_probe_ccwdev,
.remove = ccwgroup_remove_ccwdev, .remove = ccwgroup_remove_ccwdev,
......
...@@ -1764,8 +1764,10 @@ static struct ccw_device_id ctcm_ids[] = { ...@@ -1764,8 +1764,10 @@ static struct ccw_device_id ctcm_ids[] = {
MODULE_DEVICE_TABLE(ccw, ctcm_ids); MODULE_DEVICE_TABLE(ccw, ctcm_ids);
static struct ccw_driver ctcm_ccw_driver = { static struct ccw_driver ctcm_ccw_driver = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "ctcm", .name = "ctcm",
},
.ids = ctcm_ids, .ids = ctcm_ids,
.probe = ccwgroup_probe_ccwdev, .probe = ccwgroup_probe_ccwdev,
.remove = ccwgroup_remove_ccwdev, .remove = ccwgroup_remove_ccwdev,
......
...@@ -2396,8 +2396,10 @@ static struct ccw_device_id lcs_ids[] = { ...@@ -2396,8 +2396,10 @@ static struct ccw_device_id lcs_ids[] = {
MODULE_DEVICE_TABLE(ccw, lcs_ids); MODULE_DEVICE_TABLE(ccw, lcs_ids);
static struct ccw_driver lcs_ccw_driver = { static struct ccw_driver lcs_ccw_driver = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "lcs", .name = "lcs",
},
.ids = lcs_ids, .ids = lcs_ids,
.probe = ccwgroup_probe_ccwdev, .probe = ccwgroup_probe_ccwdev,
.remove = ccwgroup_remove_ccwdev, .remove = ccwgroup_remove_ccwdev,
......
...@@ -3902,7 +3902,9 @@ static struct ccw_device_id qeth_ids[] = { ...@@ -3902,7 +3902,9 @@ static struct ccw_device_id qeth_ids[] = {
MODULE_DEVICE_TABLE(ccw, qeth_ids); MODULE_DEVICE_TABLE(ccw, qeth_ids);
static struct ccw_driver qeth_ccw_driver = { static struct ccw_driver qeth_ccw_driver = {
.driver = {
.name = "qeth", .name = "qeth",
},
.ids = qeth_ids, .ids = qeth_ids,
.probe = ccwgroup_probe_ccwdev, .probe = ccwgroup_probe_ccwdev,
.remove = ccwgroup_remove_ccwdev, .remove = ccwgroup_remove_ccwdev,
......
...@@ -251,8 +251,10 @@ static void zfcp_ccw_shutdown(struct ccw_device *cdev) ...@@ -251,8 +251,10 @@ static void zfcp_ccw_shutdown(struct ccw_device *cdev)
} }
struct ccw_driver zfcp_ccw_driver = { struct ccw_driver zfcp_ccw_driver = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "zfcp", .name = "zfcp",
},
.ids = zfcp_ccw_device_id, .ids = zfcp_ccw_device_id,
.probe = zfcp_ccw_probe, .probe = zfcp_ccw_probe,
.remove = zfcp_ccw_remove, .remove = zfcp_ccw_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment