Commit df255c20 authored by Russell King's avatar Russell King Committed by Kleber Sacilotto de Souza

ASoC: kirkwood: fix external clock probe defer

BugLink: https://bugs.launchpad.net/bugs/1855313

[ Upstream commit 4523817d ]

When our call to get the external clock fails, we forget to clean up
the enabled internal clock correctly.  Enable the clock after we have
obtained all our resources.

Fixes: 84aac6c7 ("ASoC: kirkwood: fix loss of external clock at probe time")
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/E1iNGyK-0004oF-6A@rmk-PC.armlinux.org.ukSigned-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 61c76d01
...@@ -570,10 +570,6 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev) ...@@ -570,10 +570,6 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
return PTR_ERR(priv->clk); return PTR_ERR(priv->clk);
} }
err = clk_prepare_enable(priv->clk);
if (err < 0)
return err;
priv->extclk = devm_clk_get(&pdev->dev, "extclk"); priv->extclk = devm_clk_get(&pdev->dev, "extclk");
if (IS_ERR(priv->extclk)) { if (IS_ERR(priv->extclk)) {
if (PTR_ERR(priv->extclk) == -EPROBE_DEFER) if (PTR_ERR(priv->extclk) == -EPROBE_DEFER)
...@@ -589,6 +585,10 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev) ...@@ -589,6 +585,10 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
} }
} }
err = clk_prepare_enable(priv->clk);
if (err < 0)
return err;
/* Some sensible defaults - this reflects the powerup values */ /* Some sensible defaults - this reflects the powerup values */
priv->ctl_play = KIRKWOOD_PLAYCTL_SIZE_24; priv->ctl_play = KIRKWOOD_PLAYCTL_SIZE_24;
priv->ctl_rec = KIRKWOOD_RECCTL_SIZE_24; priv->ctl_rec = KIRKWOOD_RECCTL_SIZE_24;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment