Commit 929a629c authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski

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: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 595fa763
...@@ -1039,19 +1039,14 @@ static struct phylink_pcs *memac_pcs_create(struct device_node *mac_node, ...@@ -1039,19 +1039,14 @@ static struct phylink_pcs *memac_pcs_create(struct device_node *mac_node,
int index) int index)
{ {
struct device_node *node; struct device_node *node;
struct mdio_device *mdiodev = NULL;
struct phylink_pcs *pcs; struct phylink_pcs *pcs;
node = of_parse_phandle(mac_node, "pcsphy-handle", index); node = of_parse_phandle(mac_node, "pcsphy-handle", index);
if (node && of_device_is_available(node)) if (!node || !of_device_is_available(node))
mdiodev = of_mdio_find_device(node); return ERR_PTR(-ENODEV);
of_node_put(node);
if (!mdiodev)
return ERR_PTR(-EPROBE_DEFER);
pcs = lynx_pcs_create(mdiodev); pcs = lynx_pcs_create_fwnode(of_fwnode_handle(node));
mdio_device_put(mdiodev); of_node_put(node);
return pcs; return pcs;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment