immortalwrt-mt798x-24.10/target/linux/rockchip/patches-6.6/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch
Tianling Shen 4d5fe0a362
rockchip: move kernel files to 6.6
Move kernel config and patches to kernel 6.6.

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

34 lines
789 B
Diff

--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -2114,6 +2114,22 @@ void r8169_apply_firmware(struct rtl8169
}
}
+static int rtl8169_devname_configuration(struct rtl8169_private *tp)
+{
+ const char *devname;
+ int ret;
+
+ ret = of_property_read_string(tp->pci_dev->dev.of_node,
+ "label", &devname);
+
+ if (ret)
+ return ret;
+
+ strlcpy(tp->dev->name, devname, IFNAMSIZ);
+
+ return 0;
+}
+
static int rtl8169_led_configuration(struct rtl8169_private *tp)
{
u32 led_data;
@@ -3652,6 +3668,7 @@ static void rtl_hw_start_8125b(struct rt
rtl_ephy_init(tp, e_info_8125b);
rtl_hw_start_8125_common(tp);
+ rtl8169_devname_configuration(tp);
rtl8169_led_configuration(tp);
rtl_hw_aspm_clkreq_enable(tp, true);