diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2009-03-26 10:24:13 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-03-26 10:24:15 -0400 |
commit | 40c9f9992bc1caa1bb890bd8163361dbf2eefa86 (patch) | |
tree | 30f8617e481178dcf55dbe43d5c27fdb7d4baaa7 /drivers/s390/cio/ccwgroup.c | |
parent | a1f640734ab57d548a3fdadad6b869da534d4ecb (diff) |
[S390] cio: ccw group online store - report rcs to the caller.
In case the ccw group driver refuses to set a device [on|off]line,
we should transmit the return code to the caller.
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/ccwgroup.c')
-rw-r--r-- | drivers/s390/cio/ccwgroup.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index 918e6fce2573..ec2742813bf2 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c | |||
@@ -391,27 +391,28 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const | |||
391 | unsigned long value; | 391 | unsigned long value; |
392 | int ret; | 392 | int ret; |
393 | 393 | ||
394 | gdev = to_ccwgroupdev(dev); | ||
395 | if (!dev->driver) | 394 | if (!dev->driver) |
396 | return count; | 395 | return -ENODEV; |
396 | |||
397 | gdev = to_ccwgroupdev(dev); | ||
398 | gdrv = to_ccwgroupdrv(dev->driver); | ||
397 | 399 | ||
398 | gdrv = to_ccwgroupdrv (gdev->dev.driver); | ||
399 | if (!try_module_get(gdrv->owner)) | 400 | if (!try_module_get(gdrv->owner)) |
400 | return -EINVAL; | 401 | return -EINVAL; |
401 | 402 | ||
402 | ret = strict_strtoul(buf, 0, &value); | 403 | ret = strict_strtoul(buf, 0, &value); |
403 | if (ret) | 404 | if (ret) |
404 | goto out; | 405 | goto out; |
405 | ret = count; | 406 | |
406 | if (value == 1) | 407 | if (value == 1) |
407 | ccwgroup_set_online(gdev); | 408 | ret = ccwgroup_set_online(gdev); |
408 | else if (value == 0) | 409 | else if (value == 0) |
409 | ccwgroup_set_offline(gdev); | 410 | ret = ccwgroup_set_offline(gdev); |
410 | else | 411 | else |
411 | ret = -EINVAL; | 412 | ret = -EINVAL; |
412 | out: | 413 | out: |
413 | module_put(gdrv->owner); | 414 | module_put(gdrv->owner); |
414 | return ret; | 415 | return (ret == 0) ? count : ret; |
415 | } | 416 | } |
416 | 417 | ||
417 | static ssize_t | 418 | static ssize_t |