mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-27 01:11:14 +00:00
321823ba05
Build and boot tested on the following hardware: * GW54xx * GW53xx * GW52xx * GW51xx * GW552x * GW551x Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com> SVN-Revision: 48248
29 lines
755 B
Diff
29 lines
755 B
Diff
--- a/drivers/net/ethernet/marvell/sky2.c
|
|
+++ b/drivers/net/ethernet/marvell/sky2.c
|
|
@@ -4812,7 +4812,24 @@ static struct net_device *sky2_init_netd
|
|
* 1) from device tree data
|
|
* 2) from internal registers set by bootloader
|
|
*/
|
|
- iap = of_get_mac_address(hw->pdev->dev.of_node);
|
|
+
|
|
+ iap = NULL;
|
|
+ if (IS_ENABLED(CONFIG_OF)) {
|
|
+ struct device_node *np;
|
|
+ np = of_find_node_by_path("/aliases");
|
|
+ if (np) {
|
|
+ const char *path = of_get_property(np, "sky2", NULL);
|
|
+ if (path)
|
|
+ np = of_find_node_by_path(path);
|
|
+ if (np)
|
|
+ path = of_get_mac_address(np);
|
|
+ if (path)
|
|
+ iap = (unsigned char *) path;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ if (!iap)
|
|
+ iap = of_get_mac_address(hw->pdev->dev.of_node);
|
|
if (iap)
|
|
memcpy(dev->dev_addr, iap, ETH_ALEN);
|
|
else
|