]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ASoC: tegra: max98090: fix error return paths
authorShreshtha SAHU <ssahu@nvidia.com>
Wed, 24 Sep 2014 15:21:29 +0000 (20:51 +0530)
committerShreshtha Sahu <ssahu@nvidia.com>
Tue, 7 Oct 2014 05:00:19 +0000 (22:00 -0700)
- Remove switch_dev_unregister and call tegra_asoc_switch_unregister
instead in error return path corresponding to tegra_asoc_switch_register.

- Skip max97236 registration for laguna erss platorm.

Issues surfaced out on making max98090 as removable KO module.

Bug 1550880

Change-Id: I6a6c0185a3980efab3592f0733bda214aac4fc81
Signed-off-by: Shreshtha SAHU <ssahu@nvidia.com>
Reviewed-on: http://git-master/r/538458
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
sound/soc/tegra/tegra_max98090.c

index 932744c64febff68c67515ed26c934a1c99002a6..53f4bfb9b591732d3d9a4b01e24c8dd9143fb2c0 100644 (file)
@@ -1289,7 +1289,8 @@ static int tegra_late_probe(struct snd_soc_card *card)
                                card->rtd[DAI_LINK_HIFI_MAX97236].codec;
        int ret;
 
-       if (of_machine_is_compatible("nvidia,norrin"))
+       if (of_machine_is_compatible("nvidia,norrin") ||
+               of_machine_is_compatible("nvidia,laguna"))
                return 0;
 
        if (of_device_is_compatible(np, "nvidia,max97236")) {
@@ -1570,8 +1571,17 @@ err_unregister_card:
        snd_soc_unregister_card(card);
 err_switch_unregister:
 #ifdef CONFIG_SWITCH
-       switch_dev_unregister(&tegra_max98090_headset_switch);
+       tegra_asoc_switch_unregister(&tegra_max98090_headset_switch);
 #endif
+       if (machine->avdd_aud_reg) {
+               regulator_disable(machine->avdd_aud_reg);
+               regulator_put(machine->avdd_aud_reg);
+       }
+
+       if (machine->vdd_sw_1v8_reg) {
+               regulator_disable(machine->vdd_sw_1v8_reg);
+               regulator_put(machine->vdd_sw_1v8_reg);
+       }
 err_fini_utils:
        tegra_asoc_utils_fini(&machine->util_data);
 err_free_machine:
@@ -1590,7 +1600,7 @@ static int __devexit tegra_max98090_driver_remove(struct platform_device *pdev)
        struct tegra_asoc_platform_data *pdata = machine->pdata;
 
 #ifdef CONFIG_SWITCH
-       switch_dev_unregister(&tegra_max98090_headset_switch);
+       tegra_asoc_switch_unregister(&tegra_max98090_headset_switch);
 #endif
 
        if (machine->gpio_requested & GPIO_HP_MUTE)