alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: fsl: Fix error handling if platform_device_add fails
@ 2011-09-20  7:09 Axel Lin
  2011-09-20 11:21 ` Liam Girdwood
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Axel Lin @ 2011-09-20  7:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: Timur Tabi, Liam Girdwood, Mark Brown, alsa-devel

Call platform_device_put() instead of platform_device_unregister() if
platform_device_add() fails.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/fsl/mpc8610_hpcd.c |    2 +-
 sound/soc/fsl/p1022_ds.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c
index 358f0ba..31af405 100644
--- a/sound/soc/fsl/mpc8610_hpcd.c
+++ b/sound/soc/fsl/mpc8610_hpcd.c
@@ -505,7 +505,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
 	return 0;
 
 error_sound:
-	platform_device_unregister(sound_device);
+	platform_device_put(sound_device);
 error:
 	kfree(machine_data);
 error_alloc:
diff --git a/sound/soc/fsl/p1022_ds.c b/sound/soc/fsl/p1022_ds.c
index e8849ed..2c064a9 100644
--- a/sound/soc/fsl/p1022_ds.c
+++ b/sound/soc/fsl/p1022_ds.c
@@ -506,7 +506,7 @@ static int p1022_ds_probe(struct platform_device *pdev)
 
 error:
 	if (sound_device)
-		platform_device_unregister(sound_device);
+		platform_device_put(sound_device);
 
 	kfree(mdata);
 error_put:
-- 
1.7.4.1

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

end of thread, other threads:[~2011-09-27  2:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20  7:09 [PATCH] ASoC: fsl: Fix error handling if platform_device_add fails Axel Lin
2011-09-20 11:21 ` Liam Girdwood
2011-09-20 12:04 ` Mark Brown
2011-09-20 16:00 ` Timur Tabi
2011-09-21  2:23 ` Questions for dummy codec driver Leo Yan
2011-09-21 12:56   ` Mark Brown
2011-09-22  1:42     ` Leo Yan
2011-09-26 21:47       ` Mark Brown
2011-09-27  2:08 ` [PATCH] ASoC: fsl: Fix error handling if platform_device_add fails Tabi Timur-B04825
2011-09-27  2:21   ` Axel Lin

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).