diff options
| author | Timur Tabi <timur@codeaurora.org> | 2016-12-13 18:49:02 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-12-17 10:22:14 -0500 |
| commit | 026acd5f47340382844f0af73516cf7ae6cdc876 (patch) | |
| tree | 46c61dae87af390d6365c31339d507c6650815cd /drivers/net/ethernet/qualcomm/emac | |
| parent | b822ee6c5e5ba1f695fc514a65849cdd87618bd3 (diff) | |
net: qcom/emac: don't try to claim clocks on ACPI systems
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>
Diffstat (limited to 'drivers/net/ethernet/qualcomm/emac')
| -rw-r--r-- | drivers/net/ethernet/qualcomm/emac/emac.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c index ae32f855e31b..422289c232bc 100644 --- a/drivers/net/ethernet/qualcomm/emac/emac.c +++ b/drivers/net/ethernet/qualcomm/emac/emac.c | |||
| @@ -460,6 +460,12 @@ static int emac_clks_phase1_init(struct platform_device *pdev, | |||
| 460 | { | 460 | { |
| 461 | int ret; | 461 | int ret; |
| 462 | 462 | ||
| 463 | /* On ACPI platforms, clocks are controlled by firmware and/or | ||
| 464 | * ACPI, not by drivers. | ||
| 465 | */ | ||
| 466 | if (has_acpi_companion(&pdev->dev)) | ||
| 467 | return 0; | ||
| 468 | |||
| 463 | ret = emac_clks_get(pdev, adpt); | 469 | ret = emac_clks_get(pdev, adpt); |
| 464 | if (ret) | 470 | if (ret) |
| 465 | return ret; | 471 | return ret; |
| @@ -485,6 +491,9 @@ static int emac_clks_phase2_init(struct platform_device *pdev, | |||
| 485 | { | 491 | { |
| 486 | int ret; | 492 | int ret; |
| 487 | 493 | ||
| 494 | if (has_acpi_companion(&pdev->dev)) | ||
| 495 | return 0; | ||
| 496 | |||
| 488 | ret = clk_set_rate(adpt->clk[EMAC_CLK_TX], 125000000); | 497 | ret = clk_set_rate(adpt->clk[EMAC_CLK_TX], 125000000); |
| 489 | if (ret) | 498 | if (ret) |
| 490 | return ret; | 499 | return ret; |
