diff options
author | Wolfgang Grandegger <wg@denx.de> | 2010-07-17 10:38:48 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-07-26 14:08:19 -0400 |
commit | 0d5977d652fa5fd4e9a56127b109e5e28d4db95d (patch) | |
tree | b477d8968be6d38231c79a40ece880f5467d938a /arch | |
parent | 7f13f65e61f1deed77c5c335ed0fa4d08f69e608 (diff) |
MIPS: Alchemy: Define eth platform devices in the correct order
Currently, the eth devices are probed in the inverse order, first
au1xxx_eth1_device and then au1xxx_eth0_device. On the GPR board,
this makes trouble:
# ifconfig|grep HWaddr
eth0 Link encap:Ethernet HWaddr 00:50:C2:0C:30:01
eth1 Link encap:Ethernet HWaddr 66:22:01:80:38:10
A bogous ethernet hwaddr is assigned to the first device and
au1xxx_eth0_device is mapped to eth1, which even does not work
properly. With this patch, the problems are gone:
# ifconfig|grep HWaddr
eth0 Link encap:Ethernet HWaddr 66:22:11:32:38:10
eth1 Link encap:Ethernet HWaddr 66:22:11:32:38:11
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
To: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/1473/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/alchemy/common/platform.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c index 2580e77624d2..f9e5622ebc95 100644 --- a/arch/mips/alchemy/common/platform.c +++ b/arch/mips/alchemy/common/platform.c | |||
@@ -435,20 +435,21 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = { | |||
435 | static int __init au1xxx_platform_init(void) | 435 | static int __init au1xxx_platform_init(void) |
436 | { | 436 | { |
437 | unsigned int uartclk = get_au1x00_uart_baud_base() * 16; | 437 | unsigned int uartclk = get_au1x00_uart_baud_base() * 16; |
438 | int i; | 438 | int err, i; |
439 | 439 | ||
440 | /* Fill up uartclk. */ | 440 | /* Fill up uartclk. */ |
441 | for (i = 0; au1x00_uart_data[i].flags; i++) | 441 | for (i = 0; au1x00_uart_data[i].flags; i++) |
442 | au1x00_uart_data[i].uartclk = uartclk; | 442 | au1x00_uart_data[i].uartclk = uartclk; |
443 | 443 | ||
444 | err = platform_add_devices(au1xxx_platform_devices, | ||
445 | ARRAY_SIZE(au1xxx_platform_devices)); | ||
444 | #ifndef CONFIG_SOC_AU1100 | 446 | #ifndef CONFIG_SOC_AU1100 |
445 | /* Register second MAC if enabled in pinfunc */ | 447 | /* Register second MAC if enabled in pinfunc */ |
446 | if (!(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2)) | 448 | if (!err && !(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2)) |
447 | platform_device_register(&au1xxx_eth1_device); | 449 | platform_device_register(&au1xxx_eth1_device); |
448 | #endif | 450 | #endif |
449 | 451 | ||
450 | return platform_add_devices(au1xxx_platform_devices, | 452 | return err; |
451 | ARRAY_SIZE(au1xxx_platform_devices)); | ||
452 | } | 453 | } |
453 | 454 | ||
454 | arch_initcall(au1xxx_platform_init); | 455 | arch_initcall(au1xxx_platform_init); |