]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: magicmouse: avoid setting up battery timer when not needed
authorAditya Garg <gargaditya08@live.com>
Mon, 30 Jun 2025 12:37:13 +0000 (12:37 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:26:05 +0000 (16:26 +0200)
commitd7a759d0e28a9bc50c2b50bedd7c98636cb85e9c
tree20ed6c8718e86933cc49de41f51e43871a26dc00
parent09dac4c15121889e1017b896562fb4255bff7e03
HID: magicmouse: avoid setting up battery timer when not needed

commit 9bdc30e35cbc1aa78ccf01040354209f1e11ca22 upstream.

Currently, the battery timer is set up for all devices using
hid-magicmouse, irrespective of whether they actually need it or not.

The current implementation requires the battery timer for Magic Mouse 2
and Magic Trackpad 2 when connected via USB only. Add checks to ensure
that the battery timer is only set up when they are connected via USB.

Fixes: 0b91b4e4dae6 ("HID: magicmouse: Report battery level over USB")
Cc: stable@vger.kernel.org
Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-magicmouse.c