ASoC: fsl: Fix error handling if platform_device_add fails
authorAxel Lin <axel.lin@gmail.com>
Tue, 20 Sep 2011 07:09:00 +0000 (15:09 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 20 Sep 2011 11:58:59 +0000 (12:58 +0100)
Call platform_device_put() instead of platform_device_unregister() if
platform_device_add() fails.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/fsl/mpc8610_hpcd.c
sound/soc/fsl/p1022_ds.c

index 358f0ba..31af405 100644 (file)
@@ -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:
index e8849ed..2c064a9 100644 (file)
@@ -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: