diff options
author | Danny Kukawka <danny.kukawka@bisect.de> | 2012-02-16 02:09:30 -0500 |
---|---|---|
committer | Bob Liu <lliubbo@gmail.com> | 2012-03-20 23:00:08 -0400 |
commit | 0eceb82f55a9e3756cada9e60ecc3a9b7b5979f5 (patch) | |
tree | a924942f3a9248a952b6060e111f280d21b999e5 /arch/blackfin/mach-bf537 | |
parent | dd47ba13786f22893d08747c152a2cf1435d0d8c (diff) |
arch/blackfin: don't generate random mac in bfin_get_ether_addr()
Changed bfin_get_ether_addr() to return a state and to
set no random mac address if the board don't provide one.
Let the caller of bfin_get_ether_addr() set a random mac
address if the return value is not 0.
v2: don't set random mac in bfin_get_ether_addr()
Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
Diffstat (limited to 'arch/blackfin/mach-bf537')
-rw-r--r-- | arch/blackfin/mach-bf537/boards/cm_bf537e.c | 5 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/cm_bf537u.c | 5 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/dnp5370.c | 3 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/pnav10.c | 5 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 3 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/tcm_bf537.c | 5 |
6 files changed, 12 insertions, 14 deletions
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537e.c b/arch/blackfin/mach-bf537/boards/cm_bf537e.c index 0d4a2f61a973..27fd2c32ae9a 100644 --- a/arch/blackfin/mach-bf537/boards/cm_bf537e.c +++ b/arch/blackfin/mach-bf537/boards/cm_bf537e.c | |||
@@ -813,9 +813,8 @@ void __init native_machine_early_platform_add_devices(void) | |||
813 | ARRAY_SIZE(cm_bf537e_early_devices)); | 813 | ARRAY_SIZE(cm_bf537e_early_devices)); |
814 | } | 814 | } |
815 | 815 | ||
816 | void bfin_get_ether_addr(char *addr) | 816 | int bfin_get_ether_addr(char *addr) |
817 | { | 817 | { |
818 | random_ether_addr(addr); | 818 | return 1; |
819 | printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__); | ||
820 | } | 819 | } |
821 | EXPORT_SYMBOL(bfin_get_ether_addr); | 820 | EXPORT_SYMBOL(bfin_get_ether_addr); |
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537u.c b/arch/blackfin/mach-bf537/boards/cm_bf537u.c index f5536982706c..3f3abad86ec3 100644 --- a/arch/blackfin/mach-bf537/boards/cm_bf537u.c +++ b/arch/blackfin/mach-bf537/boards/cm_bf537u.c | |||
@@ -790,9 +790,8 @@ void __init native_machine_early_platform_add_devices(void) | |||
790 | ARRAY_SIZE(cm_bf537u_early_devices)); | 790 | ARRAY_SIZE(cm_bf537u_early_devices)); |
791 | } | 791 | } |
792 | 792 | ||
793 | void bfin_get_ether_addr(char *addr) | 793 | int bfin_get_ether_addr(char *addr) |
794 | { | 794 | { |
795 | random_ether_addr(addr); | 795 | return 1; |
796 | printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__); | ||
797 | } | 796 | } |
798 | EXPORT_SYMBOL(bfin_get_ether_addr); | 797 | EXPORT_SYMBOL(bfin_get_ether_addr); |
diff --git a/arch/blackfin/mach-bf537/boards/dnp5370.c b/arch/blackfin/mach-bf537/boards/dnp5370.c index 11dadeb33d79..6f77bf708ec0 100644 --- a/arch/blackfin/mach-bf537/boards/dnp5370.c +++ b/arch/blackfin/mach-bf537/boards/dnp5370.c | |||
@@ -399,9 +399,10 @@ arch_initcall(dnp5370_init); | |||
399 | /* | 399 | /* |
400 | * Currently the MAC address is saved in Flash by U-Boot | 400 | * Currently the MAC address is saved in Flash by U-Boot |
401 | */ | 401 | */ |
402 | void bfin_get_ether_addr(char *addr) | 402 | int bfin_get_ether_addr(char *addr) |
403 | { | 403 | { |
404 | *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC); | 404 | *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC); |
405 | *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4); | 405 | *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4); |
406 | return 0; | ||
406 | } | 407 | } |
407 | EXPORT_SYMBOL(bfin_get_ether_addr); | 408 | EXPORT_SYMBOL(bfin_get_ether_addr); |
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c index 6fd84709fc68..e9507feea319 100644 --- a/arch/blackfin/mach-bf537/boards/pnav10.c +++ b/arch/blackfin/mach-bf537/boards/pnav10.c | |||
@@ -535,9 +535,8 @@ void __init native_machine_early_platform_add_devices(void) | |||
535 | ARRAY_SIZE(stamp_early_devices)); | 535 | ARRAY_SIZE(stamp_early_devices)); |
536 | } | 536 | } |
537 | 537 | ||
538 | void bfin_get_ether_addr(char *addr) | 538 | int bfin_get_ether_addr(char *addr) |
539 | { | 539 | { |
540 | random_ether_addr(addr); | 540 | return 1; |
541 | printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__); | ||
542 | } | 541 | } |
543 | EXPORT_SYMBOL(bfin_get_ether_addr); | 542 | EXPORT_SYMBOL(bfin_get_ether_addr); |
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index f2c0629f22c2..f3562b0922af 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -3013,9 +3013,10 @@ void native_machine_restart(char *cmd) | |||
3013 | * Currently the MAC address is saved in Flash by U-Boot | 3013 | * Currently the MAC address is saved in Flash by U-Boot |
3014 | */ | 3014 | */ |
3015 | #define FLASH_MAC 0x203f0000 | 3015 | #define FLASH_MAC 0x203f0000 |
3016 | void bfin_get_ether_addr(char *addr) | 3016 | int bfin_get_ether_addr(char *addr) |
3017 | { | 3017 | { |
3018 | *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC); | 3018 | *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC); |
3019 | *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4); | 3019 | *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4); |
3020 | return 0; | ||
3020 | } | 3021 | } |
3021 | EXPORT_SYMBOL(bfin_get_ether_addr); | 3022 | EXPORT_SYMBOL(bfin_get_ether_addr); |
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c index 988517671a5d..3fb421823857 100644 --- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c +++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c | |||
@@ -780,9 +780,8 @@ void __init native_machine_early_platform_add_devices(void) | |||
780 | ARRAY_SIZE(cm_bf537_early_devices)); | 780 | ARRAY_SIZE(cm_bf537_early_devices)); |
781 | } | 781 | } |
782 | 782 | ||
783 | void bfin_get_ether_addr(char *addr) | 783 | int bfin_get_ether_addr(char *addr) |
784 | { | 784 | { |
785 | random_ether_addr(addr); | 785 | return 1; |
786 | printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__); | ||
787 | } | 786 | } |
788 | EXPORT_SYMBOL(bfin_get_ether_addr); | 787 | EXPORT_SYMBOL(bfin_get_ether_addr); |