[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <d5f7b5c06f52ef757684be7b40a058c363d454bc.1543584362.git.joabreu@synopsys.com>
Date: Fri, 30 Nov 2018 13:27:13 +0000
From: Jose Abreu <jose.abreu@...opsys.com>
To: netdev@...r.kernel.org
Cc: Jose Abreu <jose.abreu@...opsys.com>, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Joao Pinto <joao.pinto@...opsys.com>
Subject: [PATCH net-next] net: phy: Also request modules for C45 IDs
Logic of phy_device_create() requests PHY modules according to PHY ID
but for C45 PHYs we use different field for the IDs.
Let's also request the modules for these IDs.
Signed-off-by: Jose Abreu <joabreu@...opsys.com>
Cc: Andrew Lunn <andrew@...n.ch>
Cc: Florian Fainelli <f.fainelli@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Joao Pinto <joao.pinto@...opsys.com>
---
drivers/net/phy/phy_device.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 0904002b19a2..d0f6edfd3381 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -606,6 +606,18 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
* there's no driver _already_ loaded.
*/
request_module(MDIO_MODULE_PREFIX MDIO_ID_FMT, MDIO_ID_ARGS(phy_id));
+ if (c45_ids) {
+ const int num_ids = ARRAY_SIZE(c45_ids->device_ids);
+ int i;
+
+ for (i = 1; i < num_ids; i++) {
+ if (!(c45_ids->devices_in_package & (1 << i)))
+ continue;
+
+ request_module(MDIO_MODULE_PREFIX MDIO_ID_FMT,
+ MDIO_ID_ARGS(c45_ids->device_ids[i]));
+ }
+ }
device_initialize(&mdiodev->dev);
--
2.7.4
Powered by blists - more mailing lists