From: Jon Loeliger Date: Tue, 10 Jun 2008 10:37:44 -0500 Subject: [U-Boot-Users] [PATCH v2] Add mechanisms for CPU and board-specific Ethernet initialization In-Reply-To: <1213106598-14584-1-git-send-email-biggerbadderben@gmail.com> References: <> <1213106598-14584-1-git-send-email-biggerbadderben@gmail.com> Message-ID: <1213112264.16606.7.camel@ld0161-tx32> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 2008-06-10 at 07:03 -0700, Ben Warren wrote: > +#if defined(CONFIG_TSEC1) > + tsec_initialize(bis, 0, CONFIG_TSEC1_NAME); > +#endif > +#if defined(CONFIG_TSEC2) > + tsec_initialize(bis, 1, CONFIG_TSEC2_NAME); > +#endif > +#if defined(CONFIG_MPC85XX_FEC) > + tsec_initialize(bis, 2, CONFIG_MPC85XX_FEC_NAME); > +#else > +#if defined(CONFIG_TSEC3) > + tsec_initialize(bis, 2, CONFIG_TSEC3_NAME); > +#endif > +#if defined(CONFIG_TSEC4) > + tsec_initialize(bis, 3, CONFIG_TSEC4_NAME); > +#endif > +#endif > + return 0; > +} So, why not make a new function in tsec.c called something like tsec_initialize_all(bis) with essentially the above #ifdef-series and make all of the individual board functions just be like: +int board_eth_init(bd_t *bis) +{ + tsec_initialize_all(bis); + return 0; +} Just a notion. Haven't actually thought about it... jdl