Skip to contentSkip to conversation

net: mdiobus: Convert to use fwnode_device_is_compatible()

PATCH Applied Andy Shevchenko 3 participants 3 messages Jan 19, 2023 – Jan 23, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mdiobus: Convert to use fwnode_device_is_compatible()

Replace open coded fwnode_device_is_compatible() in the driver.

---
 drivers/net/mdio/fwnode_mdio.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/mdio/fwnode_mdio.c +2 -6
index b782c35c4ac1..1183ef5e203e 100644
@@ -115,7 +115,7 @@ int fwnode_mdiobus_register_phy(struct mii_bus *bus,
 	struct mii_timestamper *mii_ts = NULL;
 	struct pse_control *psec = NULL;
 	struct phy_device *phy;
-	bool is_c45 = false;
+	bool is_c45;
 	u32 phy_id;
 	int rc;
 
@@ -129,11 +129,7 @@ int fwnode_mdiobus_register_phy(struct mii_bus *bus,
 		goto clean_pse;
 	}
 
-	rc = fwnode_property_match_string(child, "compatible",
-					  "ethernet-phy-ieee802.3-c45");
-	if (rc >= 0)
-		is_c45 = true;
-
+	is_c45 = fwnode_device_is_compatible(child, "ethernet-phy-ieee802.3-c45");
 	if (is_c45 || fwnode_get_phy_id(child, &phy_id))
 		phy = get_phy_device(bus, addr, is_c45);
 	else
Signature · 1 line
2.39.0
#2 lore raw
In reply to Andy Shevchenko
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Quoted 6 lines · On Thu, 19 Jan 2023 19:50:10 +0200 you wrote:

Replace open coded fwnode_device_is_compatible() in the driver.

---
 drivers/net/mdio/fwnode_mdio.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Here is the summary with links:
- [net-next,v1,1/1] net: mdiobus: Convert to use fwnode_device_is_compatible()

    https://git.kernel.org/netdev/net-next/c/d408ec0b5d9a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html