aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2008-02-05 10:50:36 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-02-05 10:50:54 -0500
commit01bc8ad165490458a8feb744c8f401c1a7098e3a (patch)
tree2bb41b3144a74cbe85c7c563ac7ef887e1cfaffb
parent2fffc9355e6240466d1af764b0dcdede52085f7c (diff)
[S390] cio: Add shutdown callback for ccwgroup.
This intendeds to make proper shutdown of qeth devices easier. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--drivers/s390/cio/ccwgroup.c12
-rw-r--r--include/asm-s390/ccwgroup.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index 3964056a9a47..03914fa81174 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -391,12 +391,24 @@ ccwgroup_remove (struct device *dev)
391 return 0; 391 return 0;
392} 392}
393 393
394static void ccwgroup_shutdown(struct device *dev)
395{
396 struct ccwgroup_device *gdev;
397 struct ccwgroup_driver *gdrv;
398
399 gdev = to_ccwgroupdev(dev);
400 gdrv = to_ccwgroupdrv(dev->driver);
401 if (gdrv && gdrv->shutdown)
402 gdrv->shutdown(gdev);
403}
404
394static struct bus_type ccwgroup_bus_type = { 405static struct bus_type ccwgroup_bus_type = {
395 .name = "ccwgroup", 406 .name = "ccwgroup",
396 .match = ccwgroup_bus_match, 407 .match = ccwgroup_bus_match,
397 .uevent = ccwgroup_uevent, 408 .uevent = ccwgroup_uevent,
398 .probe = ccwgroup_probe, 409 .probe = ccwgroup_probe,
399 .remove = ccwgroup_remove, 410 .remove = ccwgroup_remove,
411 .shutdown = ccwgroup_shutdown,
400}; 412};
401 413
402/** 414/**
diff --git a/include/asm-s390/ccwgroup.h b/include/asm-s390/ccwgroup.h
index 7109c7cab87e..289053ef5e60 100644
--- a/include/asm-s390/ccwgroup.h
+++ b/include/asm-s390/ccwgroup.h
@@ -37,6 +37,7 @@ struct ccwgroup_device {
37 * @remove: function called on remove 37 * @remove: function called on remove
38 * @set_online: function called when device is set online 38 * @set_online: function called when device is set online
39 * @set_offline: function called when device is set offline 39 * @set_offline: function called when device is set offline
40 * @shutdown: function called when device is shut down
40 * @driver: embedded driver structure 41 * @driver: embedded driver structure
41 */ 42 */
42struct ccwgroup_driver { 43struct ccwgroup_driver {
@@ -49,6 +50,7 @@ struct ccwgroup_driver {
49 void (*remove) (struct ccwgroup_device *); 50 void (*remove) (struct ccwgroup_device *);
50 int (*set_online) (struct ccwgroup_device *); 51 int (*set_online) (struct ccwgroup_device *);
51 int (*set_offline) (struct ccwgroup_device *); 52 int (*set_offline) (struct ccwgroup_device *);
53 void (*shutdown)(struct ccwgroup_device *);
52 54
53 struct device_driver driver; 55 struct device_driver driver;
54}; 56};