From c757cbafd6afe8e47d12320aa05edcd1b1d97186 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Thu, 24 Jul 2014 13:16:17 -0700 Subject: Input: wacom - put a flag when the led are initialized This solves a bug with the wireless receiver: - at plug, the wireless receiver does not know which Wacom device it is connected to, so it does not actually creates all the LEDs - when the tablet connects, wacom->wacom_wac.features.type is set to the proper device so that wacom_wac can understand the packets - when the receiver is unplugged, it detects that a LED should have been created (based on wacom->wacom_wac.features.type) and tries to remove it: crash when removing the sysfs group. Side effect, we can now safely call several times wacom_destroy_leds(). Signed-off-by: Benjamin Tissoires Acked-by: Ping Cheng Signed-off-by: Dmitry Torokhov --- drivers/hid/wacom.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/hid/wacom.h') diff --git a/drivers/hid/wacom.h b/drivers/hid/wacom.h index dd67b7d..a678f82 100644 --- a/drivers/hid/wacom.h +++ b/drivers/hid/wacom.h @@ -118,6 +118,7 @@ struct wacom { u8 hlv; /* status led brightness button pressed (1..127) */ u8 img_lum; /* OLED matrix display brightness */ } led; + bool led_initialized; struct power_supply battery; }; -- cgit v1.1