Hi! > Given that activating a trigger can fail, let the callback return an > indication. This prevents to have a trigger active according to the > "trigger" sysfs attribure but not functional. > > This is done using a new function callback .new_activate to not break > existing drivers and to allow to convert one after the other to the new > mechanism. Once all users are converted, .activate can be dropped and > .new_activate renamed. No, this is not reasonable. Instead of big rename, replace return value in ->activate with int. It will currently return 0 for all drivers. > +++ b/include/linux/leds.h > @@ -253,6 +253,8 @@ static inline bool led_sysfs_is_disabled(struct led_classdev *led_cdev) > struct led_trigger { > /* Trigger Properties */ > const char *name; > + int (*new_activate)(struct led_classdev *led_cdev); > + /* .activate is unused if .new_activate is non-NULL */ > void (*activate)(struct led_classdev *led_cdev); > void (*deactivate)(struct led_classdev *led_cdev); > -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Attachment:
signature.asc
Description: Digital signature