diff options
| author | Axel Lin <axel.lin@gmail.com> | 2010-07-06 20:21:48 -0400 |
|---|---|---|
| committer | Matthew Garrett <mjg@redhat.com> | 2010-08-03 09:49:05 -0400 |
| commit | 9fab10cdf58099beff08d74f6b4a6633305c5754 (patch) | |
| tree | ffa644369eec4f8a7c4aa0ca3d30286fa2106477 | |
| parent | bfa47960f957c021a4d626b051668d2f66cadf23 (diff) | |
panasonic-laptop: fix acpi_pcc_write_sset return value
In current implementation, acpi_pcc_write_sset return 1
if write is successful, 0 if write is failed.
But all the callers consider acpi_pcc_write_sset return 0
if write is successful and return negtive if write is failed.
This patch changes the implementation of acpi_pcc_write_sset to
return 0 if write is successful, -EIO if write is failed.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
| -rw-r--r-- | drivers/platform/x86/panasonic-laptop.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 2fb9a32926f8..ec01c3d8fc5a 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c | |||
| @@ -248,7 +248,7 @@ static int acpi_pcc_write_sset(struct pcc_acpi *pcc, int func, int val) | |||
| 248 | status = acpi_evaluate_object(pcc->handle, METHOD_HKEY_SSET, | 248 | status = acpi_evaluate_object(pcc->handle, METHOD_HKEY_SSET, |
| 249 | ¶ms, NULL); | 249 | ¶ms, NULL); |
| 250 | 250 | ||
| 251 | return status == AE_OK; | 251 | return (status == AE_OK) ? 0 : -EIO; |
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | static inline int acpi_pcc_get_sqty(struct acpi_device *device) | 254 | static inline int acpi_pcc_get_sqty(struct acpi_device *device) |
| @@ -586,7 +586,6 @@ static int acpi_pcc_init_input(struct pcc_acpi *pcc) | |||
| 586 | static int acpi_pcc_hotkey_resume(struct acpi_device *device) | 586 | static int acpi_pcc_hotkey_resume(struct acpi_device *device) |
| 587 | { | 587 | { |
| 588 | struct pcc_acpi *pcc = acpi_driver_data(device); | 588 | struct pcc_acpi *pcc = acpi_driver_data(device); |
| 589 | acpi_status status = AE_OK; | ||
| 590 | 589 | ||
| 591 | if (device == NULL || pcc == NULL) | 590 | if (device == NULL || pcc == NULL) |
| 592 | return -EINVAL; | 591 | return -EINVAL; |
| @@ -594,9 +593,7 @@ static int acpi_pcc_hotkey_resume(struct acpi_device *device) | |||
| 594 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Sticky mode restore: %d\n", | 593 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Sticky mode restore: %d\n", |
| 595 | pcc->sticky_mode)); | 594 | pcc->sticky_mode)); |
| 596 | 595 | ||
| 597 | status = acpi_pcc_write_sset(pcc, SINF_STICKY_KEY, pcc->sticky_mode); | 596 | return acpi_pcc_write_sset(pcc, SINF_STICKY_KEY, pcc->sticky_mode); |
| 598 | |||
| 599 | return status == AE_OK ? 0 : -EINVAL; | ||
| 600 | } | 597 | } |
| 601 | 598 | ||
| 602 | static int acpi_pcc_hotkey_add(struct acpi_device *device) | 599 | static int acpi_pcc_hotkey_add(struct acpi_device *device) |
