[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>
This commit is contained in:
parent
a1f640734a
commit
40c9f9992b
@ -391,27 +391,28 @@ ccwgroup_online_store (struct device *dev, struct device_attribute *attr, const
|
|||||||
unsigned long value;
|
unsigned long value;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
gdev = to_ccwgroupdev(dev);
|
|
||||||
if (!dev->driver)
|
if (!dev->driver)
|
||||||
return count;
|
return -ENODEV;
|
||||||
|
|
||||||
|
gdev = to_ccwgroupdev(dev);
|
||||||
|
gdrv = to_ccwgroupdrv(dev->driver);
|
||||||
|
|
||||||
gdrv = to_ccwgroupdrv (gdev->dev.driver);
|
|
||||||
if (!try_module_get(gdrv->owner))
|
if (!try_module_get(gdrv->owner))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ret = strict_strtoul(buf, 0, &value);
|
ret = strict_strtoul(buf, 0, &value);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
ret = count;
|
|
||||||
if (value == 1)
|
if (value == 1)
|
||||||
ccwgroup_set_online(gdev);
|
ret = ccwgroup_set_online(gdev);
|
||||||
else if (value == 0)
|
else if (value == 0)
|
||||||
ccwgroup_set_offline(gdev);
|
ret = ccwgroup_set_offline(gdev);
|
||||||
else
|
else
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
out:
|
out:
|
||||||
module_put(gdrv->owner);
|
module_put(gdrv->owner);
|
||||||
return ret;
|
return (ret == 0) ? count : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
|
Loading…
Reference in New Issue
Block a user