aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2021-08-08 22:38:12 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2021-08-09 01:16:48 +0200
commit4e57f83659fad88b895dd73fb18b1f5cf2bb79d7 (patch)
tree0e2c2ce39d965ac5269220991ef8c96fe24b765e /target/linux
parent4b2dc4dbbf9e34af9828e2ccf8d2121f88ad9ab9 (diff)
downloadupstream-4e57f83659fad88b895dd73fb18b1f5cf2bb79d7.tar.gz
upstream-4e57f83659fad88b895dd73fb18b1f5cf2bb79d7.tar.bz2
upstream-4e57f83659fad88b895dd73fb18b1f5cf2bb79d7.zip
kernel: Apply change to of_get_mac_address() to ks8851 too
The code from ks8851.c was moved to ks8851_common.c, so it was not backported. This broke the compile of the omap target which uses this driver. Fixes commit 91a52f22a13d ("treewide: backport support for nvmem on non platform devices") Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/generic/backport-5.4/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.4/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/target/linux/generic/backport-5.4/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
index 9f6d5727f6..ba5a068ec7 100644
--- a/target/linux/generic/backport-5.4/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
+++ b/target/linux/generic/backport-5.4/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
@@ -878,6 +878,44 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
eth_hw_addr_random(dev);
dev_err(eth->dev, "generated random MAC address %pM\n",
dev->dev_addr);
+--- a/drivers/net/ethernet/micrel/ks8851.c
++++ b/drivers/net/ethernet/micrel/ks8851.c
+@@ -419,11 +419,10 @@ static void ks8851_read_mac_addr(struct
+ static void ks8851_init_mac(struct ks8851_net *ks)
+ {
+ struct net_device *dev = ks->netdev;
+- const u8 *mac_addr;
++ int ret;
+
+- mac_addr = of_get_mac_address(ks->spidev->dev.of_node);
+- if (!IS_ERR(mac_addr)) {
+- ether_addr_copy(dev->dev_addr, mac_addr);
++ ret = of_get_mac_address(ks->spidev->dev.of_node, dev->dev_addr);
++ if (!ret) {
+ ks8851_write_mac_addr(dev);
+ return;
+ }
+--- a/drivers/net/ethernet/micrel/ks8851_mll.c
++++ b/drivers/net/ethernet/micrel/ks8851_mll.c
+@@ -1239,7 +1239,6 @@ static int ks8851_probe(struct platform_
+ struct net_device *netdev;
+ struct ks_net *ks;
+ u16 id, data;
+- const char *mac;
+
+ netdev = alloc_etherdev(sizeof(struct ks_net));
+ if (!netdev)
+@@ -1326,9 +1325,7 @@ static int ks8851_probe(struct platform_
+
+ /* overwriting the default MAC address */
+ if (pdev->dev.of_node) {
+- mac = of_get_mac_address(pdev->dev.of_node);
+- if (!IS_ERR(mac))
+- ether_addr_copy(ks->mac_addr, mac);
++ of_get_mac_address(pdev->dev.of_node, ks->mac_addr);
+ } else {
+ struct ks8851_mll_platform_data *pdata;
+
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -1350,9 +1350,7 @@ static int lpc_eth_drv_probe(struct plat