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

s390/ccwgroup: set_online return error when already online

Return -EINVAL if set_{on,off}line is called for already {on,off}line
devices. Also return -EINVAL for drivers which do not provide a callback
for set_{on,off}line. This behaviour is now consistent with the one for
ccw devices.

Reported-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Sebastian Ott and committed by
Martin Schwidefsky
cff97102 ce6a04ac

+2 -2
+2 -2
drivers/s390/cio/ccwgroup.c
··· 68 68 static int ccwgroup_set_online(struct ccwgroup_device *gdev) 69 69 { 70 70 struct ccwgroup_driver *gdrv = to_ccwgroupdrv(gdev->dev.driver); 71 - int ret = 0; 71 + int ret = -EINVAL; 72 72 73 73 if (atomic_cmpxchg(&gdev->onoff, 0, 1) != 0) 74 74 return -EAGAIN; ··· 88 88 static int ccwgroup_set_offline(struct ccwgroup_device *gdev) 89 89 { 90 90 struct ccwgroup_driver *gdrv = to_ccwgroupdrv(gdev->dev.driver); 91 - int ret = 0; 91 + int ret = -EINVAL; 92 92 93 93 if (atomic_cmpxchg(&gdev->onoff, 0, 1) != 0) 94 94 return -EAGAIN;