Skip to content

Commit 026acd5

Browse files
Timur Tabidavem330
authored andcommitted
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>
1 parent b822ee6 commit 026acd5

File tree

1 file changed

+9
-0
lines changed
  • drivers/net/ethernet/qualcomm/emac

1 file changed

+9
-0
lines changed

drivers/net/ethernet/qualcomm/emac/emac.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,12 @@ static int emac_clks_phase1_init(struct platform_device *pdev,
460460
{
461461
int ret;
462462

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+
463469
ret = emac_clks_get(pdev, adpt);
464470
if (ret)
465471
return ret;
@@ -485,6 +491,9 @@ static int emac_clks_phase2_init(struct platform_device *pdev,
485491
{
486492
int ret;
487493

494+
if (has_acpi_companion(&pdev->dev))
495+
return 0;
496+
488497
ret = clk_set_rate(adpt->clk[EMAC_CLK_TX], 125000000);
489498
if (ret)
490499
return ret;

0 commit comments

Comments
 (0)