aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-11-22 19:06:51 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-11-22 19:06:51 +0000
commit3789b1f5a0760bce2f56993685a3f7e7202d41d0 (patch)
tree5fa9d37601b64b81ca4fce683b6cd8bc58b44843 /target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
parentb1a91ca57fc9bbdb648e77790a0812fd9bd96373 (diff)
downloadupstream-3789b1f5a0760bce2f56993685a3f7e7202d41d0.tar.gz
upstream-3789b1f5a0760bce2f56993685a3f7e7202d41d0.tar.bz2
upstream-3789b1f5a0760bce2f56993685a3f7e7202d41d0.zip
ipq806x: update stmmac to the version from linux 4.3
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 47593
Diffstat (limited to 'target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch')
-rw-r--r--target/linux/ipq806x/patches-3.18/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-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch b/target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
index 68222ceea7..d385c9a36c 100644
--- a/target/linux/ipq806x/patches-3.18/709-stmac-platform-add-support-for-retreiving-mac-from-m.patch
+++ b/target/linux/ipq806x/patches-3.18/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
-@@ -284,6 +284,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] = { };
+@@ -116,6 +116,19 @@ stmmac_probe_config_dt(struct platform_d
+ return ERR_PTR(-ENOMEM);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- addr = devm_ioremap_resource(dev, res);
-@@ -313,6 +314,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 */