xx_vv_immortalwrt/target/linux/rockchip/patches-6.6/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch
Tianling Shen cda5cfb9d5
rockchip: remove LED configuration hack for r8169
Upstream now uses standard ETH LED bindings to configure LED registers.
However, we don't use the r8169 driver for rockchip, so simply remove
this outdated hack.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-17 17:28:31 +08:00

29 lines
794 B
Diff

--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -21,6 +21,7 @@
#include <linux/in.h>
#include <linux/io.h>
#include <linux/ip.h>
+#include <linux/of.h>
#include <linux/tcp.h>
#include <linux/interrupt.h>
#include <linux/dma-mapping.h>
@@ -5240,6 +5241,7 @@ static int rtl_init_one(struct pci_dev *
int jumbo_max, region, rc;
enum mac_version chipset;
struct net_device *dev;
+ const char *devname = of_get_property(pdev->dev.of_node, "label", NULL);
u32 txconfig;
u16 xid;
@@ -5247,6 +5249,9 @@ static int rtl_init_one(struct pci_dev *
if (!dev)
return -ENOMEM;
+ if (devname)
+ strscpy(dev->name, devname, IFNAMSIZ);
+
SET_NETDEV_DEV(dev, &pdev->dev);
dev->netdev_ops = &rtl_netdev_ops;
tp = netdev_priv(dev);