[U-Boot] [PATCH 1/2] ARM Conditionally compile board LED functions

Wolfgang Denk wd at denx.de
Thu Nov 5 23:43:28 CET 2009


Dear Tom,

In message <4AF339E1.9060809 at windriver.com> you wrote:
>
> The arguments for using weak are getting weak :P

:-P

> Using weak is less relevant with the #ifdef's

But it's the wrong direction your heading. We should get rid of
#ifdef's, not add new ones.

With #ifdef's, you have different versions of the code, which
increases the multitude of configurations that actually need to be
tested. With weak, you have one version of the code only. 

> The benefit now is that boards that use the led functions do
> not have to define all of them.

That's just an indication of a broken implementation.

Normally you would provide the weak functions in a central place,
where any board configuration which wants can overwrite them, or not.

> I am open to ideas on how to kill weak off completely.

You got it wrong.

We want to kill off the #ifdef's.

> 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 ?

We use status LEDs on many boards, without real issues. It's only AT91
which suffers from this mess.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"There is nothing new under the sun, but there are lots of old things
we don't know yet."                                  - Ambrose Bierce


More information about the U-Boot mailing list