From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Date: Thu, 05 Nov 2009 14:47:29 -0600 Subject: [U-Boot] [PATCH 1/2] ARM Conditionally compile board LED functions In-Reply-To: <20091105202420.0842A3F6EC@gemini.denx.de> References: <1257292804-10612-1-git-send-email-Tom.Rix@windriver.com> <1257292804-10612-2-git-send-email-Tom.Rix@windriver.com> <20091105202420.0842A3F6EC@gemini.denx.de> Message-ID: <4AF339E1.9060809@windriver.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 >