mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
HID: steelseries: Manage battery lifetime with refcounting
The next change shares one steelseries_device between two HID interfaces, so the state can outlive either interface. Stop using devm for it. Reference count the struct with a kref and free it from steelseries_device_release(). Register and unregister the power supply explicitly, and clear sd->battery under sd->lock in remove() so it is not touched after it is unregistered. Drop the global atomic battery counter and name the power supply after the device (hdev->uniq, or dev_name() when empty), as hid-input and the other HID battery drivers do. No functional change for the current single-interface devices. Signed-off-by: Sriman Achanta <srimanachanta@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
b8ae111432
commit
9bc171302f
1 changed files with 36 additions and 11 deletions
Loading…
Add table
Add a link
Reference in a new issue