Re: [RFC net-next PATCH v2 2/2] net: dpaa2-mac: Add ACPI support for DPAA2 MAC driver
From: Andrew Lunn
Date: Sat Apr 18 2020 - 11:00:37 EST
> - err = phylink_of_phy_connect(mac->phylink, dpmac_node, 0);
> + if (is_of_node(dpmac_node))
> + err = phylink_of_phy_connect(mac->phylink,
> + to_of_node(dpmac_node), 0);
> + else if (is_acpi_node(dpmac_node)) {
> + status = acpi_node_get_property_reference(dpmac_node,
> + "phy-handle",
> + 0, &args);
> + if (ACPI_FAILURE(status))
> + goto err_phylink_destroy;
> + phy_dev = fwnode_phy_find_device(args.fwnode);
> + if (!phy_dev)
> + goto err_phylink_destroy;
> +
> + err = phylink_connect_phy(mac->phylink, phy_dev);
> + if (err)
> + phy_detach(phy_dev);
So it looks like you need to add a phylink_fwnode_phy_connect(). And
maybe on top of that you need a phylink_device_phy_connect()?
So please stop. Take a step back, look at how the of_, device_,
fwnode_, and acpi_ abstractions all stack on top of each other, then
propose phylib and phylink core changes to implement these
abstractions.
Andrew