summaryrefslogtreecommitdiff
path: root/sound/soc/qcom/apq8096.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/qcom/apq8096.c')
-rw-r--r--sound/soc/qcom/apq8096.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/sound/soc/qcom/apq8096.c b/sound/soc/qcom/apq8096.c
index 6b5a381cf9b6..253549600c5a 100644
--- a/sound/soc/qcom/apq8096.c
+++ b/sound/soc/qcom/apq8096.c
@@ -109,7 +109,7 @@ static int apq8096_platform_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
int ret;
- card = kzalloc(sizeof(*card), GFP_KERNEL);
+ card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL);
if (!card)
return -ENOMEM;
@@ -117,31 +117,10 @@ static int apq8096_platform_probe(struct platform_device *pdev)
dev_set_drvdata(dev, card);
ret = qcom_snd_parse_of(card);
if (ret)
- goto err;
+ return ret;
apq8096_add_be_ops(card);
- ret = snd_soc_register_card(card);
- if (ret)
- goto err_card_register;
-
- return 0;
-
-err_card_register:
- kfree(card->dai_link);
-err:
- kfree(card);
- return ret;
-}
-
-static int apq8096_platform_remove(struct platform_device *pdev)
-{
- struct snd_soc_card *card = dev_get_drvdata(&pdev->dev);
-
- snd_soc_unregister_card(card);
- kfree(card->dai_link);
- kfree(card);
-
- return 0;
+ return devm_snd_soc_register_card(dev, card);
}
static const struct of_device_id msm_snd_apq8096_dt_match[] = {
@@ -153,7 +132,6 @@ MODULE_DEVICE_TABLE(of, msm_snd_apq8096_dt_match);
static struct platform_driver msm_snd_apq8096_driver = {
.probe = apq8096_platform_probe,
- .remove = apq8096_platform_remove,
.driver = {
.name = "msm-snd-apq8096",
.of_match_table = msm_snd_apq8096_dt_match,