xgene: Always get clk source, but ignore if it's missing for SGMII ports
authorThomas Bogendoerfer <tbogendoerfer@suse.de>
Thu, 3 Aug 2017 13:43:14 +0000 (15:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Aug 2017 18:30:37 +0000 (11:30 -0700)
Even the driver doesn't do anything with the clk source for SGMII
ports it needs to be enabled by doing a devm_clk_get(), if there is
a clk source in DT.

Fixes: 0db01097cabd ('xgene: Don't fail probe, if there is no clk resource for SGMII interfaces')
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Tested-by: Laura Abbott <labbott@redhat.com>
Acked-by: Iyappan Subramanian <isubramanian@apm.com>
Tested-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/apm/xgene/xgene_enet_main.c

index 86058a9f3417bc59613cb9c019638dc8a85a9731..1d307f2def2d910eff7c983d9866fa88b331d869 100644 (file)
@@ -1785,9 +1785,9 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
 
        xgene_enet_gpiod_get(pdata);
 
-       if (pdata->phy_mode != PHY_INTERFACE_MODE_SGMII) {
-               pdata->clk = devm_clk_get(&pdev->dev, NULL);
-               if (IS_ERR(pdata->clk)) {
+       pdata->clk = devm_clk_get(&pdev->dev, NULL);
+       if (IS_ERR(pdata->clk)) {
+               if (pdata->phy_mode != PHY_INTERFACE_MODE_SGMII) {
                        /* Abort if the clock is defined but couldn't be
                         * retrived. Always abort if the clock is missing on
                         * DT system as the driver can't cope with this case.