[alsa-devel] [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get
Signed-off-by: Richard Zhao richard.zhao@freescale.com Acked-by: Timur Tabi timur@freescale.com ---
Rebase to 3.5rc1.
sound/soc/fsl/fsl_ssi.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 4ed2afd..b10a427 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -725,7 +725,7 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev) u32 dma_events[2]; ssi_private->ssi_on_imx = true;
- ssi_private->clk = clk_get(&pdev->dev, NULL); + ssi_private->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(ssi_private->clk)) { ret = PTR_ERR(ssi_private->clk); dev_err(&pdev->dev, "could not get clock: %d\n", ret); @@ -842,10 +842,8 @@ error_dev: device_remove_file(&pdev->dev, dev_attr);
error_clk: - if (ssi_private->ssi_on_imx) { + if (ssi_private->ssi_on_imx) clk_disable_unprepare(ssi_private->clk); - clk_put(ssi_private->clk); - }
error_irq: free_irq(ssi_private->irq, ssi_private); @@ -871,7 +869,6 @@ static int fsl_ssi_remove(struct platform_device *pdev) if (ssi_private->ssi_on_imx) { platform_device_unregister(ssi_private->imx_pcm_pdev); clk_disable_unprepare(ssi_private->clk); - clk_put(ssi_private->clk); } snd_soc_unregister_dai(&pdev->dev); device_remove_file(&pdev->dev, &ssi_private->dev_attr);
Signed-off-by: Richard Zhao richard.zhao@freescale.com Acked-by: Dong Aisheng dong.aisheng@linaro.org --- Rebase to 3.5rc1.
sound/soc/fsl/imx-audmux.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c index f237003..0803274 100644 --- a/sound/soc/fsl/imx-audmux.c +++ b/sound/soc/fsl/imx-audmux.c @@ -26,6 +26,7 @@ #include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/slab.h> +#include <linux/pinctrl/consumer.h>
#include "imx-audmux.h"
@@ -249,6 +250,7 @@ EXPORT_SYMBOL_GPL(imx_audmux_v2_configure_port); static int __devinit imx_audmux_probe(struct platform_device *pdev) { struct resource *res; + struct pinctrl *pinctrl; const struct of_device_id *of_id = of_match_device(imx_audmux_dt_ids, &pdev->dev);
@@ -257,6 +259,12 @@ static int __devinit imx_audmux_probe(struct platform_device *pdev) if (!audmux_base) return -EADDRNOTAVAIL;
+ pinctrl = devm_pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(pinctrl)) { + dev_err(&pdev->dev, "setup pinctrl failed!"); + return PTR_ERR(pinctrl); + } + audmux_clk = clk_get(&pdev->dev, "audmux"); if (IS_ERR(audmux_clk)) { dev_dbg(&pdev->dev, "cannot get clock: %ld\n",
On Mon, Jun 04, 2012 at 09:42:54AM +0800, Richard Zhao wrote:
Signed-off-by: Richard Zhao richard.zhao@freescale.com Acked-by: Dong Aisheng dong.aisheng@linaro.org
Applied, thanks.
On Mon, Jun 04, 2012 at 09:42:53AM +0800, Richard Zhao wrote:
Signed-off-by: Richard Zhao richard.zhao@freescale.com Acked-by: Timur Tabi timur@freescale.com
Applied, thanks.
On Mon, Jun 04, 2012 at 09:42:53AM +0800, Richard Zhao wrote:
Signed-off-by: Richard Zhao richard.zhao@freescale.com Acked-by: Timur Tabi timur@freescale.com
Rebase to 3.5rc1.
sound/soc/fsl/fsl_ssi.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 4ed2afd..b10a427 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -725,7 +725,7 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev) u32 dma_events[2]; ssi_private->ssi_on_imx = true;
ssi_private->clk = clk_get(&pdev->dev, NULL);
ssi_private->clk = devm_clk_get(&pdev->dev, NULL);
Have you tried compiling this on PowerPC? devm_clk_get is only available with CONFIG_CLKDEV_LOOKUP, I think on PowerPC this is not the case.
Sascha
On Tue, Jun 05, 2012 at 08:47:14AM +0200, Sascha Hauer wrote:
Have you tried compiling this on PowerPC? devm_clk_get is only available with CONFIG_CLKDEV_LOOKUP, I think on PowerPC this is not the case.
I've not, but I guess there will be an issue. I'd say the fix here is on the PowerPC side - it's not good to have to have Kconfig bodges for things like this in individual drivers. Ideally we'd add clkdev support...
On Tue, Jun 05, 2012 at 11:03:16AM +0100, Mark Brown wrote:
On Tue, Jun 05, 2012 at 08:47:14AM +0200, Sascha Hauer wrote:
Have you tried compiling this on PowerPC? devm_clk_get is only available with CONFIG_CLKDEV_LOOKUP, I think on PowerPC this is not the case.
I've not, but I guess there will be an issue. I'd say the fix here is on the PowerPC side - it's not good to have to have Kconfig bodges for things like this in individual drivers. Ideally we'd add clkdev support...
Or get rid of devm_clk_get()'s dependency on CLKDEV (which is in itself silly.)
On Tue, Jun 05, 2012 at 11:08:51AM +0100, Russell King - ARM Linux wrote:
On Tue, Jun 05, 2012 at 11:03:16AM +0100, Mark Brown wrote:
I've not, but I guess there will be an issue. I'd say the fix here is on the PowerPC side - it's not good to have to have Kconfig bodges for things like this in individual drivers. Ideally we'd add clkdev support...
Or get rid of devm_clk_get()'s dependency on CLKDEV (which is in itself silly.)
That'd work too, of course (providing everyone has been implementing clk_put()). Though getting everyone on the same page with the clock API seems much more worthwhile if we can do it.
On Tue, Jun 05, 2012 at 11:14:13AM +0100, Mark Brown wrote:
On Tue, Jun 05, 2012 at 11:08:51AM +0100, Russell King - ARM Linux wrote:
On Tue, Jun 05, 2012 at 11:03:16AM +0100, Mark Brown wrote:
I've not, but I guess there will be an issue. I'd say the fix here is on the PowerPC side - it's not good to have to have Kconfig bodges for things like this in individual drivers. Ideally we'd add clkdev support...
Or get rid of devm_clk_get()'s dependency on CLKDEV (which is in itself silly.)
That'd work too, of course (providing everyone has been implementing clk_put()). Though getting everyone on the same page with the clock API seems much more worthwhile if we can do it.
Why wouldn't clk_put() be implemented? Drivers call it just like clk_get().
The devm*() stuff should just be a layer on top of clk_get()/clk_put() and nothing more.
On Tue, Jun 05, 2012 at 11:15:59AM +0100, Russell King - ARM Linux wrote:
On Tue, Jun 05, 2012 at 11:14:13AM +0100, Mark Brown wrote:
That'd work too, of course (providing everyone has been implementing clk_put()). Though getting everyone on the same page with the clock API seems much more worthwhile if we can do it.
Why wouldn't clk_put() be implemented? Drivers call it just like clk_get().
Lazy people who can't be bothered, especially on platforms that do things like just return a pointer to a statically allocated clock or never really expect their drivers to be unloaded. Hopefully everyone filled in the blank but I've just got a general pessimism about relying on things like that.
The devm*() stuff should just be a layer on top of clk_get()/clk_put() and nothing more.
It is, yes.
On Tue, Jun 05, 2012 at 08:47:14AM +0200, Sascha Hauer wrote:
Have you tried compiling this on PowerPC? devm_clk_get is only available with CONFIG_CLKDEV_LOOKUP, I think on PowerPC this is not the case.
I just reverted the commit, we can try again when PowerPC has been updated somehow.
participants (4)
-
Mark Brown
-
Richard Zhao
-
Russell King - ARM Linux
-
Sascha Hauer