diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-06-07 14:58:39 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-06-09 05:19:50 +0300 |
commit | 929a629c211f1e6a4be1b941efab595fe6bfaa69 (patch) | |
tree | b81d451c308b6f5b401592474cbe06d5ac1b6de8 /drivers | |
parent | 595fa7634d71be88689f61456f38b4dc252366b4 (diff) | |
download | linux-929a629c211f1e6a4be1b941efab595fe6bfaa69.tar.xz |
net: fman_memac: use lynx_pcs_create_fwnode()
Use lynx_pcs_create_fwnode() to create a lynx PCS from a fwnode handle.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/freescale/fman/fman_memac.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 8f45caf4af12..4fbdae996d05 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -1039,19 +1039,14 @@ static struct phylink_pcs *memac_pcs_create(struct device_node *mac_node, int index) { struct device_node *node; - struct mdio_device *mdiodev = NULL; struct phylink_pcs *pcs; node = of_parse_phandle(mac_node, "pcsphy-handle", index); - if (node && of_device_is_available(node)) - mdiodev = of_mdio_find_device(node); - of_node_put(node); - - if (!mdiodev) - return ERR_PTR(-EPROBE_DEFER); + if (!node || !of_device_is_available(node)) + return ERR_PTR(-ENODEV); - pcs = lynx_pcs_create(mdiodev); - mdio_device_put(mdiodev); + pcs = lynx_pcs_create_fwnode(of_fwnode_handle(node)); + of_node_put(node); return pcs; } |