diff options
| author | Aditya Garg <gargaditya08@live.com> | 2025-06-30 12:37:14 +0000 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.com> | 2025-07-03 09:41:56 +0200 |
| commit | 6907c976fff38710406fa148cd82e892e7292d56 (patch) | |
| tree | c76848bf4e167bb7852f0b646d78353a1c4746db | |
| parent | 9bdc30e35cbc1aa78ccf01040354209f1e11ca22 (diff) | |
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>
| -rw-r--r-- | drivers/hid/hid-apple.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index 8ab15a8f3524..321475843fe7 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c @@ -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); } |