Let's use devm_snd_soc_register_card() instead of snd_soc_register_card() and ignore snd_soc_unregister_card()
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/fsl/eukrea-tlv320.c | 8 +------- sound/soc/fsl/p1022_ds.c | 3 +-- sound/soc/fsl/p1022_rdk.c | 3 +-- sound/soc/fsl/pcm030-audio-fabric.c | 3 +-- 4 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/sound/soc/fsl/eukrea-tlv320.c b/sound/soc/fsl/eukrea-tlv320.c index 63f1f05da947..6be074ea0b3f 100644 --- a/sound/soc/fsl/eukrea-tlv320.c +++ b/sound/soc/fsl/eukrea-tlv320.c @@ -196,7 +196,7 @@ static int eukrea_tlv320_probe(struct platform_device *pdev) } }
- ret = snd_soc_register_card(&eukrea_tlv320); + ret = devm_snd_soc_register_card(&pdev->dev, &eukrea_tlv320); err: if (ret) dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); @@ -205,11 +205,6 @@ static int eukrea_tlv320_probe(struct platform_device *pdev) return ret; }
-static void eukrea_tlv320_remove(struct platform_device *pdev) -{ - snd_soc_unregister_card(&eukrea_tlv320); -} - static const struct of_device_id imx_tlv320_dt_ids[] = { { .compatible = "eukrea,asoc-tlv320"}, { /* sentinel */ } @@ -222,7 +217,6 @@ static struct platform_driver eukrea_tlv320_driver = { .of_match_table = imx_tlv320_dt_ids, }, .probe = eukrea_tlv320_probe, - .remove_new = eukrea_tlv320_remove, };
module_platform_driver(eukrea_tlv320_driver); diff --git a/sound/soc/fsl/p1022_ds.c b/sound/soc/fsl/p1022_ds.c index 6f5eecf6d88c..da247dc705e0 100644 --- a/sound/soc/fsl/p1022_ds.c +++ b/sound/soc/fsl/p1022_ds.c @@ -374,7 +374,7 @@ static int p1022_ds_probe(struct platform_device *pdev) mdata->card.dai_link = mdata->dai;
/* Register with ASoC */ - ret = snd_soc_register_card(&mdata->card); + ret = devm_snd_soc_register_card(&pdev->dev, &mdata->card); if (ret) { dev_err(&pdev->dev, "could not register card\n"); goto error; @@ -402,7 +402,6 @@ static void p1022_ds_remove(struct platform_device *pdev) struct machine_data *mdata = container_of(card, struct machine_data, card);
- snd_soc_unregister_card(card); kfree(mdata); }
diff --git a/sound/soc/fsl/p1022_rdk.c b/sound/soc/fsl/p1022_rdk.c index 18d129c21648..67ae8a335fd1 100644 --- a/sound/soc/fsl/p1022_rdk.c +++ b/sound/soc/fsl/p1022_rdk.c @@ -325,7 +325,7 @@ static int p1022_rdk_probe(struct platform_device *pdev) mdata->card.dai_link = mdata->dai;
/* Register with ASoC */ - ret = snd_soc_register_card(&mdata->card); + ret = devm_snd_soc_register_card(&pdev->dev, &mdata->card); if (ret) { dev_err(&pdev->dev, "could not register card (ret=%i)\n", ret); goto error; @@ -351,7 +351,6 @@ static void p1022_rdk_remove(struct platform_device *pdev) struct machine_data *mdata = container_of(card, struct machine_data, card);
- snd_soc_unregister_card(card); kfree(mdata); }
diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c index 2bab0fc1de59..edef8ee8d8b0 100644 --- a/sound/soc/fsl/pcm030-audio-fabric.c +++ b/sound/soc/fsl/pcm030-audio-fabric.c @@ -97,7 +97,7 @@ static int pcm030_fabric_probe(struct platform_device *op) platform_device_put(pdata->codec_device); }
- ret = snd_soc_register_card(card); + ret = devm_snd_soc_register_card(&op->dev, card); if (ret) { dev_err(&op->dev, "snd_soc_register_card() failed: %d\n", ret); platform_device_unregister(pdata->codec_device); @@ -112,7 +112,6 @@ static void pcm030_fabric_remove(struct platform_device *op) { struct pcm030_audio_data *pdata = platform_get_drvdata(op);
- snd_soc_unregister_card(pdata->card); platform_device_unregister(pdata->codec_device); }