summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-08-16 14:10:03 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-08-16 14:20:31 +0300
commit2275752004ab216c667cfdba378c5199f9068e96 (patch)
treec3cef5cd834a36a434cb8960cc7d2a2a582c1bef /drivers/platform
parenta5556fa1107d5b9cda75632c6ece1b4612dd1607 (diff)
platform/x86: asus-wmi: Use clamp_val() instead of open coded variant
There is no need to open code clamp_val() macro implementation. Replace the corresponding lines with direct call to clamp_val(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/asus-wmi.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 6b1f661a6ce6..42dc2db775d1 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -464,12 +464,7 @@ static void do_kbd_led_set(struct led_classdev *led_cdev, int value)
asus = container_of(led_cdev, struct asus_wmi, kbd_led);
max_level = asus->kbd_led.max_brightness;
- if (value > max_level)
- value = max_level;
- else if (value < 0)
- value = 0;
-
- asus->kbd_led_wk = value;
+ asus->kbd_led_wk = clamp_val(value, 0, max_level);
kbd_led_update(asus);
}