Commit 01bc8ad1 authored by Cornelia Huck's avatar Cornelia Huck Committed by Martin Schwidefsky

[S390] cio: Add shutdown callback for ccwgroup.

This intendeds to make proper shutdown of qeth devices easier.
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 2fffc935
...@@ -391,12 +391,24 @@ ccwgroup_remove (struct device *dev) ...@@ -391,12 +391,24 @@ ccwgroup_remove (struct device *dev)
return 0; return 0;
} }
static void ccwgroup_shutdown(struct device *dev)
{
struct ccwgroup_device *gdev;
struct ccwgroup_driver *gdrv;
gdev = to_ccwgroupdev(dev);
gdrv = to_ccwgroupdrv(dev->driver);
if (gdrv && gdrv->shutdown)
gdrv->shutdown(gdev);
}
static struct bus_type ccwgroup_bus_type = { static struct bus_type ccwgroup_bus_type = {
.name = "ccwgroup", .name = "ccwgroup",
.match = ccwgroup_bus_match, .match = ccwgroup_bus_match,
.uevent = ccwgroup_uevent, .uevent = ccwgroup_uevent,
.probe = ccwgroup_probe, .probe = ccwgroup_probe,
.remove = ccwgroup_remove, .remove = ccwgroup_remove,
.shutdown = ccwgroup_shutdown,
}; };
/** /**
......
...@@ -37,6 +37,7 @@ struct ccwgroup_device { ...@@ -37,6 +37,7 @@ struct ccwgroup_device {
* @remove: function called on remove * @remove: function called on remove
* @set_online: function called when device is set online * @set_online: function called when device is set online
* @set_offline: function called when device is set offline * @set_offline: function called when device is set offline
* @shutdown: function called when device is shut down
* @driver: embedded driver structure * @driver: embedded driver structure
*/ */
struct ccwgroup_driver { struct ccwgroup_driver {
...@@ -49,6 +50,7 @@ struct ccwgroup_driver { ...@@ -49,6 +50,7 @@ struct ccwgroup_driver {
void (*remove) (struct ccwgroup_device *); void (*remove) (struct ccwgroup_device *);
int (*set_online) (struct ccwgroup_device *); int (*set_online) (struct ccwgroup_device *);
int (*set_offline) (struct ccwgroup_device *); int (*set_offline) (struct ccwgroup_device *);
void (*shutdown)(struct ccwgroup_device *);
struct device_driver driver; struct device_driver driver;
}; };
......
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