Title: [8183] trunk/arch/blackfin/mach-bf537/boards/stamp.c: adf7021/bf537-stamp: move mac storage into platform struct and call random_ether_addr() on it
Revision
8183
Author
vapier
Date
2010-01-19 02:04:29 -0500 (Tue, 19 Jan 2010)

Log Message

adf7021/bf537-stamp: move mac storage into platform struct and call random_ether_addr() on it

Modified Paths

Diff

Modified: trunk/arch/blackfin/mach-bf537/boards/stamp.c (8182 => 8183)


--- trunk/arch/blackfin/mach-bf537/boards/stamp.c	2010-01-19 07:03:57 UTC (rev 8182)
+++ trunk/arch/blackfin/mach-bf537/boards/stamp.c	2010-01-19 07:04:29 UTC (rev 8183)
@@ -26,6 +26,7 @@
 	|| defined(CONFIG_GPIO_ADP5588_MODULE)
 #include <linux/i2c/adp5588.h>
 #endif
+#include <linux/etherdevice.h>
 #include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
@@ -811,8 +812,6 @@
 	0x0000000E,
 	0x0000000F,
 };
-#include <linux/if_ether.h>
-static const u8 adf7021_addr[ETH_ALEN] = {0x00, 0xe0, 0x22, 0xfe, 0xbf, 0xb8};
 
 static struct adf702x_platform_data adf7021_platform_data = {
 	.regs_base = (void *)SPORT1_TCR1,
@@ -825,8 +824,13 @@
 	.adf702x_model = MODEL_ADF7021,
 	.adf702x_regs = adf7021_regs,
 	.tx_reg = TXREG,
-	.mac_addr = adf7021_addr,
 };
+static inline void adf702x_mac_init(void)
+{
+	random_ether_addr(adf7021_platform_data.mac_addr);
+}
+#else
+static inline void adf702x_mac_init(void) {}
 #endif
 
 #if defined(CONFIG_MTD_DATAFLASH) \
@@ -2065,6 +2069,7 @@
 {
 	printk(KERN_INFO "%s(): registering device resources\n", __func__);
 	bfin_plat_nand_init();
+	adf702x_mac_init();
 	platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
 	i2c_register_board_info(0, bfin_i2c_board_info,
 				ARRAY_SIZE(bfin_i2c_board_info));
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to