* [PATCH] ASoC: kirkwood: fix loss of external clock at probe time
@ 2013-09-19 9:49 Jean-Francois Moine
2013-09-19 11:06 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Jean-Francois Moine @ 2013-09-19 9:49 UTC (permalink / raw)
To: linux-arm-kernel
At probe time, when the clock driver is not yet initialized, the
external clock of the kirkwood sound device will not be usable.
This patch fixes this problem defering the device probe.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
---
sound/soc/kirkwood/kirkwood-i2s.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index 0f3d73d..14f32d9 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -496,7 +496,10 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
return err;
priv->extclk = devm_clk_get(&pdev->dev, "extclk");
- if (!IS_ERR(priv->extclk)) {
+ if (IS_ERR(priv->extclk)) {
+ if (np && of_property_match_string(np, "clock-names", "extclk") >= 0)
+ return -EPROBE_DEFER;
+ } else {
if (priv->extclk == priv->clk) {
devm_clk_put(&pdev->dev, priv->extclk);
priv->extclk = ERR_PTR(-EINVAL);
--
Ken ar c'henta? | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] ASoC: kirkwood: fix loss of external clock at probe time
2013-09-19 9:49 [PATCH] ASoC: kirkwood: fix loss of external clock at probe time Jean-Francois Moine
@ 2013-09-19 11:06 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-09-19 11:06 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 19, 2013 at 11:49:57AM +0200, Jean-Francois Moine wrote:
> priv->extclk = devm_clk_get(&pdev->dev, "extclk");
> - if (!IS_ERR(priv->extclk)) {
> + if (IS_ERR(priv->extclk)) {
> + if (np && of_property_match_string(np, "clock-names", "extclk") >= 0)
> + return -EPROBE_DEFER;
> + } else {
This one really does seem like something the clock API ought to be
doing, either as standard or with a separate helper - essentially every
driver ought to be doing this for robustness. Doing it on general
failures is more tricky but in the specific case where we know the clock
should be present but we don't have the driver loaded yet.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130919/91152073/attachment.sig>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-19 11:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-19 9:49 [PATCH] ASoC: kirkwood: fix loss of external clock at probe time Jean-Francois Moine
2013-09-19 11:06 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox