Browse Source

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>
Sebastian Ott 12 years ago
parent
commit
cff971026d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      drivers/s390/cio/ccwgroup.c

+ 2 - 2
drivers/s390/cio/ccwgroup.c

@@ -68,7 +68,7 @@ static void __ccwgroup_remove_cdev_refs(struct ccwgroup_device *gdev)
 static int ccwgroup_set_online(struct ccwgroup_device *gdev)
 {
 	struct ccwgroup_driver *gdrv = to_ccwgroupdrv(gdev->dev.driver);
-	int ret = 0;
+	int ret = -EINVAL;
 
 	if (atomic_cmpxchg(&gdev->onoff, 0, 1) != 0)
 		return -EAGAIN;
@@ -88,7 +88,7 @@ out:
 static int ccwgroup_set_offline(struct ccwgroup_device *gdev)
 {
 	struct ccwgroup_driver *gdrv = to_ccwgroupdrv(gdev->dev.driver);
-	int ret = 0;
+	int ret = -EINVAL;
 
 	if (atomic_cmpxchg(&gdev->onoff, 0, 1) != 0)
 		return -EAGAIN;