diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2012-11-22 09:56:39 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-11-23 05:14:35 -0500 |
commit | 683c3dcef439f969b2c7fd09b60144cb4e2155a5 (patch) | |
tree | 9c83a5059e930bc9aa81e3c96b997020e6f7713c /drivers | |
parent | cff971026d7c19f67f9312e753bb06f18b6cdae7 (diff) |
s390/ccwgroup: allow drivers to call set_{on,off}line
Allow drivers to enable/disable ccwgroup devices.
Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/cio/ccwgroup.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index 9c8e117c7d3a..84846c2b96d3 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c | |||
@@ -65,7 +65,15 @@ static void __ccwgroup_remove_cdev_refs(struct ccwgroup_device *gdev) | |||
65 | } | 65 | } |
66 | } | 66 | } |
67 | 67 | ||
68 | static int ccwgroup_set_online(struct ccwgroup_device *gdev) | 68 | /** |
69 | * ccwgroup_set_online() - enable a ccwgroup device | ||
70 | * @gdev: target ccwgroup device | ||
71 | * | ||
72 | * This function attempts to put the ccwgroup device into the online state. | ||
73 | * Returns: | ||
74 | * %0 on success and a negative error value on failure. | ||
75 | */ | ||
76 | int ccwgroup_set_online(struct ccwgroup_device *gdev) | ||
69 | { | 77 | { |
70 | struct ccwgroup_driver *gdrv = to_ccwgroupdrv(gdev->dev.driver); | 78 | struct ccwgroup_driver *gdrv = to_ccwgroupdrv(gdev->dev.driver); |
71 | int ret = -EINVAL; | 79 | int ret = -EINVAL; |
@@ -84,8 +92,17 @@ out: | |||
84 | atomic_set(&gdev->onoff, 0); | 92 | atomic_set(&gdev->onoff, 0); |
85 | return ret; | 93 | return ret; |
86 | } | 94 | } |
95 | EXPORT_SYMBOL(ccwgroup_set_online); | ||
87 | 96 | ||
88 | static int ccwgroup_set_offline(struct ccwgroup_device *gdev) | 97 | /** |
98 | * ccwgroup_set_offline() - disable a ccwgroup device | ||
99 | * @gdev: target ccwgroup device | ||
100 | * | ||
101 | * This function attempts to put the ccwgroup device into the offline state. | ||
102 | * Returns: | ||
103 | * %0 on success and a negative error value on failure. | ||
104 | */ | ||
105 | int ccwgroup_set_offline(struct ccwgroup_device *gdev) | ||
89 | { | 106 | { |
90 | struct ccwgroup_driver *gdrv = to_ccwgroupdrv(gdev->dev.driver); | 107 | struct ccwgroup_driver *gdrv = to_ccwgroupdrv(gdev->dev.driver); |
91 | int ret = -EINVAL; | 108 | int ret = -EINVAL; |
@@ -104,6 +121,7 @@ out: | |||
104 | atomic_set(&gdev->onoff, 0); | 121 | atomic_set(&gdev->onoff, 0); |
105 | return ret; | 122 | return ret; |
106 | } | 123 | } |
124 | EXPORT_SYMBOL(ccwgroup_set_offline); | ||
107 | 125 | ||
108 | static ssize_t ccwgroup_online_store(struct device *dev, | 126 | static ssize_t ccwgroup_online_store(struct device *dev, |
109 | struct device_attribute *attr, | 127 | struct device_attribute *attr, |