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>
This commit is contained in:
parent
772301b618
commit
fa63c6da22
|
@ -821,7 +821,7 @@ void native_machine_restart(char *cmd)
|
|||
bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
|
||||
}
|
||||
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
/* the MAC is stored in OTP memory page 0xDF */
|
||||
u32 ret;
|
||||
|
@ -834,5 +834,6 @@ void bfin_get_ether_addr(char *addr)
|
|||
for (ret = 0; ret < 6; ++ret)
|
||||
addr[ret] = otp_mac_p[5 - ret];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
|
@ -730,9 +730,8 @@ void native_machine_restart(char *cmd)
|
|||
bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
|
||||
}
|
||||
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
random_ether_addr(addr);
|
||||
printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
|
@ -846,7 +846,7 @@ void native_machine_restart(char *cmd)
|
|||
bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
|
||||
}
|
||||
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
/* the MAC is stored in OTP memory page 0xDF */
|
||||
u32 ret;
|
||||
|
@ -859,5 +859,6 @@ void bfin_get_ether_addr(char *addr)
|
|||
for (ret = 0; ret < 6; ++ret)
|
||||
addr[ret] = otp_mac_p[5 - ret];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
|
@ -983,9 +983,8 @@ void native_machine_restart(char *cmd)
|
|||
bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
|
||||
}
|
||||
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
random_ether_addr(addr);
|
||||
printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
|
@ -870,7 +870,7 @@ void native_machine_restart(char *cmd)
|
|||
bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
|
||||
}
|
||||
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
/* the MAC is stored in OTP memory page 0xDF */
|
||||
u32 ret;
|
||||
|
@ -883,5 +883,6 @@ void bfin_get_ether_addr(char *addr)
|
|||
for (ret = 0; ret < 6; ++ret)
|
||||
addr[ret] = otp_mac_p[5 - ret];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
|
@ -1311,7 +1311,7 @@ void native_machine_restart(char *cmd)
|
|||
bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
|
||||
}
|
||||
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
/* the MAC is stored in OTP memory page 0xDF */
|
||||
u32 ret;
|
||||
|
@ -1324,5 +1324,6 @@ void bfin_get_ether_addr(char *addr)
|
|||
for (ret = 0; ret < 6; ++ret)
|
||||
addr[ret] = otp_mac_p[5 - ret];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
|
@ -931,7 +931,7 @@ void native_machine_restart(char *cmd)
|
|||
bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
|
||||
}
|
||||
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
/* the MAC is stored in OTP memory page 0xDF */
|
||||
u32 ret;
|
||||
|
@ -945,5 +945,6 @@ void bfin_get_ether_addr(char *addr)
|
|||
for (ret = 0; ret < 6; ++ret)
|
||||
addr[ret] = otp_mac_p[5 - ret];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
|
@ -813,9 +813,8 @@ void __init native_machine_early_platform_add_devices(void)
|
|||
ARRAY_SIZE(cm_bf537e_early_devices));
|
||||
}
|
||||
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
random_ether_addr(addr);
|
||||
printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
|
@ -790,9 +790,8 @@ void __init native_machine_early_platform_add_devices(void)
|
|||
ARRAY_SIZE(cm_bf537u_early_devices));
|
||||
}
|
||||
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
random_ether_addr(addr);
|
||||
printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
|
@ -399,9 +399,10 @@ arch_initcall(dnp5370_init);
|
|||
/*
|
||||
* Currently the MAC address is saved in Flash by U-Boot
|
||||
*/
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
*(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
|
||||
*(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
|
@ -535,9 +535,8 @@ void __init native_machine_early_platform_add_devices(void)
|
|||
ARRAY_SIZE(stamp_early_devices));
|
||||
}
|
||||
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
random_ether_addr(addr);
|
||||
printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
|
@ -2993,9 +2993,10 @@ void native_machine_restart(char *cmd)
|
|||
* Currently the MAC address is saved in Flash by U-Boot
|
||||
*/
|
||||
#define FLASH_MAC 0x203f0000
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
*(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
|
||||
*(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
|
@ -780,9 +780,8 @@ void __init native_machine_early_platform_add_devices(void)
|
|||
ARRAY_SIZE(cm_bf537_early_devices));
|
||||
}
|
||||
|
||||
void bfin_get_ether_addr(char *addr)
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
random_ether_addr(addr);
|
||||
printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
||||
|
|
Loading…
Reference in New Issue