Here is a patch to the asus_acpi driver that links the Asus laptop LED's into the new LED subsystem. It creates LED class devices named asus:mail, asus:wireless, and asus:touchpad, depending on if the laptop supports the mled, wled, and tled LED's. Since it's so new, I added a config option to turn it on and off. It's worked for me, though I have an Asus M2N, which only has the mail and wireless LED's. Signed-off-by: Thomas Tuttle I believe I've fixed everything you asked about, plus a few things Richard Purdie (the LED subsystem guy) suggested. On July 06 at 18:49 EDT, Andrew Morton hastily scribbled: > Thomas Tuttle wrote: > > +#ifdef CONFIG_ACPI_ASUS_NEW_LED > > +#include > > +#endif > The ifdef shouldn't be required. If it is, ldes.h needs fixing. Fixed. > This mingles declarations with definitions. It's more conventional to keep > them together. Fixed. I moved all the declarations together, and initialized the led_cdev structs if and when they are going to be registered. (Just as with the zero initializers, this should stop them from wasting space in .vmlinux.) > Please don' t initialise static storage to zero (the "= 0"). The C runtime > environment does that already, and the above construct will place the > values into .data and hence into .vmlinux. Fixed. > > +/* LED update work structs. */ > These all should be declared static. Fixed. > > +/* LED work functions. */ > > +static void led_update_mled(void *private) { > The opening brace goes in column 1. Fixed. > It's usual to put a blank line at the end of the declaration of the > automatic valriables. Fixed. > Add: > > #else > static inline int led_initialize(struct device *parent) > { > } > > static inline void led_terminate(void) > { > } > #endif Fixed. > > +#ifdef CONFIG_ACPI_ASUS_NEW_LED > > + result = led_initialize(acpi_get_physical_device(device->handle)); > > +#endif > > + > > > > +#ifdef CONFIG_ACPI_ASUS_NEW_LED > > + led_terminate(); > > +#endif > > + > And remove these ifdefs. Fixed. I believe it's a little less ugly now. The declarations are better organized, error recovery from the initialization is better (sorry to use goto, but if I didn't, I'd have to duplicate the abort code for each possible point of failure). This revision is essentially the same, functionally, and it appears to work in quick testing. I think it would be nice if someone else with an Asus laptop could give this a test before it goes into mainline. The code that updates the LED's is basically copied from the /proc interface, but testing is good. -- Thomas Tuttle