diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2021-07-23 20:19:43 +0200 |
---|---|---|
committer | David Bauer <mail@david-bauer.net> | 2021-08-05 01:46:26 +0200 |
commit | 91a52f22a13d768f5b16a2fd0e1d74ffe36f9cb1 (patch) | |
tree | f28017e5a42615c51b599d6de96c9fb91d27d476 /target/linux/octeon | |
parent | edb6bc199049769be76bb3966debcc2b31511e4b (diff) | |
download | upstream-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/octeon')
-rw-r--r-- | target/linux/octeon/patches-5.10/700-allocate_interface_by_label.patch | 16 | ||||
-rw-r--r-- | target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch | 16 |
2 files changed, 14 insertions, 18 deletions
diff --git a/target/linux/octeon/patches-5.10/700-allocate_interface_by_label.patch b/target/linux/octeon/patches-5.10/700-allocate_interface_by_label.patch index 3a9b2eb7cd..4ee6f84660 100644 --- a/target/linux/octeon/patches-5.10/700-allocate_interface_by_label.patch +++ b/target/linux/octeon/patches-5.10/700-allocate_interface_by_label.patch @@ -12,20 +12,18 @@ Tested-by: Johannes Kimmel <fff@bareminimum.eu> Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com> --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c -@@ -408,9 +408,12 @@ int cvm_oct_common_init(struct net_devic +@@ -408,7 +408,11 @@ int cvm_oct_common_init(struct net_devic + int cvm_oct_common_init(struct net_device *dev) { struct octeon_ethernet *priv = netdev_priv(dev); - const u8 *mac = NULL; + const u8 *label = NULL; - -- if (priv->of_node) -+ if (priv->of_node) { - mac = of_get_mac_address(priv->of_node); + int ret; ++ ++ if (priv->of_node) + label = of_get_property(priv->of_node, "label", NULL); -+ } - if (!IS_ERR_OR_NULL(mac)) - ether_addr_copy(dev->dev_addr, mac); + ret = of_get_mac_address(priv->of_node, dev->dev_addr); + if (ret) @@ -445,6 +448,9 @@ int cvm_oct_common_init(struct net_devic if (dev->netdev_ops->ndo_stop) dev->netdev_ops->ndo_stop(dev); diff --git a/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch b/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch index 3a9b2eb7cd..4ee6f84660 100644 --- a/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch +++ b/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch @@ -12,20 +12,18 @@ Tested-by: Johannes Kimmel <fff@bareminimum.eu> Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com> --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c -@@ -408,9 +408,12 @@ int cvm_oct_common_init(struct net_devic +@@ -408,7 +408,11 @@ int cvm_oct_common_init(struct net_devic + int cvm_oct_common_init(struct net_device *dev) { struct octeon_ethernet *priv = netdev_priv(dev); - const u8 *mac = NULL; + const u8 *label = NULL; - -- if (priv->of_node) -+ if (priv->of_node) { - mac = of_get_mac_address(priv->of_node); + int ret; ++ ++ if (priv->of_node) + label = of_get_property(priv->of_node, "label", NULL); -+ } - if (!IS_ERR_OR_NULL(mac)) - ether_addr_copy(dev->dev_addr, mac); + ret = of_get_mac_address(priv->of_node, dev->dev_addr); + if (ret) @@ -445,6 +448,9 @@ int cvm_oct_common_init(struct net_devic if (dev->netdev_ops->ndo_stop) dev->netdev_ops->ndo_stop(dev); |