aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch')
-rw-r--r--target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch36
1 files changed, 16 insertions, 20 deletions
diff --git a/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch b/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
index 84c15c7566..d385c9a36c 100644
--- a/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
+++ b/target/linux/ipq806x/patches-4.1/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
@@ -9,27 +9,23 @@ Subject: [PATCH] stmac: platform: add support for retreiving mac from mtd
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
-@@ -302,6 +302,7 @@ static int stmmac_pltfr_probe(struct pla
- struct stmmac_priv *priv = NULL;
- struct plat_stmmacenet_data *plat_dat = NULL;
- const char *mac = NULL;
-+ u8 mtd_mac[ETH_ALEN] = { };
- int irq, wol_irq, lpi_irq;
+@@ -116,6 +116,19 @@ stmmac_probe_config_dt(struct platform_d
+ return ERR_PTR(-ENOMEM);
- /* Get IRQ information early to have an ability to ask for deferred
-@@ -362,6 +363,15 @@ static int stmmac_pltfr_probe(struct pla
- pr_err("%s: main dt probe failed", __func__);
- return ret;
- }
+ *mac = of_get_mac_address(np);
++ if (!*mac) {
++ u8 mtd_mac[ETH_ALEN];
++ int ret;
+
-+ if (!mac) {
-+ ret = of_get_mac_address_mtd(dev->of_node, &mtd_mac);
-+ if (ret == -EPROBE_DEFER)
-+ return ret;
++ ret = of_get_mac_address_mtd(np, mtd_mac);
++ if (ret == -EPROBE_DEFER)
++ return ERR_PTR(ret);
+
-+ if (is_valid_ether_addr(&mtd_mac))
-+ mac = mtd_mac;
-+ }
- }
++ if (is_valid_ether_addr(mtd_mac))
++ *mac = devm_kmemdup(&pdev->dev, mtd_mac, ETH_ALEN,
++ GFP_KERNEL);
++ }
++
+ plat->interface = of_get_phy_mode(np);
- /* Custom setup (if needed) */
+ /* Get max speed of operation from device tree */