From: Axel Lin Date: Tue, 20 Sep 2011 07:09:00 +0000 (+0800) Subject: ASoC: fsl: Fix error handling if platform_device_add fails X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d890a1a42dff2e6987f04f18fc9e467b10e99cc9;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ASoC: fsl: Fix error handling if platform_device_add fails Call platform_device_put() instead of platform_device_unregister() if platform_device_add() fails. Signed-off-by: Axel Lin Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c index 358f0baaf71b..31af405bda84 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 e8849ed36cbd..2c064a9824ad 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: