diff options
author | Alexander Usyskin <alexander.usyskin@intel.com> | 2014-02-19 10:35:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-28 18:15:57 -0500 |
commit | 7ca96aa278f8b9983184e318b06a0ed9ad0297b8 (patch) | |
tree | b01220d624e9fbf70258a96890be25b56405c11e /drivers/misc/mei/wd.c | |
parent | 9d098192c3d45ab6dd90ae87d649950a9ef70ccb (diff) |
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>
Diffstat (limited to 'drivers/misc/mei/wd.c')
-rw-r--r-- | drivers/misc/mei/wd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/mei/wd.c b/drivers/misc/mei/wd.c index afe976a18586..4644b62e9055 100644 --- a/drivers/misc/mei/wd.c +++ b/drivers/misc/mei/wd.c | |||
@@ -53,7 +53,7 @@ static void mei_wd_set_start_timeout(struct mei_device *dev, u16 timeout) | |||
53 | * | 53 | * |
54 | * @dev: the device structure | 54 | * @dev: the device structure |
55 | * | 55 | * |
56 | * returns -ENENT if wd client cannot be found | 56 | * returns -ENOTTY if wd client cannot be found |
57 | * -EIO if write has failed | 57 | * -EIO if write has failed |
58 | * 0 on success | 58 | * 0 on success |
59 | */ | 59 | */ |
@@ -73,7 +73,7 @@ int mei_wd_host_init(struct mei_device *dev) | |||
73 | id = mei_me_cl_by_uuid(dev, &mei_wd_guid); | 73 | id = mei_me_cl_by_uuid(dev, &mei_wd_guid); |
74 | if (id < 0) { | 74 | if (id < 0) { |
75 | dev_info(&dev->pdev->dev, "wd: failed to find the client\n"); | 75 | dev_info(&dev->pdev->dev, "wd: failed to find the client\n"); |
76 | return id; | 76 | return -ENOTTY; |
77 | } | 77 | } |
78 | 78 | ||
79 | cl->me_client_id = dev->me_clients[id].client_id; | 79 | cl->me_client_id = dev->me_clients[id].client_id; |
@@ -185,7 +185,7 @@ int mei_wd_stop(struct mei_device *dev) | |||
185 | ret = 0; | 185 | ret = 0; |
186 | } else { | 186 | } else { |
187 | if (!ret) | 187 | if (!ret) |
188 | ret = -ETIMEDOUT; | 188 | ret = -ETIME; |
189 | dev_warn(&dev->pdev->dev, | 189 | dev_warn(&dev->pdev->dev, |
190 | "wd: stop failed to complete ret=%d.\n", ret); | 190 | "wd: stop failed to complete ret=%d.\n", ret); |
191 | } | 191 | } |