
Wolfgang Denk wrote:
Dear Tom Rix,
In message 1257292804-10612-2-git-send-email-Tom.Rix@windriver.com you wrote:
The ARM board LED functions are defined as weak. They add a size overhead if they are not used.
Now they are only defined if CONFIG_STATUS_LED is also defined.
The arm920t and arm926ejs _start function calls these LED functions
bl coloured_LED_init bl red_LED_on
In general, what happens is they call into the weak stubs. Only if the cpu/board provides an overriding function do these calls cause anything meaningful to happen.
Now this noop case is removed and these LED functions are excuted only when CONFIG_STATUS_LED is defined
I don't get it. We use "weak" to avoid #ifdef's, and you insert new #ifdef's? That seems to be the wrong approach to me.
The arguments for using weak are getting weak :P
Using weak is less relevant with the #ifdef's The benefit now is that boards that use the led functions do not have to define all of them.
I am open to ideas on how to kill weak off completely.
Has a general led driver layer ever been proposed ? Something to convert status led for a mixture of #defines and weak symbols to something that had a register function and some file_ops ?
Tom
Tom
Best regards,
Wolfgang Denk