diff options
| author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-09-17 00:12:46 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2013-09-19 09:57:37 -0400 |
| commit | 01984a47e21a7d36cea0d6c0933c8173391721fc (patch) | |
| tree | 67218b790f51462d7c6781f3e3db7894929bae75 | |
| parent | 0e4ff5c806263bf40ee5409ac283b776f0c11e41 (diff) | |
ASoC: imx-sgtl5000: Use devm_snd_soc_register_card
devm_snd_soc_register_card makes code simpler.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
| -rw-r--r-- | sound/soc/fsl/imx-sgtl5000.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c index 46c5b4fdfc52..78f86d870b11 100644 --- a/sound/soc/fsl/imx-sgtl5000.c +++ b/sound/soc/fsl/imx-sgtl5000.c | |||
| @@ -159,7 +159,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) | |||
| 159 | data->card.dapm_widgets = imx_sgtl5000_dapm_widgets; | 159 | data->card.dapm_widgets = imx_sgtl5000_dapm_widgets; |
| 160 | data->card.num_dapm_widgets = ARRAY_SIZE(imx_sgtl5000_dapm_widgets); | 160 | data->card.num_dapm_widgets = ARRAY_SIZE(imx_sgtl5000_dapm_widgets); |
| 161 | 161 | ||
| 162 | ret = snd_soc_register_card(&data->card); | 162 | ret = devm_snd_soc_register_card(&pdev->dev, &data->card); |
| 163 | if (ret) { | 163 | if (ret) { |
| 164 | dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); | 164 | dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); |
| 165 | goto fail; | 165 | goto fail; |
| @@ -180,15 +180,6 @@ fail: | |||
| 180 | return ret; | 180 | return ret; |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | static int imx_sgtl5000_remove(struct platform_device *pdev) | ||
| 184 | { | ||
| 185 | struct imx_sgtl5000_data *data = platform_get_drvdata(pdev); | ||
| 186 | |||
| 187 | snd_soc_unregister_card(&data->card); | ||
| 188 | |||
| 189 | return 0; | ||
| 190 | } | ||
| 191 | |||
| 192 | static const struct of_device_id imx_sgtl5000_dt_ids[] = { | 183 | static const struct of_device_id imx_sgtl5000_dt_ids[] = { |
| 193 | { .compatible = "fsl,imx-audio-sgtl5000", }, | 184 | { .compatible = "fsl,imx-audio-sgtl5000", }, |
| 194 | { /* sentinel */ } | 185 | { /* sentinel */ } |
| @@ -202,7 +193,6 @@ static struct platform_driver imx_sgtl5000_driver = { | |||
| 202 | .of_match_table = imx_sgtl5000_dt_ids, | 193 | .of_match_table = imx_sgtl5000_dt_ids, |
| 203 | }, | 194 | }, |
| 204 | .probe = imx_sgtl5000_probe, | 195 | .probe = imx_sgtl5000_probe, |
| 205 | .remove = imx_sgtl5000_remove, | ||
| 206 | }; | 196 | }; |
| 207 | module_platform_driver(imx_sgtl5000_driver); | 197 | module_platform_driver(imx_sgtl5000_driver); |
| 208 | 198 | ||
