summaryrefslogtreecommitdiffstats
path: root/drivers/net/mdio/of_mdio.c
diff options
context:
space:
mode:
authorCalvin Johnson <calvin.johnson@oss.nxp.com>2021-06-11 12:53:48 +0200
committerDavid S. Miller <davem@davemloft.net>2021-06-11 22:08:52 +0200
commit0fb16976765143cf0d7d0dd78b3f406ab135c494 (patch)
treee0e3029a416177831727ef327e7d9d70ef917820 /drivers/net/mdio/of_mdio.c
parentDocumentation: ACPI: DSD: Document MDIO PHY (diff)
downloadlinux-0fb16976765143cf0d7d0dd78b3f406ab135c494.tar.xz
linux-0fb16976765143cf0d7d0dd78b3f406ab135c494.zip
net: phy: Introduce fwnode_mdio_find_device()
Define fwnode_mdio_find_device() to get a pointer to the mdio_device from fwnode passed to the function. Refactor of_mdio_find_device() to use fwnode_mdio_find_device(). Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Acked-by: Grant Likely <grant.likely@arm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mdio/of_mdio.c')
-rw-r--r--drivers/net/mdio/of_mdio.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c
index 8e97d5b825f5..6ef8b6e40189 100644
--- a/drivers/net/mdio/of_mdio.c
+++ b/drivers/net/mdio/of_mdio.c
@@ -347,16 +347,7 @@ EXPORT_SYMBOL(of_mdiobus_register);
*/
struct mdio_device *of_mdio_find_device(struct device_node *np)
{
- struct device *d;
-
- if (!np)
- return NULL;
-
- d = bus_find_device_by_of_node(&mdio_bus_type, np);
- if (!d)
- return NULL;
-
- return to_mdio_device(d);
+ return fwnode_mdio_find_device(of_fwnode_handle(np));
}
EXPORT_SYMBOL(of_mdio_find_device);