Skip to content

Commit

Permalink
HID: nintendo: deregister home LED when it fails
Browse files Browse the repository at this point in the history
Some Pro Controller compatible controllers do not support home LED, and
will fail when setting it. Currently this leads to probe failure.

Change the code that fails probing to deregistering home LED.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Daniel J. Ogorchock <djogorchock@gmail.com>
Reviewed-by: Silvan Jegen <s.jegen@gmail.com>
[bentiss: changed "dflt" to "default"]
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20220415100432.23453-1-icenowy@aosc.io
  • Loading branch information
Icenowy authored and bentiss committed Sep 21, 2022
1 parent a1f7642 commit 8b30fb4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/hid/hid-nintendo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1904,9 +1904,8 @@ static int joycon_leds_create(struct joycon_ctlr *ctlr)
/* Set the home LED to 0 as default state */
ret = joycon_home_led_brightness_set(led, 0);
if (ret) {
hid_err(hdev, "Failed to set home LED dflt; ret=%d\n",
ret);
return ret;
hid_warn(hdev, "Failed to set home LED default, unregistering home LED");
devm_led_classdev_unregister(&hdev->dev, led);
}
}

Expand Down

0 comments on commit 8b30fb4

Please sign in to comment.