mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
HID: magicmouse: 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
6907c976ff
commit
230cdd8a5f
@ -60,7 +60,7 @@ MODULE_PARM_DESC(report_undeciphered, "Report undeciphered multi-touch state fie
|
||||
#define MOUSE_REPORT_ID 0x29
|
||||
#define MOUSE2_REPORT_ID 0x12
|
||||
#define DOUBLE_REPORT_ID 0xf7
|
||||
#define USB_BATTERY_TIMEOUT_MS 60000
|
||||
#define USB_BATTERY_TIMEOUT_SEC 60
|
||||
|
||||
/* These definitions are not precise, but they're close enough. (Bits
|
||||
* 0x03 seem to indicate the aspect ratio of the touch, bits 0x70 seem
|
||||
@ -841,7 +841,7 @@ static void magicmouse_battery_timer_tick(struct timer_list *t)
|
||||
|
||||
if (magicmouse_fetch_battery(hdev) == 0) {
|
||||
mod_timer(&msc->battery_timer,
|
||||
jiffies + msecs_to_jiffies(USB_BATTERY_TIMEOUT_MS));
|
||||
jiffies + secs_to_jiffies(USB_BATTERY_TIMEOUT_SEC));
|
||||
}
|
||||
}
|
||||
|
||||
@ -881,7 +881,7 @@ static int magicmouse_probe(struct hid_device *hdev,
|
||||
is_usb_magictrackpad2(id->vendor, id->product)) {
|
||||
timer_setup(&msc->battery_timer, magicmouse_battery_timer_tick, 0);
|
||||
mod_timer(&msc->battery_timer,
|
||||
jiffies + msecs_to_jiffies(USB_BATTERY_TIMEOUT_MS));
|
||||
jiffies + secs_to_jiffies(USB_BATTERY_TIMEOUT_SEC));
|
||||
magicmouse_fetch_battery(hdev);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user