
On Tue, 10 Jun 2008 01:29:27 -0700 Ben Warren biggerbadderben@gmail.com wrote:
This patch is the first step in cleaning up net/eth.c, by moving Ethernet initialization to CPU or board-specific code. Initial implementation is only on the Freescale TSEC controller, but others will be added soon.
Signed-off-by: Ben Warren biggerbadderben@gmail.com
Sweet!
When we discussed this a few months ago, I was planning on defining the cpu_eth_init() and board_eth_init() functions as weak with no aliases, but in my testing this did not result in them being NULL, hence the default function.
Works just as well, doesn't it?
diff --git a/net/eth.c b/net/eth.c index c4f24c6..e75dc43 100644 --- a/net/eth.c +++ b/net/eth.c @@ -28,6 +28,12 @@
#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
+/* CPU and board-specific Ethernet initializations. Aliased function
- signals caller to move on */
+static int __def_eth_init(bd_t *bis) {return -1;}
Just a cosmetic thing: I really think this should look like a normal function, i.e. not cuddling everything up on one line. I've seen such things being mistaken for macros before.
Haavard