From: Sebastian Ott Date: Fri, 9 Nov 2012 13:33:06 +0000 (+0100) Subject: s390/ccwgroup: set_online return error when already online X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=cff971026d7c19f67f9312e753bb06f18b6cdae7;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Sebastian Ott Acked-by: Peter Oberparleiter Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index 731470e68493..9c8e117c7d3a 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/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;