|
@@ -439,24 +439,20 @@ static int __init neo1973_gta02_init(void)
|
|
|
|
|
|
/* register bluetooth DAI here */
|
|
/* register bluetooth DAI here */
|
|
ret = snd_soc_register_dai(&neo1973_gta02_snd_device->dev, &bt_dai);
|
|
ret = snd_soc_register_dai(&neo1973_gta02_snd_device->dev, &bt_dai);
|
|
- if (ret) {
|
|
|
|
- platform_device_put(neo1973_gta02_snd_device);
|
|
|
|
- return ret;
|
|
|
|
- }
|
|
|
|
|
|
+ if (ret)
|
|
|
|
+ goto err_put_device;
|
|
|
|
|
|
platform_set_drvdata(neo1973_gta02_snd_device, &neo1973_gta02);
|
|
platform_set_drvdata(neo1973_gta02_snd_device, &neo1973_gta02);
|
|
ret = platform_device_add(neo1973_gta02_snd_device);
|
|
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 */
|
|
/* Initialise GPIOs used by amp */
|
|
ret = gpio_request(GTA02_GPIO_HP_IN, "GTA02_HP_IN");
|
|
ret = gpio_request(GTA02_GPIO_HP_IN, "GTA02_HP_IN");
|
|
if (ret) {
|
|
if (ret) {
|
|
pr_err("gta02_wm8753: Failed to register GPIO %d\n", GTA02_GPIO_HP_IN);
|
|
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);
|
|
ret = gpio_direction_output(GTA02_GPIO_HP_IN, 1);
|
|
@@ -483,8 +479,12 @@ err_free_gpio_amp_shut:
|
|
gpio_free(GTA02_GPIO_AMP_SHUT);
|
|
gpio_free(GTA02_GPIO_AMP_SHUT);
|
|
err_free_gpio_hp_in:
|
|
err_free_gpio_hp_in:
|
|
gpio_free(GTA02_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;
|
|
return ret;
|
|
}
|
|
}
|
|
module_init(neo1973_gta02_init);
|
|
module_init(neo1973_gta02_init);
|