diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2018-11-17 03:47:06 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-11-20 19:58:52 +0300 |
commit | 5a619b9e8883a0f9691964d001b8480df44df5b9 (patch) | |
tree | 7d863c6c974e5851422b7869017befa7d45e150a /sound/soc/intel/skylake | |
parent | b92826fa8c5a423edf6c9e385b5d433c61375cc8 (diff) | |
download | linux-5a619b9e8883a0f9691964d001b8480df44df5b9.tar.xz |
ASoC: Intel: use platform_data for machine drivers
For some reason we have different mechanisms for passing data to
machine drivers. Use the solution used by Atom/SST and SOF instead of
using drv_data as done by Skylake.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/skylake')
-rw-r--r-- | sound/soc/intel/skylake/skl.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index b66d66acbc35..f81e7996aa0c 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c @@ -534,6 +534,16 @@ static int skl_machine_device_register(struct skl *skl) return -EIO; } + mach->mach_params.platform = dev_name(bus->dev); + mach->mach_params.codec_mask = bus->codec_mask; + + ret = platform_device_add_data(pdev, (const void *)mach, sizeof(*mach)); + if (ret) { + dev_err(bus->dev, "failed to add machine device platform data\n"); + platform_device_put(pdev); + return ret; + } + ret = platform_device_add(pdev); if (ret) { dev_err(bus->dev, "failed to add machine device\n"); @@ -541,9 +551,6 @@ static int skl_machine_device_register(struct skl *skl) return -EIO; } - mach->mach_params.platform = dev_name(bus->dev); - mach->mach_params.codec_mask = bus->codec_mask; - dev_set_drvdata(&pdev->dev, mach); skl->i2s_dev = pdev; |