提交 7cd40314 编写于 作者: S Sebastian Ott 提交者: Martin Schwidefsky

[S390] cio: ccw_device_online_store return -EINVAL in case of missing driver

If no driver is attached to a device or the driver provides no
set_online/set_offline function, setting this device online/offline
via its sysfs online attribute will silently fail but return success.

This patch changes the behavior to return -EINVAL in those cases.
Signed-off-by: NSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 dbedd0ee
...@@ -487,9 +487,11 @@ static int online_store_handle_offline(struct ccw_device *cdev) ...@@ -487,9 +487,11 @@ static int online_store_handle_offline(struct ccw_device *cdev)
spin_lock_irq(cdev->ccwlock); spin_lock_irq(cdev->ccwlock);
ccw_device_sched_todo(cdev, CDEV_TODO_UNREG_EVAL); ccw_device_sched_todo(cdev, CDEV_TODO_UNREG_EVAL);
spin_unlock_irq(cdev->ccwlock); spin_unlock_irq(cdev->ccwlock);
} else if (cdev->online && cdev->drv && cdev->drv->set_offline) return 0;
}
if (cdev->drv && cdev->drv->set_offline)
return ccw_device_set_offline(cdev); return ccw_device_set_offline(cdev);
return 0; return -EINVAL;
} }
static int online_store_recog_and_online(struct ccw_device *cdev) static int online_store_recog_and_online(struct ccw_device *cdev)
...@@ -506,8 +508,8 @@ static int online_store_recog_and_online(struct ccw_device *cdev) ...@@ -506,8 +508,8 @@ static int online_store_recog_and_online(struct ccw_device *cdev)
return -EAGAIN; return -EAGAIN;
} }
if (cdev->drv && cdev->drv->set_online) if (cdev->drv && cdev->drv->set_online)
ccw_device_set_online(cdev); return ccw_device_set_online(cdev);
return 0; return -EINVAL;
} }
static int online_store_handle_online(struct ccw_device *cdev, int force) static int online_store_handle_online(struct ccw_device *cdev, int force)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册