[alsa-devel] [PATCH 2/2] ASoC: fsl_spdif: Drop hard code in clk_get() for rxclk

Nicolin Chen Guangyu.Chen at freescale.com
Fri Apr 25 13:58:20 CEST 2014


Then we will no longer need to change the name in dev_err() if one day
we are going to change the DEFAULT_RXCLK_SRC.

Signed-off-by: Nicolin Chen <Guangyu.Chen at freescale.com>
---
 sound/soc/fsl/fsl_spdif.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 4ce4ffa..29b5da2 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -1165,9 +1165,10 @@ static int fsl_spdif_probe(struct platform_device *pdev)
 	}
 
 	/* Select clock source for rx/tx clock */
-	spdif_priv->rxclk = devm_clk_get(&pdev->dev, "rxtx1");
+	sprintf(tmp, "rxtx%d", DEFAULT_RXCLK_SRC);
+	spdif_priv->rxclk = devm_clk_get(&pdev->dev, tmp);
 	if (IS_ERR(spdif_priv->rxclk)) {
-		dev_err(&pdev->dev, "no rxtx1 clock in devicetree\n");
+		dev_err(&pdev->dev, "no %s clock in devicetree\n", tmp);
 		return PTR_ERR(spdif_priv->rxclk);
 	}
 	spdif_priv->rxclk_src = DEFAULT_RXCLK_SRC;
-- 
1.8.4



More information about the Alsa-devel mailing list