diff options
author | Christian Lamparter <chunkeey@gmail.com> | 2019-01-18 13:51:09 +0100 |
---|---|---|
committer | Christian Lamparter <chunkeey@gmail.com> | 2019-01-24 15:53:03 +0100 |
commit | b5f6ede3c4e4f7cc0d2127982a0ad320d8ebd164 (patch) | |
tree | 879eea434c51729f1e36b7dbce5333a416af54a3 /target/linux/generic/hack-4.19/160-leds-fix-regression-in-usbport-led-trigger.patch | |
parent | 6928d06a7edabf7679c4f69a50051d891084e1d9 (diff) | |
download | upstream-b5f6ede3c4e4f7cc0d2127982a0ad320d8ebd164.tar.gz upstream-b5f6ede3c4e4f7cc0d2127982a0ad320d8ebd164.tar.bz2 upstream-b5f6ede3c4e4f7cc0d2127982a0ad320d8ebd164.zip |
kernel: 4.19: use upstream usbport led trigger fix
This patch replaces the current hack with a better
version of the RFC patch has been accepted upstream.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'target/linux/generic/hack-4.19/160-leds-fix-regression-in-usbport-led-trigger.patch')
-rw-r--r-- | target/linux/generic/hack-4.19/160-leds-fix-regression-in-usbport-led-trigger.patch | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/target/linux/generic/hack-4.19/160-leds-fix-regression-in-usbport-led-trigger.patch b/target/linux/generic/hack-4.19/160-leds-fix-regression-in-usbport-led-trigger.patch deleted file mode 100644 index e24cac3ddd..0000000000 --- a/target/linux/generic/hack-4.19/160-leds-fix-regression-in-usbport-led-trigger.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 38a3549ffc0033761063cc5c7b994ab075694db8 Mon Sep 17 00:00:00 2001 -From: Christian Lamparter <chunkeey@gmail.com> -Date: Tue, 25 Dec 2018 21:11:08 +0100 -Subject: [RFC PATCH] leds: fix regression in usbport led trigger - -In the patch "usb: simplify usbport trigger" together with -"leds: triggers: add device attribute support" caused an -regression for the usbport trigger. it will no longer -enumerate any "ports" (i.e the sysfs directory stays empty) -if the usb host drivers are fully initialized before the -usbport trigger was loaded. - -The reason is that the usbport driver registers the sysfs -entries in the ports subdirectory during the activate() -callback. Whereas the patch -"leds: triggers: add device attribute support" made it so -that the sysfs "ports" group was only being added after -the activate() callback succeeded. - -This patch moves the device_add_groups() in front of the -call to the trigger's activate() function in order to -solve the problem. - -Fixes: 6f7b0bad8839 ("usb: simplify usbport trigger") -Signed-off-by: Christian Lamparter <chunkeey@gmail.com> ---- - drivers/leds/led-triggers.c | 19 ++++++++++--------- - 1 file changed, 10 insertions(+), 9 deletions(-) - ---- a/drivers/leds/led-triggers.c -+++ b/drivers/leds/led-triggers.c -@@ -134,6 +134,12 @@ int led_trigger_set(struct led_classdev - led_set_brightness(led_cdev, LED_OFF); - } - if (trig) { -+ ret = device_add_groups(led_cdev->dev, trig->groups); -+ if (ret) { -+ dev_err(led_cdev->dev, "Failed to add trigger attributes\n"); -+ goto err_add_groups; -+ } -+ - write_lock_irqsave(&trig->leddev_list_lock, flags); - list_add_tail(&led_cdev->trig_list, &trig->led_cdevs); - write_unlock_irqrestore(&trig->leddev_list_lock, flags); -@@ -146,12 +152,6 @@ int led_trigger_set(struct led_classdev - - if (ret) - goto err_activate; -- -- ret = device_add_groups(led_cdev->dev, trig->groups); -- if (ret) { -- dev_err(led_cdev->dev, "Failed to add trigger attributes\n"); -- goto err_add_groups; -- } - } - - if (event) { -@@ -165,17 +165,18 @@ int led_trigger_set(struct led_classdev - - return 0; - --err_add_groups: -- -+err_activate: -+ device_remove_groups(led_cdev->dev, trig->groups); - if (trig->deactivate) - trig->deactivate(led_cdev); --err_activate: - - led_cdev->trigger = NULL; - led_cdev->trigger_data = NULL; - write_lock_irqsave(&led_cdev->trigger->leddev_list_lock, flags); - list_del(&led_cdev->trig_list); - write_unlock_irqrestore(&led_cdev->trigger->leddev_list_lock, flags); -+ -+err_add_groups: - led_set_brightness(led_cdev, LED_OFF); - - return ret; |