]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
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 358f0baaf71b2df230295cda7ccf9f4df2fa901a..31af405bda843cc691e755cc6bb4a0afec78925f 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 e8849ed36cbd10a010bbae3191bc2d0a6d6cc2f8..2c064a9824adf84d345829be5d6d80544df5c7d8 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: