• Christian Lamparter's avatar
    USB: leds: fix regression in usbport led trigger · f15b66e8
    Christian Lamparter authored
    commit 91f7d2e8 upstream.
    
    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 active usb hub ports under the
    "ports" directory in the sysfs class directory, if the usb host drivers
    are fully initialized before the usbport trigger was loaded.
    
    The reason is that the usbport driver tries to register the sysfs
    entries during the activate() callback. And this will fail with -2 /
    ENOENT because 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 version of the patch reverts parts of the "usb: simplify usbport
    trigger" patch and restores usbport trigger's functionality.
    
    Fixes: 6f7b0bad ("usb: simplify usbport trigger")
    Signed-off-by: default avatarChristian Lamparter <chunkeey@gmail.com>
    Cc: stable <stable@vger.kernel.org>
    Acked-by: default avatarJacek Anaszewski <jacek.anaszewski@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    f15b66e8
ledtrig-usbport.c 8.83 KB