Skip to contentSkip to conversation

ASoC: kirkwood: cleanup the external clock probe

PATCH In review Jean-Francois Moine 2 participants 5 messages Oct 21, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: kirkwood: cleanup the external clock probe

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.

---
This patch applies against broonie/sound for-next.

---
 sound/soc/kirkwood/kirkwood-i2s.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
sound/soc/kirkwood/kirkwood-i2s.c.pat2 renamed from sound/soc/kirkwood/kirkwood-i2s.c.old +5 -8
index d0504a2..c2433ea 100644
@@ -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 */
Signature · 6 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#1 lore raw
Quoted 4 lines · Jean-Francois Moine

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.

#2 lore raw
Quoted 7 lines · On Mon, 21 Oct 2013 09:06:57 +0100 Russell King - ARM Linux…
Quoted 4 lines · Jean-Francois Moine

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?

Signature · 6 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#3 lore raw
Quoted 4 lines · Jean-Francois Moine
Quoted 1 line · On Mon, 21 Oct 2013 09:06:57 +0100 Russell King - ARM Linux…

On Mon, Oct 21, 2013 at 09:46:13AM +0200, Jean-Francois Moine wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

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.

#4 lore raw
Quoted 11 lines · On Mon, 21 Oct 2013 09:52:00 +0100 Russell King - ARM Linux…
Quoted 3 lines
Quoted 1 line

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.

Signature · 6 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel