mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-06-10 14:22:05 +08:00

Manually rebased: generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch ipq806x/patches-5.4/0063-2-tsens-support-configurable-interrupts.patch layerscape/patches-5.4/301-arch-0008-arm-add-new-non-shareable-ioremap.patch layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch layerscape/patches-5.4/801-audio-0008-Revert-ASoC-Remove-dev_err-usage-after-platform_get_.patch octeon/patches-5.4/700-allocate_interface_by_label.patch All other patches automatically rebased. Signed-off-by: Liu Linhui <liulinhui36@gmail.com> Signed-off-by: Liu Linhui <liulinhui36@gmail.com>
38 lines
1.1 KiB
Diff
38 lines
1.1 KiB
Diff
From: Roman Kuzmitskii <damex.pp@icloud.com>
|
|
Date: Wed, 28 Oct 2020 19:00:00 +0000
|
|
Subject: [PATCH] staging: octeon: add net-labels support
|
|
|
|
With this patch, device name can be set within dts file
|
|
in the same way as dsa port can.
|
|
|
|
Add label to pip interface node to use this feature:
|
|
label = "lan0";
|
|
|
|
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
|
|
@@ -407,8 +407,12 @@ static int cvm_oct_common_set_mac_addres
|
|
int cvm_oct_common_init(struct net_device *dev)
|
|
{
|
|
struct octeon_ethernet *priv = netdev_priv(dev);
|
|
+ const u8 *label = NULL;
|
|
int ret;
|
|
|
|
+ if (priv->of_node)
|
|
+ label = of_get_property(priv->of_node, "label", NULL);
|
|
+
|
|
ret = of_get_mac_address(priv->of_node, dev->dev_addr);
|
|
if (ret)
|
|
eth_hw_addr_random(dev);
|
|
@@ -441,6 +445,9 @@ int cvm_oct_common_init(struct net_devic
|
|
if (dev->netdev_ops->ndo_stop)
|
|
dev->netdev_ops->ndo_stop(dev);
|
|
|
|
+ if (!IS_ERR_OR_NULL(label))
|
|
+ dev_alloc_name(dev, label);
|
|
+
|
|
return 0;
|
|
}
|
|
|