public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH][Net] Convert SMC91111 Ethernet driver toCONFIG_NET_MULTI API
Date: Mon, 27 Jul 2009 15:17:34 -0700	[thread overview]
Message-ID: <4A6E277E.4020405@gmail.com> (raw)
In-Reply-To: <200907271816.27170.rgetz@blackfin.uclinux.org>

Hi Robin,

Robin Getz wrote:
> 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
>   
I actually like to have them in the board C code.  To the casual 
observer, it is obvious that certain ethernet controllers are optional, 
whereas if all they see is a string of initialization functions for 
different chips they might say, "WTF?".

regards,
Ben

  reply	other threads:[~2009-07-27 22:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-27 21:43 [U-Boot] [PATCH][Net] Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API Ben Warren
2009-07-27 21:47 ` Ben Warren
2009-07-27 22:16   ` Robin Getz
2009-08-25 20:54     ` Ben Warren
2009-07-27 22:18   ` Robin Getz
2009-07-27 22:16 ` [U-Boot] [PATCH][Net] Convert SMC91111 Ethernet driver toCONFIG_NET_MULTI API Robin Getz
2009-07-27 22:17   ` Ben Warren [this message]
2009-07-27 22:33     ` Robin Getz
2009-07-27 23:43   ` Mike Frysinger
2009-07-28  0:10 ` [U-Boot] [PATCH][Net] Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API Mike Frysinger
2009-09-02  9:31 ` Mike Frysinger
2009-09-11 10:06 ` Mike Frysinger
2009-09-10 22:10   ` Ben Warren
2009-09-16  2:37     ` [U-Boot] [PATCH] smc91111_eeprom: get working with net multi conversion Mike Frysinger
2009-09-22 20:46       ` Wolfgang Denk
2009-09-22 20:49         ` Ben Warren
2009-09-22 21:25           ` Mike Frysinger
2009-10-05  5:44       ` Ben Warren
2009-09-22 19:03   ` [U-Boot] [PATCH][Net] Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A6E277E.4020405@gmail.com \
    --to=biggerbadderben@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox