summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMarian Balakowicz <m8@semihalf.com>2005-11-30 18:06:04 +0100
committerMarian Balakowicz <m8@semihalf.com>2005-11-30 18:06:04 +0100
commitd9785c14bf489908b8e39b1e20f0c14cb8fcda76 (patch)
treec5105eb907ce0cb7b353619007f34b4c86879f30 /common
parent0a69b26ed6fe3184cab86872589c27b076e6cb8e (diff)
downloadu-boot-imx-d9785c14bf489908b8e39b1e20f0c14cb8fcda76.zip
u-boot-imx-d9785c14bf489908b8e39b1e20f0c14cb8fcda76.tar.gz
u-boot-imx-d9785c14bf489908b8e39b1e20f0c14cb8fcda76.tar.bz2
Fix miiphy global data initialization (problem on 4xx boards when no
ethaddr is assigned). Initialization moved from miiphy_register() to eth_initialize(). Based on initial patch for 4xx platform by Matthias Fuchs.
Diffstat (limited to 'common')
-rw-r--r--common/miiphyutil.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/common/miiphyutil.c b/common/miiphyutil.c
index d67c8b5..e411e57 100644
--- a/common/miiphyutil.c
+++ b/common/miiphyutil.c
@@ -60,6 +60,16 @@ static struct mii_dev *current_mii;
/*****************************************************************************
*
+ * Initialize global data. Need to be called before any other miiphy routine.
+ */
+void miiphy_init()
+{
+ INIT_LIST_HEAD(&mii_devs);
+ current_mii = NULL;
+}
+
+/*****************************************************************************
+ *
* Register read and write MII access routines for the device <name>.
*/
void miiphy_register(char *name,
@@ -71,15 +81,8 @@ void miiphy_register(char *name,
struct list_head *entry;
struct mii_dev *new_dev;
struct mii_dev *miidev;
- static int head_initialized = 0;
unsigned int name_len;
- if (head_initialized == 0) {
- INIT_LIST_HEAD(&mii_devs);
- current_mii = NULL;
- head_initialized = 1;
- }
-
/* check if we have unique name */
list_for_each(entry, &mii_devs) {
miidev = list_entry(entry, struct mii_dev, link);