net: qcom/emac: don't try to claim clocks on ACPI systems
authorTimur Tabi <timur@codeaurora.org>
Tue, 13 Dec 2016 23:49:02 +0000 (17:49 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sat, 17 Dec 2016 15:22:14 +0000 (10:22 -0500)
On ACPI systems, clocks are not available to drivers directly.  They are
handled exclusively by ACPI and/or firmware, so there is no clock driver.
Calls to clk_get() always fail, so we should not even attempt to claim
any clocks on ACPI systems.

Signed-off-by: Timur Tabi <timur@codeaurora.org>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/emac/emac.c

index ae32f855e31b845617f8d70dc127cdb177cc361a..422289c232bc77b2c08c49e5646967b94aeedff8 100644 (file)
@@ -460,6 +460,12 @@ static int emac_clks_phase1_init(struct platform_device *pdev,
 {
        int ret;
 
+       /* On ACPI platforms, clocks are controlled by firmware and/or
+        * ACPI, not by drivers.
+        */
+       if (has_acpi_companion(&pdev->dev))
+               return 0;
+
        ret = emac_clks_get(pdev, adpt);
        if (ret)
                return ret;
@@ -485,6 +491,9 @@ static int emac_clks_phase2_init(struct platform_device *pdev,
 {
        int ret;
 
+       if (has_acpi_companion(&pdev->dev))
+               return 0;
+
        ret = clk_set_rate(adpt->clk[EMAC_CLK_TX], 125000000);
        if (ret)
                return ret;