mirror of https://github.com/torvalds/linux.git
HID: apple: use secs_to_jiffies() for battery timeout
The kernel now has a secs_to_jiffies() function which expands to a simpler code than msecs_to_jiffies(). Use the same for battery timeout which was using 60000 milliseconds (60 seconds). Signed-off-by: Aditya Garg <gargaditya08@live.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
9bdc30e35c
commit
6907c976ff
|
|
@ -46,7 +46,7 @@
|
|||
#define APPLE_FLAG_FKEY 0x01
|
||||
|
||||
#define HID_COUNTRY_INTERNATIONAL_ISO 13
|
||||
#define APPLE_BATTERY_TIMEOUT_MS 60000
|
||||
#define APPLE_BATTERY_TIMEOUT_SEC 60
|
||||
|
||||
#define HID_USAGE_MAGIC_BL 0xff00000f
|
||||
#define APPLE_MAGIC_REPORT_ID_POWER 3
|
||||
|
|
@ -619,7 +619,7 @@ static void apple_battery_timer_tick(struct timer_list *t)
|
|||
|
||||
if (apple_fetch_battery(hdev) == 0) {
|
||||
mod_timer(&asc->battery_timer,
|
||||
jiffies + msecs_to_jiffies(APPLE_BATTERY_TIMEOUT_MS));
|
||||
jiffies + secs_to_jiffies(APPLE_BATTERY_TIMEOUT_SEC));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -936,7 +936,7 @@ static int apple_probe(struct hid_device *hdev,
|
|||
if (quirks & APPLE_RDESC_BATTERY) {
|
||||
timer_setup(&asc->battery_timer, apple_battery_timer_tick, 0);
|
||||
mod_timer(&asc->battery_timer,
|
||||
jiffies + msecs_to_jiffies(APPLE_BATTERY_TIMEOUT_MS));
|
||||
jiffies + secs_to_jiffies(APPLE_BATTERY_TIMEOUT_SEC));
|
||||
apple_fetch_battery(hdev);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue