[alsa-devel] [PATCH 2/2] ASoC: rt5645: set platform data base on DMI
Mark Brown
broonie at kernel.org
Fri Apr 24 12:12:03 CEST 2015
On Thu, Apr 23, 2015 at 04:35:18PM -0700, yang.a.fang at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20150424/6caca554/attachment.sig>
More information about the Alsa-devel
mailing list