procd: update to git HEAD
[openwrt/staging/wigyori.git] / target / linux / generic / hack-5.4 / 780-drivers-net-mediatek-register-of_platform-for-every-.patch
1 From c94b2cfd25c282e2974accc1b07da98ae7139b47 Mon Sep 17 00:00:00 2001
2 From: Ansuel Smith <ansuelsmth@gmail.com>
3 Date: Fri, 23 Jul 2021 12:14:33 +0200
4 Subject: [PATCH 1/2] drivers: net: mediatek: register of_platform for every
5 port
6
7 Currently the nvmem framework require the devicenode to be registred on
8 the of_platform or of_get_mac_address fail to get the macaddress if
9 defined using an nvmem cell. Fix this by registrering these special node
10 so they can be found by of_find_device_by_node.
11
12 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
13 ---
14 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 ++
15 1 file changed, 2 insertions(+)
16
17 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
18 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
19 @@ -3034,6 +3034,8 @@ static int mtk_add_mac(struct mtk_eth *e
20 eth->netdev[id]->dev.of_node = np;
21
22 eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN;
23 +
24 + of_platform_device_create(np, NULL, NULL);
25
26 return 0;
27