[S390] cio: ccw device online store - report rc from ccw driver.
In case the ccw driver refuses to set a device offline, 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:
Родитель
c08f294a14
Коммит
e74fe0cec9
|
@ -457,12 +457,13 @@ int ccw_device_set_online(struct ccw_device *cdev)
|
||||||
return (ret == 0) ? -ENODEV : ret;
|
return (ret == 0) ? -ENODEV : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void online_store_handle_offline(struct ccw_device *cdev)
|
static int online_store_handle_offline(struct ccw_device *cdev)
|
||||||
{
|
{
|
||||||
if (cdev->private->state == DEV_STATE_DISCONNECTED)
|
if (cdev->private->state == DEV_STATE_DISCONNECTED)
|
||||||
ccw_device_remove_disconnected(cdev);
|
ccw_device_remove_disconnected(cdev);
|
||||||
else if (cdev->drv && cdev->drv->set_offline)
|
else if (cdev->online && cdev->drv && cdev->drv->set_offline)
|
||||||
ccw_device_set_offline(cdev);
|
return ccw_device_set_offline(cdev);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int online_store_recog_and_online(struct ccw_device *cdev)
|
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,
|
||||||
goto out;
|
goto out;
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0:
|
case 0:
|
||||||
online_store_handle_offline(cdev);
|
ret = online_store_handle_offline(cdev);
|
||||||
ret = count;
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
ret = online_store_handle_online(cdev, force);
|
ret = online_store_handle_online(cdev, force);
|
||||||
if (!ret)
|
|
||||||
ret = count;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
|
@ -545,7 +543,7 @@ out:
|
||||||
if (cdev->drv)
|
if (cdev->drv)
|
||||||
module_put(cdev->drv->owner);
|
module_put(cdev->drv->owner);
|
||||||
atomic_set(&cdev->private->onoff, 0);
|
atomic_set(&cdev->private->onoff, 0);
|
||||||
return ret;
|
return (ret < 0) ? ret : count;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
|
|
Загрузка…
Ссылка в новой задаче