diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2010-08-09 20:12:52 +0400 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-08-09 20:12:53 +0400 |
commit | 7cd403142d5dbffa354b7dd369b1069e01b1ae19 (patch) | |
tree | cea6fccf5b48466599a79ad19b22bebc21a56f0b /drivers/s390/cio | |
parent | dbedd0ee47313f2a3c94b19346785fcdfa721390 (diff) | |
download | linux-7cd403142d5dbffa354b7dd369b1069e01b1ae19.tar.xz |
[S390] cio: ccw_device_online_store return -EINVAL in case of missing driver
If no driver is attached to a device or the driver provides no
set_online/set_offline function, setting this device online/offline
via its sysfs online attribute will silently fail but return success.
This patch changes the behavior to return -EINVAL in those cases.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r-- | drivers/s390/cio/device.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 75acec3b2d6b..51bd3687d163 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -487,9 +487,11 @@ static int online_store_handle_offline(struct ccw_device *cdev) spin_lock_irq(cdev->ccwlock); ccw_device_sched_todo(cdev, CDEV_TODO_UNREG_EVAL); spin_unlock_irq(cdev->ccwlock); - } else if (cdev->online && cdev->drv && cdev->drv->set_offline) + return 0; + } + if (cdev->drv && cdev->drv->set_offline) return ccw_device_set_offline(cdev); - return 0; + return -EINVAL; } static int online_store_recog_and_online(struct ccw_device *cdev) @@ -506,8 +508,8 @@ static int online_store_recog_and_online(struct ccw_device *cdev) return -EAGAIN; } if (cdev->drv && cdev->drv->set_online) - ccw_device_set_online(cdev); - return 0; + return ccw_device_set_online(cdev); + return -EINVAL; } static int online_store_handle_online(struct ccw_device *cdev, int force) |