mei: make return values consistent across the driver
1. Propagate ENOTTY to user space if the client is not present in the system 2. Use ETIME consistently on timeouts 3. Return EIO on write failures 4. Return ENODEV on recoverable device failures such as resets Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
9d098192c3
commit
7ca96aa278
@@ -53,7 +53,7 @@ static void mei_wd_set_start_timeout(struct mei_device *dev, u16 timeout)
|
||||
*
|
||||
* @dev: the device structure
|
||||
*
|
||||
* returns -ENENT if wd client cannot be found
|
||||
* returns -ENOTTY if wd client cannot be found
|
||||
* -EIO if write has failed
|
||||
* 0 on success
|
||||
*/
|
||||
@@ -73,7 +73,7 @@ int mei_wd_host_init(struct mei_device *dev)
|
||||
id = mei_me_cl_by_uuid(dev, &mei_wd_guid);
|
||||
if (id < 0) {
|
||||
dev_info(&dev->pdev->dev, "wd: failed to find the client\n");
|
||||
return id;
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
cl->me_client_id = dev->me_clients[id].client_id;
|
||||
@@ -185,7 +185,7 @@ int mei_wd_stop(struct mei_device *dev)
|
||||
ret = 0;
|
||||
} else {
|
||||
if (!ret)
|
||||
ret = -ETIMEDOUT;
|
||||
ret = -ETIME;
|
||||
dev_warn(&dev->pdev->dev,
|
||||
"wd: stop failed to complete ret=%d.\n", ret);
|
||||
}
|
||||
|
Reference in New Issue
Block a user