diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-09-03 15:44:37 +0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2014-09-03 21:45:12 +0400 |
commit | aeaac098bd58349d7415acd998089309fd798190 (patch) | |
tree | f44c231d53de46e5994d35c9974dd1127837f20e /drivers/acpi | |
parent | e7fdb762b9e1e10c3271e47723b2003330829ddf (diff) | |
download | linux-aeaac098bd58349d7415acd998089309fd798190.tar.xz |
toshiba_acpi: fix and cleanup toshiba_kbd_bl_mode_store()
The current code just returns -EINVAL because mode can't be equal to
both 1 and 2.
Also this function is messy so I have cleaned it up:
1) Remove initializers like "int time = -1". Initializing variables to
garbage values turns off GCC's uninitialized variable warnings so it
can lead to bugs.
2) Use kstrtoint() instead of sscanf().
3) Use SCI_KBD_MODE_FNZ and SCI_KBD_MODE_AUTO instead of magic numbers 1
and 2.
4) Don't check for "mode == -1" because that can't happen.
5) Preserve the error code from toshiba_kbd_illum_status_set().
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/acpi')
0 files changed, 0 insertions, 0 deletions