Commit 0439f262 authored by Cezary Rojewski's avatar Cezary Rojewski Committed by Mark Brown

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: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Tested-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220620101402.2684366-7-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2c53debb
......@@ -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 = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment