Hello, this series expands led-triggers.c to know about device attributes and allows the activate callback to report failure. Further I added some automatic handling of .trigger_data and .activated. (IMHO the latter isn't needed any more and could be removed.) The attribute handling that I introduced does forbidden stuff (adding attributes to already registered devices). But it is not worse than every trigger doing the same and having it in a central place instead allows to fix it more easily in the future. For that I introduced a few helper functions that can be adapted once the trigger stuff moves to a dedicated device without touching all attribute code again. Compared to (implicit) v1, the following is new: - module_led_trigger() to simplify registration of simple triggers - led_set_trigger_data() complementing led_get_trigger_data and converting all drivers to use these - adapted all triggers not only a few as examples (note I didn't touch the can driver that I removed in another series) I didn't Cc: the respective trigger-driver maintainers as the changes to the individual drivers depend on the core changes that I'd like to have settled first. Uwe Kleine-König (16): leds: triggers: let struct led_trigger::activate return an error code leds: triggers: add device attribute support leds: triggers: handle .trigger_data and .activated in the core leds: triggers: define module_led_trigger helper leds: triggers: new function led_set_trigger_data leds: netdev trigger: simplifications from core changes leds: timer trigger: simplifications from core changes leds: transient trigger: simplifications from core changes leds: oneshot trigger: simplifications from core changes leds: heartbeat trigger: simplifications from core changes leds: default-on trigger: simplifications from core changes leds: activity trigger: simplifications from core changes leds: backlight trigger: simplifications from core changes leds: gpio trigger: simplifications from core changes usb: simplify usbport trigger WIP: don't apply drivers/leds/led-triggers.c | 43 ++++++++- drivers/leds/trigger/ledtrig-activity.c | 46 +++++----- drivers/leds/trigger/ledtrig-backlight.c | 66 +++++--------- drivers/leds/trigger/ledtrig-default-on.c | 24 ++--- drivers/leds/trigger/ledtrig-gpio.c | 93 ++++++------------- drivers/leds/trigger/ledtrig-heartbeat.c | 49 +++++----- drivers/leds/trigger/ledtrig-netdev.c | 103 +++++++-------------- drivers/leds/trigger/ledtrig-oneshot.c | 95 ++++++------------- drivers/leds/trigger/ledtrig-timer.c | 61 ++++--------- drivers/leds/trigger/ledtrig-transient.c | 106 +++++++--------------- drivers/usb/core/ledtrig-usbport.c | 38 +++----- include/linux/leds.h | 42 +++++++-- 12 files changed, 307 insertions(+), 459 deletions(-) -- 2.17.0