From: Jerome Brunet <jbrunet@baylibre.com>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
patchwork-bot+notify@kernel.org
Subject: [PATCH v2 3/4] ASoC: hdmi-codec: remove reference to the dai drivers in the private data
Date: Mon, 6 May 2019 11:58:14 +0200 [thread overview]
Message-ID: <20190506095815.24578-4-jbrunet@baylibre.com> (raw)
In-Reply-To: <20190506095815.24578-1-jbrunet@baylibre.com>
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>
---
sound/soc/codecs/hdmi-codec.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 4d32f93f6be6..9408e6bc4d3e 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -278,7 +278,6 @@ static const struct hdmi_codec_cea_spk_alloc hdmi_codec_channel_alloc[] = {
struct hdmi_codec_priv {
struct hdmi_codec_pdata hcd;
- struct snd_soc_dai_driver *daidrv;
struct hdmi_codec_daifmt daifmt[2];
uint8_t eld[MAX_ELD_BYTES];
struct snd_pcm_chmap *chmap_info;
@@ -715,6 +714,7 @@ static const struct snd_soc_component_driver hdmi_driver = {
static int hdmi_codec_probe(struct platform_device *pdev)
{
struct hdmi_codec_pdata *hcd = pdev->dev.platform_data;
+ struct snd_soc_dai_driver *daidrv;
struct device *dev = &pdev->dev;
struct hdmi_codec_priv *hcp;
int dai_count, i = 0;
@@ -737,27 +737,25 @@ static int hdmi_codec_probe(struct platform_device *pdev)
return -ENOMEM;
hcp->hcd = *hcd;
- hcp->daidrv = devm_kcalloc(dev, dai_count, sizeof(*hcp->daidrv),
- GFP_KERNEL);
- if (!hcp->daidrv)
+ daidrv = devm_kcalloc(dev, dai_count, sizeof(*daidrv), GFP_KERNEL);
+ if (!daidrv)
return -ENOMEM;
if (hcd->i2s) {
- hcp->daidrv[i] = hdmi_i2s_dai;
- hcp->daidrv[i].playback.channels_max =
- hcd->max_i2s_channels;
+ daidrv[i] = hdmi_i2s_dai;
+ daidrv[i].playback.channels_max = hcd->max_i2s_channels;
i++;
}
if (hcd->spdif) {
- hcp->daidrv[i] = hdmi_spdif_dai;
+ daidrv[i] = hdmi_spdif_dai;
hcp->daifmt[DAI_ID_SPDIF].fmt = HDMI_SPDIF;
}
dev_set_drvdata(dev, hcp);
- ret = devm_snd_soc_register_component(dev, &hdmi_driver, hcp->daidrv,
- dai_count);
+ ret = devm_snd_soc_register_component(dev, &hdmi_driver, daidrv,
+ dai_count);
if (ret) {
dev_err(dev, "%s: snd_soc_register_component() failed (%d)\n",
__func__, ret);
--
2.20.1
next prev parent reply other threads:[~2019-05-06 9:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-06 9:58 [PATCH v2 0/4] ASoC: hdmi-codec: fixes and improvements Jerome Brunet
2019-05-06 9:58 ` [PATCH v2 1/4] ASoC: hdmi-codec: remove function name debug traces Jerome Brunet
2019-05-08 6:50 ` Mark Brown
2019-05-08 8:08 ` Jerome Brunet
2019-05-08 9:01 ` Applied "ASoC: hdmi-codec: remove function name debug traces" to the asoc tree Mark Brown
2019-05-06 9:58 ` [PATCH v2 2/4] ASoC: hdmi-codec: remove reference to the current substream Jerome Brunet
2019-05-08 7:00 ` Mark Brown
2019-05-08 8:08 ` Jerome Brunet
2019-05-08 8:57 ` Mark Brown
2019-05-09 8:11 ` Jerome Brunet
2019-05-12 8:27 ` Mark Brown
2019-05-08 9:01 ` Applied "ASoC: hdmi-codec: remove reference to the current substream" to the asoc tree Mark Brown
2019-05-06 9:58 ` Jerome Brunet [this message]
2019-05-08 9:01 ` Applied "ASoC: hdmi-codec: remove reference to the dai drivers in the private data" " Mark Brown
2019-05-06 9:58 ` [PATCH v2 4/4] ASoC: hdmi-codec: remove ops dependency on the dai id Jerome Brunet
2019-05-08 9:01 ` Applied "ASoC: hdmi-codec: remove ops dependency on the dai id" to the asoc tree Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190506095815.24578-4-jbrunet@baylibre.com \
--to=jbrunet@baylibre.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patchwork-bot+notify@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®