[ltp] Re: [Patch 2/3] ibm-acpi: LED Subsystem integration.

Stefan Schmidt linux-thinkpad@linux-thinkpad.org
Thu, 26 Oct 2006 20:04:40 +0200


Hello.

On Thu, 2006-10-26 at 14:11, Richard Purdie wrote:
> 
> There is actually another way you can handle this with much less code
> overhead. Have a look at leds-ixp4xx-gpio.c, specifically its use of
> container_of(). Basically, you can surround struct led_classdev with
> your own data, in this case your led number, then you only need one
> brightness_set function.

I have searched for something like this. I'll take a look. Thanks.

> > Indeed. Even if goto is not the right thing on other problems, it can
> > make the code less bloated here.
> 
> Init function error handling is the one place goto is valid and actively
> encouraged in the kernel :)

:)

regards
Stefan Schmidt