From e3e12f52b214121840b44c91de5b3e5af5d3eb84 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 06 Nov 2023 03:04:41 +0000
Subject: [PATCH] rk3568 rt init

---
 kernel/drivers/net/phy/phy_device.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/kernel/drivers/net/phy/phy_device.c b/kernel/drivers/net/phy/phy_device.c
index 6655447..47e80d8 100644
--- a/kernel/drivers/net/phy/phy_device.c
+++ b/kernel/drivers/net/phy/phy_device.c
@@ -505,6 +505,15 @@
 	INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine);
 	INIT_WORK(&dev->phy_queue, phy_change_work);
 
+	/* Try to avoid __request_module warning */
+#define RK630_PHY_ID		0x00441400
+#define PHY_ID_YT8511		0x0000010a
+#define PHY_ID_YT8531S		0x4f51e91a
+#define PHY_ID_YT8531		0x4f51e91b
+	if ((IS_BUILTIN(CONFIG_RK630_PHY) && phy_id == RK630_PHY_ID) ||
+	    (IS_BUILTIN(CONFIG_MOTORCOMM_PHY) && (phy_id == PHY_ID_YT8511 || phy_id == PHY_ID_YT8531S || phy_id == PHY_ID_YT8531)))
+		goto skip_request_module;
+
 	/* Request the appropriate module unconditionally; don't
 	 * bother trying to do so only if it isn't already loaded,
 	 * because that gets complicated. A hotplug event would have
@@ -517,6 +526,7 @@
 	 */
 	request_module(MDIO_MODULE_PREFIX MDIO_ID_FMT, MDIO_ID_ARGS(phy_id));
 
+skip_request_module:
 	device_initialize(&mdiodev->dev);
 
 	return dev;

--
Gitblit v1.6.2