aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/files
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2021-07-23 20:19:43 +0200
committerDavid Bauer <mail@david-bauer.net>2021-08-05 01:46:26 +0200
commit91a52f22a13d768f5b16a2fd0e1d74ffe36f9cb1 (patch)
treef28017e5a42615c51b599d6de96c9fb91d27d476 /target/linux/ath79/files
parentedb6bc199049769be76bb3966debcc2b31511e4b (diff)
downloadupstream-91a52f22a13d768f5b16a2fd0e1d74ffe36f9cb1.tar.gz
upstream-91a52f22a13d768f5b16a2fd0e1d74ffe36f9cb1.tar.bz2
upstream-91a52f22a13d768f5b16a2fd0e1d74ffe36f9cb1.zip
treewide: backport support for nvmem on non platform devices
In the current state, nvmem cells are only detected on platform device. To quickly fix the problem, we register the affected problematic driver with the of_platform but that is more an hack than a real solution. Backport from net-next the required patch so that nvmem can work also with non-platform devices and rework our current patch. Drop the mediatek and dsa workaround and rework the ath10k patches. Rework every driver that use the of_get_mac_address api. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/ath79/files')
-rw-r--r--target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index 463083628f..607cc0b934 100644
--- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -1519,7 +1519,6 @@ static int ag71xx_probe(struct platform_device *pdev)
struct net_device *dev;
struct resource *res;
struct ag71xx *ag;
- const void *mac_addr;
u32 max_frame_len;
int tx_size, err;
@@ -1668,12 +1667,10 @@ static int ag71xx_probe(struct platform_device *pdev)
ag->stop_desc->ctrl = 0;
ag->stop_desc->next = (u32) ag->stop_desc_dma;
- mac_addr = of_get_mac_address(np);
- if (IS_ERR_OR_NULL(mac_addr) || !is_valid_ether_addr(mac_addr)) {
+ of_get_mac_address(np, dev->dev_addr);
+ if (!is_valid_ether_addr(dev->dev_addr)) {
dev_err(&pdev->dev, "invalid MAC address, using random address\n");
eth_random_addr(dev->dev_addr);
- } else {
- memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)