@@ -3083,6 +3083,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
static void sony_remove(struct hid_device *hdev)
{
struct sony_sc *sc = hid_get_drvdata(hdev);
+ int n;
if (sc->quirks & (GHL_GUITAR_PS3WIIU | GHL_GUITAR_PS4)) {
del_timer_sync(&sc->ghl_poke_timer);
@@ -3100,6 +3101,13 @@ static void sony_remove(struct hid_device *hdev)
if (sc->hw_version_created)
device_remove_file(&sc->hdev->dev, &dev_attr_hardware_version);
+ if (sc->quirks & SONY_LED_SUPPORT) {
+ for (n = 0; n < sc->led_count; n++) {
+ if (sc->leds[n])
+ devm_led_classdev_unregister(&hdev->dev, sc->leds[n]);
+ }
+ }
+
sony_cancel_work_sync(sc);
sony_remove_dev_list(sc);