[U-Boot] [PATCH][Net] Convert SMC91111 Ethernet driver toCONFIG_NET_MULTI API

Robin Getz rgetz at blackfin.uclinux.org
Tue Jul 28 00:16:27 CEST 2009


On Mon 27 Jul 2009 17:43, Ben Warren pondered:
> All in-tree boards that use this controller have CONFIG_NET_MULTI
> added

First - thanks.

Second - It's a style thing, but...

> ---
>  board/bf533-ezkit/bf533-ezkit.c               |   12 +
>  include/netdev.h                              |    1 +
>  71 files changed, 888 insertions(+), 490 deletions(-)
[snip] 
> diff --git a/board/bf533-ezkit/bf533-ezkit.c
> b/board/bf533-ezkit/bf533-ezkit.c
> index d5f0b7c..ff0e15e 100644
> --- a/board/bf533-ezkit/bf533-ezkit.c
> +++ b/board/bf533-ezkit/bf533-ezkit.c
> @@ -26,6 +26,7 @@
>   */
>  
>  #include <common.h>
> +#include <netdev.h>
>  #include "psd4256.h"
>  #include "flash-defines.h"
>  
> @@ -57,3 +58,14 @@ int misc_init_r(void)
>  
>  	return 0;
>  }
> +
> +#ifdef CONFIG_CMD_NET
> +int board_eth_init(bd_t *bis)
> +{
> +	int rc = 0;
> +#ifdef CONFIG_SMC91111
> +	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
> +#endif
> +	return rc;
> +}
> +#endif
[snip]
> diff --git a/include/netdev.h b/include/netdev.h
> index 3e66586..4636b57 100644
> --- a/include/netdev.h
> +++ b/include/netdev.h
> @@ -73,6 +73,7 @@ int rtl8169_initialize(bd_t *bis);
>  int scc_initialize(bd_t *bis);
>  int skge_initialize(bd_t *bis);
>  int smc911x_initialize(u8 dev_num, int base_addr);
> +int smc91111_initialize(u8 dev_num, int base_addr);
>  int tsi108_eth_initialize(bd_t *bis);
>  int uec_initialize(int index);
>  int uec_standard_init(bd_t *bis);

would be alot less ifdefs if you put it in the header file...

#ifdef CONFIG_SMC91111
int smc91111_initialize(u8 dev_num, int base_addr);
#else
#define smc91111_initialize(dev_num, base_addr) 0
#endif

that would remove all the "ifdef CONFIG_SMC91111" in all the board files...

also would not be required to set the initial value anymore either...

-Robin


More information about the U-Boot mailing list