]> Pileus Git - ~andy/linux/commitdiff
ASoC: simplify registration of snd-soc-dummy device
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 17 May 2013 09:26:15 +0000 (11:26 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 17 May 2013 11:07:49 +0000 (12:07 +0100)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-utils.c

index 4b3be6c3c91e28b170a7dcebd998559f9292f0ec..29b211e9c06020a641b1449099fc163e58770f87 100644 (file)
@@ -159,15 +159,10 @@ int __init snd_soc_util_init(void)
 {
        int ret;
 
-       soc_dummy_dev = platform_device_alloc("snd-soc-dummy", -1);
-       if (!soc_dummy_dev)
-               return -ENOMEM;
-
-       ret = platform_device_add(soc_dummy_dev);
-       if (ret != 0) {
-               platform_device_put(soc_dummy_dev);
-               return ret;
-       }
+       soc_dummy_dev =
+               platform_device_register_simple("snd-soc-dummy", -1, NULL, 0);
+       if (IS_ERR(soc_dummy_dev))
+               return PTR_ERR(soc_dummy_dev);
 
        ret = platform_driver_register(&soc_dummy_driver);
        if (ret != 0)