Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: yang.a.fang@intel.com
Cc: alsa-devel@alsa-project.org, vinod.koul@intel.com,
	praveen.k.jain@intel.com, lgirdwood@gmail.com,
	denny.iriawan@intel.com, sathyanarayana.nujella@intel.com,
	kevin.strasser@linux.intel.com, bardliao@realtek.com
Subject: Re: [PATCH 2/2] ASoC: rt5645: set platform data base on DMI
Date: Fri, 24 Apr 2015 11:12:03 +0100	[thread overview]
Message-ID: <20150424101203.GL22845@sirena.org.uk> (raw)
In-Reply-To: <1429832118-20741-2-git-send-email-yang.a.fang@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 727 bytes --]

On Thu, Apr 23, 2015 at 04:35:18PM -0700, yang.a.fang@intel.com wrote:

> +static int strago_quirk_cb(const struct dmi_system_id *id)
> +{
> +	struct rt5645_priv **rt5645;
> +
> +	rt5645 = (struct rt5645_priv **)id->driver_data;
> +
> +	if (*rt5645) {
> +
> +		(*rt5645)->pdata.dmic_en = 1;
> +		(*rt5645)->pdata.dmic1_data_pin = -1;
> +		(*rt5645)->pdata.dmic2_data_pin = RT5645_DMIC_DATA_IN2P;
> +		(*rt5645)->pdata.en_jd_func = 1;
> +		(*rt5645)->pdata.jd_mode = 3;
> +
> +	}
> +
> +	return 1;
> +}

This doesn't look good - we're modifying the driver data which should
really be global static data.  I'd expect us to be doing something like
return a pointer to the platform data for the device, not modify things
in place.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2015-04-24 10:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 23:35 [PATCH 1/2] ASoC: rt5645: Add ACPI match ID yang.a.fang
2015-04-23 23:35 ` [PATCH 2/2] ASoC: rt5645: set platform data base on DMI yang.a.fang
2015-04-24 10:12   ` Mark Brown [this message]
2015-04-25  0:50   ` [PATCH v2] " yang.a.fang
2015-04-27 21:00     ` Mark Brown
2015-04-24 10:14 ` [PATCH 1/2] ASoC: rt5645: Add ACPI match ID 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=20150424101203.GL22845@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=denny.iriawan@intel.com \
    --cc=kevin.strasser@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=praveen.k.jain@intel.com \
    --cc=sathyanarayana.nujella@intel.com \
    --cc=vinod.koul@intel.com \
    --cc=yang.a.fang@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