]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
toshiba_acpi: Refactor *{get, set} functions return value
authorAzael Avalos <coproscefalo@gmail.com>
Sat, 1 Aug 2015 03:58:14 +0000 (21:58 -0600)
committerDarren Hart <dvhart@linux.intel.com>
Wed, 5 Aug 2015 09:08:03 +0000 (02:08 -0700)
commite1a949c1b9883d1d0586b0cbdd2c0cc3f55514bd
tree3f6890c542000b1c4611f55ecdf07b422364c4d4
parent0409cbced3c9ab975e300584b6cc036c26974b43
toshiba_acpi: Refactor *{get, set} functions return value

This patch refactors the return value of the driver *{get, set}
functions, since the driver default error value is -EIO.

All the functions now check for TOS_FAILURE, TOS_NOT_SUPPORTED and
TOS_SUCCESS.

On TOS_FAILURE a pr_err message is printed informing the user of the
error (no change was made to this, except the check was added to the
functions not checking for this).

On TOS_NOT_SUPPORTED we now return -ENODEV immediately (some
functions were returning -EIO and some other were not checking)

On TOS_SUCCESS* we now return 0 (as a side effect, a new success value
was added, since some functions return one instead of zero to
indicate success).

As a special case, the LED functions now check for *FAILURE on
*set, and check for TOS_FAILURE and TOS_SUCCESS on *get with their
"default" return value set to LED_OFF.

Also the {lcd, video}_proc* functions were adapted to reflect these
changes to their parent HCI functions.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
drivers/platform/x86/toshiba_acpi.c