Input: wacom - put a flag when the led are initialized
[firefly-linux-kernel-4.4.55.git] / drivers / hid / wacom_sys.c
index 06e304b3bbfdbbf08cd0d5b5804dd2b55e705e13..f1c6d3dae248dc1aa2862480704404a3859dd621 100644 (file)
@@ -729,12 +729,18 @@ static int wacom_initialize_leds(struct wacom *wacom)
                return error;
        }
        wacom_led_control(wacom);
+       wacom->led_initialized = true;
 
        return 0;
 }
 
 static void wacom_destroy_leds(struct wacom *wacom)
 {
+       if (!wacom->led_initialized)
+               return;
+
+       wacom->led_initialized = false;
+
        switch (wacom->wacom_wac.features.type) {
        case INTUOS4S:
        case INTUOS4: