Re: [PATCH RESEND net-next 5/9] fs_enet: use the new fixed PHY helpers
On 05/22/2014 01:38 AM, Florian Fainelli wrote: of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index dc80db41d6b3..d602711e00e9 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c [...] @@ -1029,9 +1025,15 @@ static int fs_enet_probe(struct platform_device *ofdev) fpi->use_napi = 1; fpi->napi_weight = 17; fpi->phy_node = of_parse_phandle(ofdev->dev.of_node, "phy-handle", 0); - if ((!fpi->phy_node) && (!of_get_property(ofdev->dev.of_node, "fixed-link", - NULL))) - goto out_free_fpi; + if (!fpi->phy_node) { + if (of_phy_is_fixed_link(ofdev->dev.of_node)) { These two *if* statements could be collapsed, reducing the indentation level below. + err = of_phy_register_fixed_link(ofdev->dev.of_node); + if (err) + goto out_free_fpi; + + fpi->phy_node = ofdev->dev.of_node; + } + } WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND net-next 5/9] fs_enet: use the new fixed PHY helpers
of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index dc80db41d6b3..d602711e00e9 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c @@ -792,10 +792,6 @@ static int fs_init_phy(struct net_device *dev) phydev = of_phy_connect(dev, fep->fpi->phy_node, _adjust_link, 0, iface); if (!phydev) { - phydev = of_phy_connect_fixed_link(dev, _adjust_link, - iface); - } - if (!phydev) { dev_err(>dev, "Could not attach to PHY\n"); return -ENODEV; } @@ -1029,9 +1025,15 @@ static int fs_enet_probe(struct platform_device *ofdev) fpi->use_napi = 1; fpi->napi_weight = 17; fpi->phy_node = of_parse_phandle(ofdev->dev.of_node, "phy-handle", 0); - if ((!fpi->phy_node) && (!of_get_property(ofdev->dev.of_node, "fixed-link", - NULL))) - goto out_free_fpi; + if (!fpi->phy_node) { + if (of_phy_is_fixed_link(ofdev->dev.of_node)) { + err = of_phy_register_fixed_link(ofdev->dev.of_node); + if (err) + goto out_free_fpi; + + fpi->phy_node = ofdev->dev.of_node; + } + } if (of_device_is_compatible(ofdev->dev.of_node, "fsl,mpc5125-fec")) { phy_connection_type = of_get_property(ofdev->dev.of_node, -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND net-next 5/9] fs_enet: use the new fixed PHY helpers
of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli f.faine...@gmail.com --- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index dc80db41d6b3..d602711e00e9 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c @@ -792,10 +792,6 @@ static int fs_init_phy(struct net_device *dev) phydev = of_phy_connect(dev, fep-fpi-phy_node, fs_adjust_link, 0, iface); if (!phydev) { - phydev = of_phy_connect_fixed_link(dev, fs_adjust_link, - iface); - } - if (!phydev) { dev_err(dev-dev, Could not attach to PHY\n); return -ENODEV; } @@ -1029,9 +1025,15 @@ static int fs_enet_probe(struct platform_device *ofdev) fpi-use_napi = 1; fpi-napi_weight = 17; fpi-phy_node = of_parse_phandle(ofdev-dev.of_node, phy-handle, 0); - if ((!fpi-phy_node) (!of_get_property(ofdev-dev.of_node, fixed-link, - NULL))) - goto out_free_fpi; + if (!fpi-phy_node) { + if (of_phy_is_fixed_link(ofdev-dev.of_node)) { + err = of_phy_register_fixed_link(ofdev-dev.of_node); + if (err) + goto out_free_fpi; + + fpi-phy_node = ofdev-dev.of_node; + } + } if (of_device_is_compatible(ofdev-dev.of_node, fsl,mpc5125-fec)) { phy_connection_type = of_get_property(ofdev-dev.of_node, -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RESEND net-next 5/9] fs_enet: use the new fixed PHY helpers
On 05/22/2014 01:38 AM, Florian Fainelli wrote: of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli f.faine...@gmail.com --- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index dc80db41d6b3..d602711e00e9 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c [...] @@ -1029,9 +1025,15 @@ static int fs_enet_probe(struct platform_device *ofdev) fpi-use_napi = 1; fpi-napi_weight = 17; fpi-phy_node = of_parse_phandle(ofdev-dev.of_node, phy-handle, 0); - if ((!fpi-phy_node) (!of_get_property(ofdev-dev.of_node, fixed-link, - NULL))) - goto out_free_fpi; + if (!fpi-phy_node) { + if (of_phy_is_fixed_link(ofdev-dev.of_node)) { These two *if* statements could be collapsed, reducing the indentation level below. + err = of_phy_register_fixed_link(ofdev-dev.of_node); + if (err) + goto out_free_fpi; + + fpi-phy_node = ofdev-dev.of_node; + } + } WBR, Sergei -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/