Merge branch 'for-linus' of git://git.infradead.org/ubi-2.6
[firefly-linux-kernel-4.4.55.git] / sound / soc / samsung / neo1973_gta02_wm8753.c
index 920e8d1f8841c10450859b44e8b23df85e31cee9..0d0ae2b9eef699075fe1ba2039d373ad44145f0b 100644 (file)
@@ -397,11 +397,11 @@ static struct snd_soc_dai_link neo1973_gta02_dai[] = {
 { /* Hifi Playback - for similatious use with voice below */
        .name = "WM8753",
        .stream_name = "WM8753 HiFi",
-       .cpu_dai_name = "s3c24xx-i2s",
+       .cpu_dai_name = "s3c24xx-iis",
        .codec_dai_name = "wm8753-hifi",
        .init = neo1973_gta02_wm8753_init,
        .platform_name = "samsung-audio",
-       .codec_name = "wm8753-codec.0-0x1a",
+       .codec_name = "wm8753-codec.0-001a",
        .ops = &neo1973_gta02_hifi_ops,
 },
 { /* Voice via BT */
@@ -410,7 +410,7 @@ static struct snd_soc_dai_link neo1973_gta02_dai[] = {
        .cpu_dai_name = "bluetooth-dai",
        .codec_dai_name = "wm8753-voice",
        .ops = &neo1973_gta02_voice_ops,
-       .codec_name = "wm8753-codec.0-0x1a",
+       .codec_name = "wm8753-codec.0-001a",
        .platform_name = "samsung-audio",
 },
 };
@@ -438,25 +438,21 @@ static int __init neo1973_gta02_init(void)
                return -ENOMEM;
 
        /* register bluetooth DAI here */
-       ret = snd_soc_register_dai(&neo1973_gta02_snd_device->dev, -1, &bt_dai);
-       if (ret) {
-               platform_device_put(neo1973_gta02_snd_device);
-               return ret;
-       }
+       ret = snd_soc_register_dai(&neo1973_gta02_snd_device->dev, &bt_dai);
+       if (ret)
+               goto err_put_device;
 
        platform_set_drvdata(neo1973_gta02_snd_device, &neo1973_gta02);
        ret = platform_device_add(neo1973_gta02_snd_device);
 
-       if (ret) {
-               platform_device_put(neo1973_gta02_snd_device);
-               return ret;
-       }
+       if (ret)
+               goto err_unregister_dai;
 
        /* Initialise GPIOs used by amp */
        ret = gpio_request(GTA02_GPIO_HP_IN, "GTA02_HP_IN");
        if (ret) {
                pr_err("gta02_wm8753: Failed to register GPIO %d\n", GTA02_GPIO_HP_IN);
-               goto err_unregister_device;
+               goto err_del_device;
        }
 
        ret = gpio_direction_output(GTA02_GPIO_HP_IN, 1);
@@ -483,15 +479,19 @@ err_free_gpio_amp_shut:
        gpio_free(GTA02_GPIO_AMP_SHUT);
 err_free_gpio_hp_in:
        gpio_free(GTA02_GPIO_HP_IN);
-err_unregister_device:
-       platform_device_unregister(neo1973_gta02_snd_device);
+err_del_device:
+       platform_device_del(neo1973_gta02_snd_device);
+err_unregister_dai:
+       snd_soc_unregister_dai(&neo1973_gta02_snd_device->dev);
+err_put_device:
+       platform_device_put(neo1973_gta02_snd_device);
        return ret;
 }
 module_init(neo1973_gta02_init);
 
 static void __exit neo1973_gta02_exit(void)
 {
-       snd_soc_unregister_dai(&neo1973_gta02_snd_device->dev, -1);
+       snd_soc_unregister_dai(&neo1973_gta02_snd_device->dev);
        platform_device_unregister(neo1973_gta02_snd_device);
        gpio_free(GTA02_GPIO_HP_IN);
        gpio_free(GTA02_GPIO_AMP_SHUT);