diff options
author | Maxim Mikityanskiy <maxtram95@gmail.com> | 2012-12-15 12:31:25 -0500 |
---|---|---|
committer | Matthew Garrett <matthew.garrett@nebula.com> | 2013-02-24 17:49:53 -0500 |
commit | 27eb9e7f1211ecab64027113478867adfed6a7c8 (patch) | |
tree | 6afa5ebdc2302dffaa88144a1d02dfd9dda63d3c /drivers/platform/x86 | |
parent | 6cae06e603339f99334bc6b276e2ac619cf0d476 (diff) |
msi-laptop: Use proper return codes instead of -1
Use proper function return codes instead of -1
Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/msi-laptop.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c index 2111dbb7e1e3..063113ca299e 100644 --- a/drivers/platform/x86/msi-laptop.c +++ b/drivers/platform/x86/msi-laptop.c | |||
@@ -198,7 +198,7 @@ static ssize_t set_device_state(const char *buf, size_t count, u8 mask) | |||
198 | /* read current device state */ | 198 | /* read current device state */ |
199 | result = ec_read(MSI_STANDARD_EC_COMMAND_ADDRESS, &rdata); | 199 | result = ec_read(MSI_STANDARD_EC_COMMAND_ADDRESS, &rdata); |
200 | if (result < 0) | 200 | if (result < 0) |
201 | return -EINVAL; | 201 | return result; |
202 | 202 | ||
203 | if (!!(rdata & mask) != status) { | 203 | if (!!(rdata & mask) != status) { |
204 | /* reverse device bit */ | 204 | /* reverse device bit */ |
@@ -209,7 +209,7 @@ static ssize_t set_device_state(const char *buf, size_t count, u8 mask) | |||
209 | 209 | ||
210 | result = ec_write(MSI_STANDARD_EC_COMMAND_ADDRESS, wdata); | 210 | result = ec_write(MSI_STANDARD_EC_COMMAND_ADDRESS, wdata); |
211 | if (result < 0) | 211 | if (result < 0) |
212 | return -EINVAL; | 212 | return result; |
213 | } | 213 | } |
214 | 214 | ||
215 | return count; | 215 | return count; |
@@ -222,7 +222,7 @@ static int get_wireless_state(int *wlan, int *bluetooth) | |||
222 | 222 | ||
223 | result = ec_transaction(MSI_EC_COMMAND_WIRELESS, &wdata, 1, &rdata, 1); | 223 | result = ec_transaction(MSI_EC_COMMAND_WIRELESS, &wdata, 1, &rdata, 1); |
224 | if (result < 0) | 224 | if (result < 0) |
225 | return -1; | 225 | return result; |
226 | 226 | ||
227 | if (wlan) | 227 | if (wlan) |
228 | *wlan = !!(rdata & 8); | 228 | *wlan = !!(rdata & 8); |
@@ -240,7 +240,7 @@ static int get_wireless_state_ec_standard(void) | |||
240 | 240 | ||
241 | result = ec_read(MSI_STANDARD_EC_COMMAND_ADDRESS, &rdata); | 241 | result = ec_read(MSI_STANDARD_EC_COMMAND_ADDRESS, &rdata); |
242 | if (result < 0) | 242 | if (result < 0) |
243 | return -1; | 243 | return result; |
244 | 244 | ||
245 | wlan_s = !!(rdata & MSI_STANDARD_EC_WLAN_MASK); | 245 | wlan_s = !!(rdata & MSI_STANDARD_EC_WLAN_MASK); |
246 | 246 | ||
@@ -258,7 +258,7 @@ static int get_threeg_exists(void) | |||
258 | 258 | ||
259 | result = ec_read(MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS, &rdata); | 259 | result = ec_read(MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS, &rdata); |
260 | if (result < 0) | 260 | if (result < 0) |
261 | return -1; | 261 | return result; |
262 | 262 | ||
263 | threeg_exists = !!(rdata & MSI_STANDARD_EC_3G_MASK); | 263 | threeg_exists = !!(rdata & MSI_STANDARD_EC_3G_MASK); |
264 | 264 | ||
@@ -343,7 +343,7 @@ static ssize_t show_threeg(struct device *dev, | |||
343 | 343 | ||
344 | /* old msi ec not support 3G */ | 344 | /* old msi ec not support 3G */ |
345 | if (old_ec_model) | 345 | if (old_ec_model) |
346 | return -1; | 346 | return -ENODEV; |
347 | 347 | ||
348 | ret = get_wireless_state_ec_standard(); | 348 | ret = get_wireless_state_ec_standard(); |
349 | if (ret < 0) | 349 | if (ret < 0) |