Skip to content

Commit 1de005d

Browse files
jbrun3tbroonie
authored andcommitted
ASoC: hdmi-codec: remove reference to the dai drivers in the private data
Keeping the a pointer to the dai drivers is not necessary. It is not used by the hdmi_codec after the probe. Even if it was used, the 'struct snd_soc_dai_driver' can accessed through the 'struct snd_soc_dai' so keeping the pointer in the private data structure is not useful. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3fcf94e commit 1de005d

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

sound/soc/codecs/hdmi-codec.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ static const struct hdmi_codec_cea_spk_alloc hdmi_codec_channel_alloc[] = {
278278

279279
struct hdmi_codec_priv {
280280
struct hdmi_codec_pdata hcd;
281-
struct snd_soc_dai_driver *daidrv;
282281
struct hdmi_codec_daifmt daifmt[2];
283282
uint8_t eld[MAX_ELD_BYTES];
284283
struct snd_pcm_chmap *chmap_info;
@@ -715,6 +714,7 @@ static const struct snd_soc_component_driver hdmi_driver = {
715714
static int hdmi_codec_probe(struct platform_device *pdev)
716715
{
717716
struct hdmi_codec_pdata *hcd = pdev->dev.platform_data;
717+
struct snd_soc_dai_driver *daidrv;
718718
struct device *dev = &pdev->dev;
719719
struct hdmi_codec_priv *hcp;
720720
int dai_count, i = 0;
@@ -737,27 +737,25 @@ static int hdmi_codec_probe(struct platform_device *pdev)
737737
return -ENOMEM;
738738

739739
hcp->hcd = *hcd;
740-
hcp->daidrv = devm_kcalloc(dev, dai_count, sizeof(*hcp->daidrv),
741-
GFP_KERNEL);
742-
if (!hcp->daidrv)
740+
daidrv = devm_kcalloc(dev, dai_count, sizeof(*daidrv), GFP_KERNEL);
741+
if (!daidrv)
743742
return -ENOMEM;
744743

745744
if (hcd->i2s) {
746-
hcp->daidrv[i] = hdmi_i2s_dai;
747-
hcp->daidrv[i].playback.channels_max =
748-
hcd->max_i2s_channels;
745+
daidrv[i] = hdmi_i2s_dai;
746+
daidrv[i].playback.channels_max = hcd->max_i2s_channels;
749747
i++;
750748
}
751749

752750
if (hcd->spdif) {
753-
hcp->daidrv[i] = hdmi_spdif_dai;
751+
daidrv[i] = hdmi_spdif_dai;
754752
hcp->daifmt[DAI_ID_SPDIF].fmt = HDMI_SPDIF;
755753
}
756754

757755
dev_set_drvdata(dev, hcp);
758756

759-
ret = devm_snd_soc_register_component(dev, &hdmi_driver, hcp->daidrv,
760-
dai_count);
757+
ret = devm_snd_soc_register_component(dev, &hdmi_driver, daidrv,
758+
dai_count);
761759
if (ret) {
762760
dev_err(dev, "%s: snd_soc_register_component() failed (%d)\n",
763761
__func__, ret);

0 commit comments

Comments
 (0)