Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: stm32: sai: Use of_device_get_match_data() to simplify code
@ 2022-05-19 12:42 Tang Bin
  2022-05-23 13:28 ` Olivier MOYSAN
  0 siblings, 1 reply; 7+ messages in thread
From: Tang Bin @ 2022-05-19 12:42 UTC (permalink / raw)
  To: olivier.moysan, arnaud.pouliquen, lgirdwood, broonie, perex,
	tiwai, mcoquelin.stm32, alexandre.torgue
  Cc: alsa-devel, Tang Bin, linux-stm32, linux-arm-kernel, linux-kernel

Retrieve of match data, it's better and cleaner to use
'of_device_get_match_data' over 'of_match_device'.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 sound/soc/stm/stm32_sai_sub.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index dd636af81..d300605a2 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -1500,7 +1500,6 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev,
 static int stm32_sai_sub_probe(struct platform_device *pdev)
 {
 	struct stm32_sai_sub_data *sai;
-	const struct of_device_id *of_id;
 	const struct snd_dmaengine_pcm_config *conf = &stm32_sai_pcm_config;
 	int ret;
 
@@ -1508,10 +1507,9 @@ static int stm32_sai_sub_probe(struct platform_device *pdev)
 	if (!sai)
 		return -ENOMEM;
 
-	of_id = of_match_device(stm32_sai_sub_ids, &pdev->dev);
-	if (!of_id)
+	sai->id = (uintptr_t)of_device_get_match_data(&pdev->dev);
+	if (!sai->id)
 		return -EINVAL;
-	sai->id = (uintptr_t)of_id->data;
 
 	sai->pdev = pdev;
 	mutex_init(&sai->ctrl_lock);
-- 
2.20.1.windows.1




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

end of thread, other threads:[~2022-05-25 12:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-19 12:42 [PATCH] ASoC: stm32: sai: Use of_device_get_match_data() to simplify code Tang Bin
2022-05-23 13:28 ` Olivier MOYSAN
2022-05-23 18:57   ` Mark Brown
2022-05-24  1:44     ` [PATCH] ASoC: stm32: sai: Use of_device_get_match_data() tosimplify code tangbin
2022-05-24 14:30       ` Olivier MOYSAN
2022-05-25  7:36         ` [PATCH] ASoC: stm32: sai: Use of_device_get_match_data()tosimplify code tangbin
2022-05-25 12:30           ` Olivier MOYSAN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox