[U-Boot] [PATCH 3/3] net: switch device init to initcall
Ben Warren
biggerbadderben at gmail.com
Sat May 23 20:31:14 CEST 2009
On Sat, May 23, 2009 at 9:36 AM, Jean-Christophe PLAGNIOL-VILLARD <
plagnioj at jcrosoft.com> wrote:
> On 08:41 Sat 23 May , Ben Warren wrote:
> > Jean-Christophe,
> >
> > On Sat, May 23, 2009 at 8:08 AM, Jean-Christophe PLAGNIOL-VILLARD
> > <plagnioj at jcrosoft.com> wrote:
> >
> > apply to at91sam9263ek
> >
> > this will result to reduce the size of 2212 bytes
> >
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <
> plagnioj at jcrosoft.com>
> > ---
> > board/atmel/at91sam9263ek/at91sam9263ek.c | 12 ++++++------
> > include/netdev.h | 12 ------------
> > net/eth.c | 16 ----------------
> > 3 files changed, 6 insertions(+), 34 deletions(-)
> >
> > <snip>
> >
> > - /* Try board-specific initialization first. If it fails or
> > isn't
> > - * present, try the cpu-specific initialization */
> > - if (board_eth_init(bis) < 0)
> > - cpu_eth_init(bis);
> >
> > Good idea, but your implementation is flawed. It's critically
> important
> > that the prioritization of board ethernet initialization over CPU
> ethernet
> > initialization be preserved. Your idea doesn't handle that (at least
> that
> > I can see).
> with this only patch yes, but I'm preparing a full implementation that will
> If I understand correctly the board_eth_init is unsed to overwrite the
> default
> cpu_eth_init by passing different parameter
>
> with a device/driver model this will be handle correctly
>
I'm not really sure why you used this one as an example, then, since it
doesn't provide any obvious benefit. As far as I can tell, the only benefit
of using the Linux-style grouping of initialization calls is to control flow
during boot-up, and U-boot already handles this pretty well IMHO. I think
in U-boot it will only make the code harder to read and understand. I'd be
interested in seeing a different example, though.
regards,
Ben
More information about the U-Boot
mailing list