mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolin Chen <nicoleotsuka@gmail.com>
To: Shengjiu Wang <shengjiu.wang@nxp.com>
Cc: timur@kernel.org, Xiubo.Lee@gmail.com, festevam@gmail.com,
	broonie@kernel.org, alsa-devel@alsa-project.org,
	lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
	robh+dt@kernel.org, mark.rutland@arm.com,
	devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 5/7] ASoC: fsl_asrc: Move common definition to fsl_asrc_common
Date: Mon, 13 Apr 2020 19:07:49 -0700	[thread overview]
Message-ID: <20200414020748.GB10195@Asurada-Nvidia.nvidia.com> (raw)
In-Reply-To: <6d2bed91bcdbc3f75a9d12ac4ebf6c34c9bb9c3f.1586747728.git.shengjiu.wang@nxp.com>

On Tue, Apr 14, 2020 at 08:43:07AM +0800, Shengjiu Wang wrote:
> There is a new ASRC included in i.MX serial platform, there
> are some common definition can be shared with each other.
> So move the common definition to a separate header file.
> 
> And add fsl_asrc_pair_priv and fsl_asrc_priv for
> the variable specific for the module, which can be used
> internally.
> 
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>

> diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
> +static size_t fsl_asrc_get_pair_priv_size(void)
> +{
> +	return sizeof(struct fsl_asrc_pair_priv);
> +}

Perhaps we haven't understood completely each other's point.

Yet, would the following change work?

> diff --git a/sound/soc/fsl/fsl_asrc_common.h b/sound/soc/fsl/fsl_asrc_common.h
> new file mode 100644
> index 000000000000..b15244e027d0
> --- /dev/null
> +++ b/sound/soc/fsl/fsl_asrc_common.h
> +struct fsl_asrc {
> +	size_t (*get_pair_priv_size)(void);

+	size_t pair_priv_size;

> diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
> @@ -992,25 +1012,32 @@ static int fsl_asrc_probe(struct platform_device *pdev)
> +	asrc->get_pair_priv_size = fsl_asrc_get_pair_priv_size;

+	asrc->pair_priv_size = sizeof(struct fsl_asrc_pair_priv);

> diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
> @@ -311,11 +311,12 @@ static int fsl_asrc_dma_startup(struct snd_soc_component *component,
>  		return ret;
>  	}
>  
> -	pair = kzalloc(sizeof(struct fsl_asrc_pair), GFP_KERNEL);
> +	pair = kzalloc(sizeof(*pair) + asrc->get_pair_priv_size(), GFP_KERNEL);

+	pair = kzalloc(sizeof(*pair) + asrc->pair_priv_size, GFP_KERNEL);

  reply	other threads:[~2020-04-14  2:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14  0:43 [PATCH v7 0/7] ASoC: Add new module driver for new ASRC Shengjiu Wang
2020-04-14  0:43 ` [PATCH v7 1/7] ASoC: fsl_asrc: rename asrc_priv to asrc Shengjiu Wang
2020-04-14  0:43 ` [PATCH v7 2/7] ASoC: dt-bindings: fsl_asrc: Add new property fsl,asrc-format Shengjiu Wang
2020-04-14  0:43 ` [PATCH v7 3/7] ASoC: fsl-asoc-card: Support " Shengjiu Wang
2020-04-14  0:43 ` [PATCH v7 4/7] ASoC: fsl_asrc: " Shengjiu Wang
2020-04-14  1:52   ` Nicolin Chen
2020-04-14  0:43 ` [PATCH v7 5/7] ASoC: fsl_asrc: Move common definition to fsl_asrc_common Shengjiu Wang
2020-04-14  2:07   ` Nicolin Chen [this message]
2020-04-14  2:21     ` Shengjiu Wang
2020-04-14  3:00       ` Nicolin Chen
2020-04-14  0:43 ` [PATCH v7 6/7] ASoC: dt-bindings: fsl_easrc: Add document for EASRC Shengjiu Wang
2020-04-14  0:43 ` [PATCH v7 7/7] ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers Shengjiu Wang

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=20200414020748.GB10195@Asurada-Nvidia.nvidia.com \
    --to=nicoleotsuka@gmail.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=shengjiu.wang@nxp.com \
    --cc=timur@kernel.org \
    --cc=tiwai@suse.com \
    /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®