* [PATCH] ASoC: kirkwood: cleanup the external clock probe
@ 2013-10-21 7:46 Jean-Francois Moine
2013-10-21 8:06 ` Russell King - ARM Linux
0 siblings, 1 reply; 5+ messages in thread
From: Jean-Francois Moine @ 2013-10-21 7:46 UTC (permalink / raw)
To: Jason Cooper, Mark Brown
Cc: Thomas Petazzoni, alsa-devel, Uwe Kleine-König, Russell King,
linux-arm-kernel, Sebastian Hesselbarth
This patch checks the return value of the clk_prepare_enable of the
external clock and removes the test about a same internal and external
clock which would quite never occur and won't work in most cases
it would occur.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
---
This patch applies against broonie/sound for-next.
---
sound/soc/kirkwood/kirkwood-i2s.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c.old b/sound/soc/kirkwood/kirkwood-i2s.c.pat2
index d0504a2..c2433ea 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c.old
+++ b/sound/soc/kirkwood/kirkwood-i2s.c.pat2
@@ -500,14 +500,11 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
if (PTR_ERR(priv->extclk) == -EPROBE_DEFER)
return -EPROBE_DEFER;
} else {
- if (priv->extclk == priv->clk) {
- devm_clk_put(&pdev->dev, priv->extclk);
- priv->extclk = ERR_PTR(-EINVAL);
- } else {
- dev_info(&pdev->dev, "found external clock\n");
- clk_prepare_enable(priv->extclk);
- soc_dai = &kirkwood_i2s_dai_extclk;
- }
+ dev_info(&pdev->dev, "found external clock\n");
+ ret = clk_prepare_enable(priv->extclk);
+ if (err < 0)
+ return err;
+ soc_dai = kirkwood_i2s_dai_extclk;
}
/* Some sensible defaults - this reflects the powerup values */
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: kirkwood: cleanup the external clock probe
2013-10-21 7:46 [PATCH] ASoC: kirkwood: cleanup the external clock probe Jean-Francois Moine
@ 2013-10-21 8:06 ` Russell King - ARM Linux
2013-10-21 8:28 ` Jean-Francois Moine
0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2013-10-21 8:06 UTC (permalink / raw)
To: Jean-Francois Moine
Cc: Thomas Petazzoni, alsa-devel, Jason Cooper, Mark Brown,
Uwe Kleine-König, linux-arm-kernel, Sebastian Hesselbarth
On Mon, Oct 21, 2013 at 09:46:13AM +0200, Jean-Francois Moine wrote:
> This patch checks the return value of the clk_prepare_enable of the
> external clock and removes the test about a same internal and external
> clock which would quite never occur and won't work in most cases
> it would occur.
NAK. It can occur.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: kirkwood: cleanup the external clock probe
2013-10-21 8:06 ` Russell King - ARM Linux
@ 2013-10-21 8:28 ` Jean-Francois Moine
2013-10-21 8:52 ` Russell King - ARM Linux
0 siblings, 1 reply; 5+ messages in thread
From: Jean-Francois Moine @ 2013-10-21 8:28 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Thomas Petazzoni, alsa-devel, Jason Cooper, Mark Brown,
Uwe Kleine-König, linux-arm-kernel, Sebastian Hesselbarth
On Mon, 21 Oct 2013 09:06:57 +0100
Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> On Mon, Oct 21, 2013 at 09:46:13AM +0200, Jean-Francois Moine wrote:
> > This patch checks the return value of the clk_prepare_enable of the
> > external clock and removes the test about a same internal and external
> > clock which would quite never occur and won't work in most cases
> > it would occur.
>
> NAK. It can occur.
In which case? And, what would be the right treatment?
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: kirkwood: cleanup the external clock probe
2013-10-21 8:28 ` Jean-Francois Moine
@ 2013-10-21 8:52 ` Russell King - ARM Linux
2013-10-21 10:09 ` Jean-Francois Moine
0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2013-10-21 8:52 UTC (permalink / raw)
To: Jean-Francois Moine
Cc: Thomas Petazzoni, alsa-devel, Jason Cooper, Mark Brown,
Uwe Kleine-König, linux-arm-kernel, Sebastian Hesselbarth
On Mon, Oct 21, 2013 at 10:28:34AM +0200, Jean-Francois Moine wrote:
> On Mon, 21 Oct 2013 09:06:57 +0100
> Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
>
> > On Mon, Oct 21, 2013 at 09:46:13AM +0200, Jean-Francois Moine wrote:
> > > This patch checks the return value of the clk_prepare_enable of the
> > > external clock and removes the test about a same internal and external
> > > clock which would quite never occur and won't work in most cases
> > > it would occur.
> >
> > NAK. It can occur.
>
> In which case? And, what would be the right treatment?
priv->clk = devm_clk_get(&pdev->dev, NULL);
priv->extclk = devm_clk_get(&pdev->dev, "extclk");
Supplying the first clock to this driver without a separate "extclk"
via clkdev will return it as the second clock.
Again, NAK. Your change is against the principles of the clk API.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: kirkwood: cleanup the external clock probe
2013-10-21 8:52 ` Russell King - ARM Linux
@ 2013-10-21 10:09 ` Jean-Francois Moine
0 siblings, 0 replies; 5+ messages in thread
From: Jean-Francois Moine @ 2013-10-21 10:09 UTC (permalink / raw)
To: Mark Brown
Cc: Thomas Petazzoni, alsa-devel, Russell King - ARM Linux,
Jason Cooper, Uwe Kleine-König, linux-arm-kernel,
Sebastian Hesselbarth
On Mon, 21 Oct 2013 09:52:00 +0100
Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> > > NAK. It can occur.
> >
> > In which case? And, what would be the right treatment?
>
> priv->clk = devm_clk_get(&pdev->dev, NULL);
> priv->extclk = devm_clk_get(&pdev->dev, "extclk");
>
> Supplying the first clock to this driver without a separate "extclk"
> via clkdev will return it as the second clock.
>
> Again, NAK. Your change is against the principles of the clk API.
You are right.
Mark, please forget about this patch.
Thanks.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-21 10:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-21 7:46 [PATCH] ASoC: kirkwood: cleanup the external clock probe Jean-Francois Moine
2013-10-21 8:06 ` Russell King - ARM Linux
2013-10-21 8:28 ` Jean-Francois Moine
2013-10-21 8:52 ` Russell King - ARM Linux
2013-10-21 10:09 ` Jean-Francois Moine
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).