]> git.baikalelectronics.ru Git - kernel.git/commit
HID: wacom: leds: actually release the LEDs on disconnect
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Wed, 13 Jul 2016 16:06:11 +0000 (18:06 +0200)
committerJiri Kosina <jkosina@suse.cz>
Fri, 5 Aug 2016 11:39:19 +0000 (13:39 +0200)
commitab1ee64bd168f3c6b129236f4f7d198651b959d4
tree4188bd6d26b9f19f1101eeac5c83714f261a348b
parent7c9948ef8fa8c34f1d2a2f132ea7c2b3612f2c6a
HID: wacom: leds: actually release the LEDs on disconnect

There is a bug (?) in devm_led_classdev_register() in which its increments
the refcount of the parent. If the parent is an input device, that means
the ref count never reaches 0 when devm_input_device_release() gets called.
This means that the LEDs and all the devres resources attached to the
input device are not released.

Manually force the release of the group so that the leds are released once
we are done using them.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/wacom.h
drivers/hid/wacom_sys.c