aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/device.c
diff options
context:
space:
mode:
authorPeter Oberparleiter <peter.oberparleiter@de.ibm.com>2009-12-07 06:51:28 -0500
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2009-12-07 06:51:31 -0500
commit350e91207bc9c6a464c22b9e0e30d21dfc07efe3 (patch)
tree537c4ef8acd05d8a5e1c9e18b0b3f902d940f0f7 /drivers/s390/cio/device.c
parent9679baaf85b6e4dc662160bbbca344287ea6580d (diff)
[S390] cio: allow setting not-operational devices offline
Accept a request for setting a not-operational device offline. This way, users can remove devices from Linux which would otherwise remain unusable until reboot. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r--drivers/s390/cio/device.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 6a9ac85065ed..9af864f615b0 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -529,11 +529,10 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr,
529 int force, ret; 529 int force, ret;
530 unsigned long i; 530 unsigned long i;
531 531
532 if ((cdev->private->state != DEV_STATE_OFFLINE && 532 if (!dev_fsm_final_state(cdev) &&
533 cdev->private->state != DEV_STATE_ONLINE && 533 cdev->private->state != DEV_STATE_DISCONNECTED)
534 cdev->private->state != DEV_STATE_BOXED && 534 return -EAGAIN;
535 cdev->private->state != DEV_STATE_DISCONNECTED) || 535 if (atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0)
536 atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0)
537 return -EAGAIN; 536 return -EAGAIN;
538 537
539 if (cdev->drv && !try_module_get(cdev->drv->owner)) { 538 if (cdev->drv && !try_module_get(cdev->drv->owner)) {