diff options
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r-- | drivers/s390/cio/device.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 71b3b73e8ebe..9be6dd5a5664 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -457,12 +457,13 @@ int ccw_device_set_online(struct ccw_device *cdev) | |||
457 | return (ret == 0) ? -ENODEV : ret; | 457 | return (ret == 0) ? -ENODEV : ret; |
458 | } | 458 | } |
459 | 459 | ||
460 | static void online_store_handle_offline(struct ccw_device *cdev) | 460 | static int online_store_handle_offline(struct ccw_device *cdev) |
461 | { | 461 | { |
462 | if (cdev->private->state == DEV_STATE_DISCONNECTED) | 462 | if (cdev->private->state == DEV_STATE_DISCONNECTED) |
463 | ccw_device_remove_disconnected(cdev); | 463 | ccw_device_remove_disconnected(cdev); |
464 | else if (cdev->drv && cdev->drv->set_offline) | 464 | else if (cdev->online && cdev->drv && cdev->drv->set_offline) |
465 | ccw_device_set_offline(cdev); | 465 | return ccw_device_set_offline(cdev); |
466 | return 0; | ||
466 | } | 467 | } |
467 | 468 | ||
468 | static int online_store_recog_and_online(struct ccw_device *cdev) | 469 | static int online_store_recog_and_online(struct ccw_device *cdev) |
@@ -530,13 +531,10 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr, | |||
530 | goto out; | 531 | goto out; |
531 | switch (i) { | 532 | switch (i) { |
532 | case 0: | 533 | case 0: |
533 | online_store_handle_offline(cdev); | 534 | ret = online_store_handle_offline(cdev); |
534 | ret = count; | ||
535 | break; | 535 | break; |
536 | case 1: | 536 | case 1: |
537 | ret = online_store_handle_online(cdev, force); | 537 | ret = online_store_handle_online(cdev, force); |
538 | if (!ret) | ||
539 | ret = count; | ||
540 | break; | 538 | break; |
541 | default: | 539 | default: |
542 | ret = -EINVAL; | 540 | ret = -EINVAL; |
@@ -545,7 +543,7 @@ out: | |||
545 | if (cdev->drv) | 543 | if (cdev->drv) |
546 | module_put(cdev->drv->owner); | 544 | module_put(cdev->drv->owner); |
547 | atomic_set(&cdev->private->onoff, 0); | 545 | atomic_set(&cdev->private->onoff, 0); |
548 | return ret; | 546 | return (ret < 0) ? ret : count; |
549 | } | 547 | } |
550 | 548 | ||
551 | static ssize_t | 549 | static ssize_t |