]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/soc/s3c24xx/neo1973_wm8753.c
sound: ASoC: Fix an error path in neo1973_wm8753
[linux-2.6-omap-h63xx.git] / sound / soc / s3c24xx / neo1973_wm8753.c
index 8089f8ee05c0413f2bf4ff7f9b365a26228a8895..3aa441f19ae7d800e584731f293ca77b100af066 100644 (file)
@@ -717,12 +717,16 @@ static int __init neo1973_init(void)
        neo1973_snd_devdata.dev = &neo1973_snd_device->dev;
        ret = platform_device_add(neo1973_snd_device);
 
-       if (ret)
+       if (ret) {
                platform_device_put(neo1973_snd_device);
+               return ret;
+       }
 
        ret = i2c_add_driver(&lm4857_i2c_driver);
-       if (ret != 0)
+       if (ret != 0) {
                printk(KERN_ERR "can't add i2c driver");
+               platform_device_unregister(neo1973_snd_device);
+       }
 
        return ret;
 }