diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-06-07 12:58:59 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-06-08 19:19:50 -0700 |
commit | 8c1d0b339d675366ad02fe8c571cdeed0dd28435 (patch) | |
tree | 4adde66601f3988bd6e73743bbcf9fc185188ec4 | |
parent | d143898c6d7b7f9b171ddc76cd9a3d8356bfddd5 (diff) |
net: dpaa2: use pcs-lynx's check for fwnode availability
Use pcs-lynx's check rather than our own when determining if the device
is available.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c index 38e6208f9e1a..d860d9fe73af 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c @@ -257,12 +257,6 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac, return 0; } - if (!fwnode_device_is_available(node)) { - netdev_err(mac->net_dev, "pcs-handle node not available\n"); - fwnode_handle_put(node); - return -ENODEV; - } - pcs = lynx_pcs_create_fwnode(node); fwnode_handle_put(node); @@ -271,6 +265,11 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac, return -EPROBE_DEFER; } + if (pcs == ERR_PTR(-ENODEV)) { + netdev_err(mac->net_dev, "pcs-handle node not available\n"); + return PTR_ERR(pcs); + } + if (IS_ERR(pcs)) { netdev_err(mac->net_dev, "lynx_pcs_create_fwnode() failed: %pe\n", pcs); |