[U-Boot] [RFC PATCH 1/2 v2] nand: allow delayed initialization

Mike Frysinger vapier at gentoo.org
Mon Oct 4 00:19:34 CEST 2010


On Sunday, October 03, 2010 17:40:32 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > Would it not be esier to rename your nand_delayed_init() into
> > > nand_init(), and add a "#ifndef CONFIG_SYS_NAND_DELAYED_INIT" around
> > > the current call to nand_init()?
> > 
> > nand_init() cant handle being called multiple times.  and i need to add
> > more nand_init() points that only apply to when things are delayed.  so
> > when delayed init is not enabled (the default), there is no change in
> > compiled code size.
> 
> Well, you have this in your new nand_init() code:
> 
> +	static uint8_t initialized;
> +	if (initialized)
> +		return;
> +	initialized = 1;
> 
> Why cannot we call nand_init() multiple times, then?

because of the whole of my statement.  i did not want to affect code size if 
this option was disabled.

in a preious patch, i had the env code doing:
#ifdef CONFIG_SYS_NAND_DELAYED_INIT
	nand_init();
#endif

but i thought it made more sense to rework it so the #ifdef existed in one 
place (the header) and not in the source.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101003/0c40c8df/attachment.pgp 


More information about the U-Boot mailing list