diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-06-07 13:58:34 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-06-09 04:19:50 +0200 |
commit | 595fa7634d71be88689f61456f38b4dc252366b4 (patch) | |
tree | 3a242929ad5a389da7748c38b6a5729054e8386b /drivers/net/ethernet | |
parent | net: pcs: lynx: add lynx_pcs_create_fwnode() (diff) | |
download | linux-595fa7634d71be88689f61456f38b4dc252366b4.tar.xz linux-595fa7634d71be88689f61456f38b4dc252366b4.zip |
net: dpaa2-mac: 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/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c index c0f7dd3b4ac1..38e6208f9e1a 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c @@ -247,8 +247,8 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac, struct fwnode_handle *dpmac_node, int id) { - struct mdio_device *mdiodev; struct fwnode_handle *node; + struct phylink_pcs *pcs; node = fwnode_find_reference(dpmac_node, "pcs-handle", 0); if (IS_ERR(node)) { @@ -263,20 +263,22 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac, return -ENODEV; } - mdiodev = fwnode_mdio_find_device(node); + pcs = lynx_pcs_create_fwnode(node); fwnode_handle_put(node); - if (!mdiodev) { + + if (pcs == ERR_PTR(-EPROBE_DEFER)) { netdev_dbg(mac->net_dev, "missing PCS device\n"); return -EPROBE_DEFER; } - mac->pcs = lynx_pcs_create(mdiodev); - mdio_device_put(mdiodev); - if (!mac->pcs) { - netdev_err(mac->net_dev, "lynx_pcs_create() failed\n"); - return -ENOMEM; + if (IS_ERR(pcs)) { + netdev_err(mac->net_dev, + "lynx_pcs_create_fwnode() failed: %pe\n", pcs); + return PTR_ERR(pcs); } + mac->pcs = pcs; + return 0; } |