diff options
author | Cezary Rojewski <cezary.rojewski@intel.com> | 2022-06-20 12:13:51 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-06-23 13:07:34 +0100 |
commit | 0439f262a9b39734c1440733850969f0342c50c3 (patch) | |
tree | 5131daf2ada716ba850404ecc96d296c0f28b408 | |
parent | 2c53debbbf04eb40854fa33813514828fa455783 (diff) | |
download | linux-0439f262a9b39734c1440733850969f0342c50c3.tar.bz2 |
ASoC: Intel: hsw_rt5640: Improve probe() function quality
Declare local 'dev' and make use of it plus dev_get_platdata() to
improve code readability.
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220620101402.2684366-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/boards/hsw_rt5640.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/intel/boards/hsw_rt5640.c b/sound/soc/intel/boards/hsw_rt5640.c index f843ba5f4718..273c8e274d25 100644 --- a/sound/soc/intel/boards/hsw_rt5640.c +++ b/sound/soc/intel/boards/hsw_rt5640.c @@ -147,16 +147,17 @@ static struct snd_soc_card hsw_rt5640_card = { static int hsw_rt5640_probe(struct platform_device *pdev) { struct snd_soc_acpi_mach *mach; + struct device *dev = &pdev->dev; int ret; - hsw_rt5640_card.dev = &pdev->dev; - mach = pdev->dev.platform_data; + hsw_rt5640_card.dev = dev; + mach = dev_get_platdata(dev); ret = snd_soc_fixup_dai_links_platform_name(&hsw_rt5640_card, mach->mach_params.platform); if (ret) return ret; - return devm_snd_soc_register_card(&pdev->dev, &hsw_rt5640_card); + return devm_snd_soc_register_card(dev, &hsw_rt5640_card); } static struct platform_driver hsw_rt5640_driver = { |