public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: Mengdong Lin <mengdong.lin@intel.com>,
	alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH] topology: treat all DAPM controls types the same when copying
Date: Fri, 07 Aug 2015 18:07:27 +0200	[thread overview]
Message-ID: <s5hwpx7f5fk.wl-tiwai@suse.de> (raw)
In-Reply-To: <1438961956-6239-1-git-send-email-liam.r.girdwood@linux.intel.com>

On Fri, 07 Aug 2015 17:39:15 +0200,
Liam Girdwood wrote:
> 
> From: Mengdong Lin <mengdong.lin@intel.com>
> 
> Copy all DAPM controls types using the same method.
> 
> Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

Applied, thanks.


Takashi

> ---
>  src/topology/dapm.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/src/topology/dapm.c b/src/topology/dapm.c
> index 7e26ea0..a0a8b86 100644
> --- a/src/topology/dapm.c
> +++ b/src/topology/dapm.c
> @@ -107,8 +107,6 @@ static int tplg_parse_dapm_enums(snd_config_t *cfg, struct tplg_elem *elem)
>  static int copy_dapm_control(struct tplg_elem *elem, struct tplg_elem *ref)
>  {
>  	struct snd_soc_tplg_dapm_widget *widget = elem->widget;
> -	struct snd_soc_tplg_mixer_control *mixer_ctrl = ref->mixer_ctrl;
> -	struct snd_soc_tplg_enum_control *enum_ctrl = ref->enum_ctrl;
>  
>  	tplg_dbg("Control '%s' used by '%s'\n", ref->id, elem->id);
>  	tplg_dbg("\tparent size: %d + %d -> %d, priv size -> %d\n",
> @@ -121,13 +119,10 @@ static int copy_dapm_control(struct tplg_elem *elem, struct tplg_elem *ref)
>  
>  	elem->widget = widget;
>  
> -	/* copy new widget at the end */
> -	if (ref->type == OBJECT_TYPE_MIXER)
> -		memcpy((void*)widget + elem->size, mixer_ctrl, ref->size);
> -	else if (ref->type == OBJECT_TYPE_ENUM)
> -		memcpy((void*)widget + elem->size, enum_ctrl, ref->size);
> -
> +	/* append the control to the end of the widget */
> +	memcpy((void*)widget + elem->size, ref->obj, ref->size);
>  	elem->size += ref->size;
> +
>  	widget->num_kcontrols++;
>  	ref->compound_elem = 1;
>  	return 0;
> -- 
> 2.1.4
> 

      parent reply	other threads:[~2015-08-07 16:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-07 15:39 [PATCH] topology: treat all DAPM controls types the same when copying Liam Girdwood
2015-08-07 15:39 ` [PATCH] topology: print error prefix on error message Liam Girdwood
2015-08-07 16:07   ` Takashi Iwai
2015-08-07 16:07 ` Takashi Iwai [this message]

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=s5hwpx7f5fk.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=mengdong.lin@intel.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