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:

committad av
Greg Kroah-Hartman

förälder
9d098192c3
incheckning
7ca96aa278
@@ -244,7 +244,7 @@ static int mei_me_hw_ready_wait(struct mei_device *dev)
|
||||
mutex_lock(&dev->device_lock);
|
||||
if (!err && !dev->recvd_hw_ready) {
|
||||
if (!err)
|
||||
err = -ETIMEDOUT;
|
||||
err = -ETIME;
|
||||
dev_err(&dev->pdev->dev,
|
||||
"wait hw ready failed. status = %d\n", err);
|
||||
return err;
|
||||
@@ -303,7 +303,7 @@ static bool mei_me_hbuf_is_empty(struct mei_device *dev)
|
||||
*
|
||||
* @dev: the device structure
|
||||
*
|
||||
* returns -1(ESLOTS_OVERFLOW) if overflow, otherwise empty slots count
|
||||
* returns -EOVERFLOW if overflow, otherwise empty slots count
|
||||
*/
|
||||
static int mei_me_hbuf_empty_slots(struct mei_device *dev)
|
||||
{
|
||||
@@ -326,7 +326,7 @@ static size_t mei_me_hbuf_max_len(const struct mei_device *dev)
|
||||
|
||||
|
||||
/**
|
||||
* mei_write_message - writes a message to mei device.
|
||||
* mei_me_write_message - writes a message to mei device.
|
||||
*
|
||||
* @dev: the device structure
|
||||
* @header: mei HECI header of message
|
||||
@@ -381,7 +381,7 @@ static int mei_me_write_message(struct mei_device *dev,
|
||||
*
|
||||
* @dev: the device structure
|
||||
*
|
||||
* returns -1(ESLOTS_OVERFLOW) if overflow, otherwise filled slots count
|
||||
* returns -EOVERFLOW if overflow, otherwise filled slots count
|
||||
*/
|
||||
static int mei_me_count_full_read_slots(struct mei_device *dev)
|
||||
{
|
||||
|
Referens i nytt ärende
Block a user