linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/4] ASoC: Intel: bytcht_es8316: Get platform data via dev_get_platdata()
@ 2021-10-06 15:04 Andy Shevchenko
  2021-10-06 15:04 ` [PATCH v1 2/4] ASoC: Intel: bytcht_es8316: Use temporary variable for struct device Andy Shevchenko
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Andy Shevchenko @ 2021-10-06 15:04 UTC (permalink / raw)
  To: Mark Brown, alsa-devel, linux-kernel
  Cc: Cezary Rojewski, Pierre-Louis Bossart, Liam Girdwood, Jie Yang,
	Jaroslav Kysela, Takashi Iwai, Andy Shevchenko

Access to platform data via dev_get_platdata() getter to make code cleaner.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/intel/boards/bytcht_es8316.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
index 1bb9b8e7bcc7..4360519fbb0c 100644
--- a/sound/soc/intel/boards/bytcht_es8316.c
+++ b/sound/soc/intel/boards/bytcht_es8316.c
@@ -456,12 +456,12 @@ static const struct dmi_system_id byt_cht_es8316_quirk_table[] = {
 
 static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
 {
+	struct device *dev = &pdev->dev;
 	static const char * const mic_name[] = { "in1", "in2" };
+	struct snd_soc_acpi_mach *mach = dev_get_platdata(dev);
 	struct property_entry props[MAX_NO_PROPS] = {};
 	struct byt_cht_es8316_private *priv;
 	const struct dmi_system_id *dmi_id;
-	struct device *dev = &pdev->dev;
-	struct snd_soc_acpi_mach *mach;
 	struct fwnode_handle *fwnode;
 	const char *platform_name;
 	struct acpi_device *adev;
@@ -476,7 +476,6 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
-	mach = dev->platform_data;
 	/* fix index of codec dai */
 	for (i = 0; i < ARRAY_SIZE(byt_cht_es8316_dais); i++) {
 		if (!strcmp(byt_cht_es8316_dais[i].codecs->name,
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-10-07 21:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-06 15:04 [PATCH v1 1/4] ASoC: Intel: bytcht_es8316: Get platform data via dev_get_platdata() Andy Shevchenko
2021-10-06 15:04 ` [PATCH v1 2/4] ASoC: Intel: bytcht_es8316: Use temporary variable for struct device Andy Shevchenko
2021-10-06 15:04 ` [PATCH v1 3/4] ASoC: Intel: bytcht_es8316: Switch to use gpiod_get_optional() Andy Shevchenko
2021-10-06 15:04 ` [PATCH v1 4/4] ASoC: Intel: bytcht_es8316: Utilize dev_err_probe() to avoid log saturation Andy Shevchenko
2021-10-06 15:52 ` [PATCH v1 1/4] ASoC: Intel: bytcht_es8316: Get platform data via dev_get_platdata() Pierre-Louis Bossart
2021-10-06 16:25   ` Andy Shevchenko
2021-10-06 16:25   ` Mark Brown
2021-10-07  7:08   ` Andy Shevchenko
2021-10-07 12:59     ` Pierre-Louis Bossart
2021-10-07 21:37 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).