All of lore.kernel.org
 help / color / mirror / Atom feed
* ASoC: fsi: tidyup patches
@ 2012-09-10  9:13 Kuninori Morimoto
  2012-09-10  9:13 ` [PATCH 1/3] ASoC: fsi: fixup pm_runtime_disable() timing on fsi_probe() Kuninori Morimoto
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2012-09-10  9:13 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Kuninori Morimoto


Hi Mark

These are tidyup patches for fsi.c

Kuninori Morimoto (3):
      ASoC: fsi: fixup pm_runtime_disable() timing on fsi_probe()
      ASoC: fsi: tidyup: remove un-necessary operation from fsi_probe()
      ASoC: fsi: convert to devm_xxx()

 sound/soc/sh/fsi.c |   28 +++++++++-------------------
 1 file changed, 9 insertions(+), 19 deletions(-)

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] ASoC: fsi: fixup pm_runtime_disable() timing on fsi_probe()
  2012-09-10  9:13 ASoC: fsi: tidyup patches Kuninori Morimoto
@ 2012-09-10  9:13 ` Kuninori Morimoto
  2012-09-10  9:14 ` [PATCH 2/3] ASoC: fsi: tidyup: remove un-necessary operation from fsi_probe() Kuninori Morimoto
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2012-09-10  9:13 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Kuninori Morimoto

pm_runtime_disable() error handling timing on fsi_probe() was wrong.
This patch fixes it up.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/fsi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 0540408..8534989 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1730,12 +1730,12 @@ exit_snd_soc:
 exit_free_irq:
 	free_irq(irq, master);
 exit_fsib:
+	pm_runtime_disable(&pdev->dev);
 	fsi_stream_remove(&master->fsib);
 exit_fsia:
 	fsi_stream_remove(&master->fsia);
 exit_iounmap:
 	iounmap(master->base);
-	pm_runtime_disable(&pdev->dev);
 exit_kfree:
 	kfree(master);
 	master = NULL;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ASoC: fsi: tidyup: remove un-necessary operation from fsi_probe()
  2012-09-10  9:13 ASoC: fsi: tidyup patches Kuninori Morimoto
  2012-09-10  9:13 ` [PATCH 1/3] ASoC: fsi: fixup pm_runtime_disable() timing on fsi_probe() Kuninori Morimoto
@ 2012-09-10  9:14 ` Kuninori Morimoto
  2012-09-10  9:14 ` [PATCH 3/3] ASoC: fsi: convert to devm_xxx() Kuninori Morimoto
  2012-09-10  9:27 ` ASoC: fsi: tidyup patches Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2012-09-10  9:14 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Kuninori Morimoto

struct fsi_master *master became member of struct fsi_priv from
71f6e0645be42f93c0f90dfcc93b9d2d277c2ee6
(ASoC: sh_fsi: avoid using global variable)

So, master = NULL is not necessary on fsi_probe() now.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/fsi.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 8534989..a5ee2fa 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1738,7 +1738,6 @@ exit_iounmap:
 	iounmap(master->base);
 exit_kfree:
 	kfree(master);
-	master = NULL;
 exit:
 	return ret;
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] ASoC: fsi: convert to devm_xxx()
  2012-09-10  9:13 ASoC: fsi: tidyup patches Kuninori Morimoto
  2012-09-10  9:13 ` [PATCH 1/3] ASoC: fsi: fixup pm_runtime_disable() timing on fsi_probe() Kuninori Morimoto
  2012-09-10  9:14 ` [PATCH 2/3] ASoC: fsi: tidyup: remove un-necessary operation from fsi_probe() Kuninori Morimoto
@ 2012-09-10  9:14 ` Kuninori Morimoto
  2012-09-10  9:27 ` ASoC: fsi: tidyup patches Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2012-09-10  9:14 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Kuninori Morimoto

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/fsi.c |   25 ++++++++-----------------
 1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index a5ee2fa..5328ae5 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1655,22 +1655,20 @@ static int fsi_probe(struct platform_device *pdev)
 	irq = platform_get_irq(pdev, 0);
 	if (!res || (int)irq <= 0) {
 		dev_err(&pdev->dev, "Not enough FSI platform resources.\n");
-		ret = -ENODEV;
-		goto exit;
+		return -ENODEV;
 	}
 
-	master = kzalloc(sizeof(*master), GFP_KERNEL);
+	master = devm_kzalloc(&pdev->dev, sizeof(*master), GFP_KERNEL);
 	if (!master) {
 		dev_err(&pdev->dev, "Could not allocate master\n");
-		ret = -ENOMEM;
-		goto exit;
+		return -ENOMEM;
 	}
 
-	master->base = ioremap_nocache(res->start, resource_size(res));
+	master->base = devm_ioremap_nocache(&pdev->dev,
+					    res->start, resource_size(res));
 	if (!master->base) {
-		ret = -ENXIO;
 		dev_err(&pdev->dev, "Unable to ioremap FSI registers.\n");
-		goto exit_kfree;
+		return -ENXIO;
 	}
 
 	/* master setting */
@@ -1686,7 +1684,7 @@ static int fsi_probe(struct platform_device *pdev)
 	ret = fsi_stream_probe(&master->fsia, &pdev->dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "FSIA stream probe failed\n");
-		goto exit_iounmap;
+		return ret;
 	}
 
 	/* FSI B setting */
@@ -1734,11 +1732,7 @@ exit_fsib:
 	fsi_stream_remove(&master->fsib);
 exit_fsia:
 	fsi_stream_remove(&master->fsia);
-exit_iounmap:
-	iounmap(master->base);
-exit_kfree:
-	kfree(master);
-exit:
+
 	return ret;
 }
 
@@ -1757,9 +1751,6 @@ static int fsi_remove(struct platform_device *pdev)
 	fsi_stream_remove(&master->fsia);
 	fsi_stream_remove(&master->fsib);
 
-	iounmap(master->base);
-	kfree(master);
-
 	return 0;
 }
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: ASoC: fsi: tidyup patches
  2012-09-10  9:13 ASoC: fsi: tidyup patches Kuninori Morimoto
                   ` (2 preceding siblings ...)
  2012-09-10  9:14 ` [PATCH 3/3] ASoC: fsi: convert to devm_xxx() Kuninori Morimoto
@ 2012-09-10  9:27 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2012-09-10  9:27 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Liam Girdwood, Kuninori Morimoto

On Mon, Sep 10, 2012 at 02:13:10AM -0700, Kuninori Morimoto wrote:
> 
> Hi Mark
> 
> These are tidyup patches for fsi.c

Applied all, thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-10  9:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-10  9:13 ASoC: fsi: tidyup patches Kuninori Morimoto
2012-09-10  9:13 ` [PATCH 1/3] ASoC: fsi: fixup pm_runtime_disable() timing on fsi_probe() Kuninori Morimoto
2012-09-10  9:14 ` [PATCH 2/3] ASoC: fsi: tidyup: remove un-necessary operation from fsi_probe() Kuninori Morimoto
2012-09-10  9:14 ` [PATCH 3/3] ASoC: fsi: convert to devm_xxx() Kuninori Morimoto
2012-09-10  9:27 ` ASoC: fsi: tidyup patches Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.