[PATCH v2 07/10] ASoC: Intel: (cosmetic) simplify structure member access

Cezary Rojewski cezary.rojewski at intel.com
Sun Mar 15 20:59:58 CET 2020


On 2020-03-12 20:48, Pierre-Louis Bossart wrote:
> From: Guennadi Liakhovetski <guennadi.liakhovetski at linux.intel.com>
> 
> Fix a clumsy structure member dereference in all machine drivers.
> 

> diff --git a/sound/soc/intel/boards/bdw-rt5650.c b/sound/soc/intel/boards/bdw-rt5650.c
> index 1a302436d450..058abf3eec50 100644
> --- a/sound/soc/intel/boards/bdw-rt5650.c
> +++ b/sound/soc/intel/boards/bdw-rt5650.c
> @@ -298,7 +298,7 @@ static int bdw_rt5650_probe(struct platform_device *pdev)
>   		return -ENOMEM;
>   
>   	/* override plaform name, if required */
> -	mach = (&pdev->dev)->platform_data;
> +	mach = pdev->dev.platform_data;
>   	ret = snd_soc_fixup_dai_links_platform_name(&bdw_rt5650_card,
>   						    mach->mach_params.platform);
>   

hmm, how about native getter in device.h:
	mach = dev_get_platdata(&pdev->dev);


More information about the Alsa-devel mailing list