Commit 985f03ba authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: hdmi-codec.c: use devm_kzalloc() for DMA data

hdmi-codec.c is using kzalloc(), but we can replace it to
devm_kzalloc() and then, we can remove .remove callback.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/874jxhmjgw.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent cc4a3a19
...@@ -823,7 +823,7 @@ static int hdmi_dai_probe(struct snd_soc_dai *dai) ...@@ -823,7 +823,7 @@ static int hdmi_dai_probe(struct snd_soc_dai *dai)
if (ret) if (ret)
return ret; return ret;
daifmt = kzalloc(sizeof(*daifmt), GFP_KERNEL); daifmt = devm_kzalloc(dai->dev, sizeof(*daifmt), GFP_KERNEL);
if (!daifmt) if (!daifmt)
return -ENOMEM; return -ENOMEM;
...@@ -890,17 +890,10 @@ static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai) ...@@ -890,17 +890,10 @@ static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai)
return 0; return 0;
} }
static int hdmi_codec_dai_remove(struct snd_soc_dai *dai)
{
kfree(dai->playback_dma_data);
return 0;
}
static const struct snd_soc_dai_driver hdmi_i2s_dai = { static const struct snd_soc_dai_driver hdmi_i2s_dai = {
.name = "i2s-hifi", .name = "i2s-hifi",
.id = DAI_ID_I2S, .id = DAI_ID_I2S,
.probe = hdmi_dai_probe, .probe = hdmi_dai_probe,
.remove = hdmi_codec_dai_remove,
.playback = { .playback = {
.stream_name = "I2S Playback", .stream_name = "I2S Playback",
.channels_min = 2, .channels_min = 2,
...@@ -925,7 +918,6 @@ static const struct snd_soc_dai_driver hdmi_spdif_dai = { ...@@ -925,7 +918,6 @@ static const struct snd_soc_dai_driver hdmi_spdif_dai = {
.name = "spdif-hifi", .name = "spdif-hifi",
.id = DAI_ID_SPDIF, .id = DAI_ID_SPDIF,
.probe = hdmi_dai_spdif_probe, .probe = hdmi_dai_spdif_probe,
.remove = hdmi_codec_dai_remove,
.playback = { .playback = {
.stream_name = "SPDIF Playback", .stream_name = "SPDIF Playback",
.channels_min = 2, .channels_min = 2,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment