Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sebastian Ott and committed by
Martin Schwidefsky
683c3dce cff97102

+23 -2
+3
arch/s390/include/asm/ccwgroup.h
··· 59 59 int ccwgroup_create_dev(struct device *root, struct ccwgroup_driver *gdrv, 60 60 int num_devices, const char *buf); 61 61 62 + extern int ccwgroup_set_online(struct ccwgroup_device *gdev); 63 + extern int ccwgroup_set_offline(struct ccwgroup_device *gdev); 64 + 62 65 extern int ccwgroup_probe_ccwdev(struct ccw_device *cdev); 63 66 extern void ccwgroup_remove_ccwdev(struct ccw_device *cdev); 64 67
+20 -2
drivers/s390/cio/ccwgroup.c
··· 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 78 struct ccwgroup_driver *gdrv = to_ccwgroupdrv(gdev->dev.driver); 71 79 int ret = -EINVAL; ··· 92 84 atomic_set(&gdev->onoff, 0); 93 85 return ret; 94 86 } 87 + EXPORT_SYMBOL(ccwgroup_set_online); 95 88 96 - static int ccwgroup_set_offline(struct ccwgroup_device *gdev) 89 + /** 90 + * ccwgroup_set_offline() - disable a ccwgroup device 91 + * @gdev: target ccwgroup device 92 + * 93 + * This function attempts to put the ccwgroup device into the offline state. 94 + * Returns: 95 + * %0 on success and a negative error value on failure. 96 + */ 97 + int ccwgroup_set_offline(struct ccwgroup_device *gdev) 97 98 { 98 99 struct ccwgroup_driver *gdrv = to_ccwgroupdrv(gdev->dev.driver); 99 100 int ret = -EINVAL; ··· 121 104 atomic_set(&gdev->onoff, 0); 122 105 return ret; 123 106 } 107 + EXPORT_SYMBOL(ccwgroup_set_offline); 124 108 125 109 static ssize_t ccwgroup_online_store(struct device *dev, 126 110 struct device_attribute *attr,