alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] ASoC: fsl_ssi: Use of_device_get_match_data()
@ 2021-01-18 12:38 Fabio Estevam
  2021-01-18 12:38 ` [PATCH 2/6] ASoC: fsl_micfil: " Fabio Estevam
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Fabio Estevam @ 2021-01-18 12:38 UTC (permalink / raw)
  To: broonie; +Cc: nicoleotsuka, alsa-devel, Fabio Estevam, shengjiu.wang, timur

The retrieval of driver data via of_device_get_match_data() can make
the code simpler.

Use of_device_get_match_data() to simplify the code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 sound/soc/fsl/fsl_ssi.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 404be27c15fe..db4ba5f22b77 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -1397,18 +1397,11 @@ static int fsl_ssi_probe_from_dt(struct fsl_ssi *ssi)
 {
 	struct device *dev = ssi->dev;
 	struct device_node *np = dev->of_node;
-	const struct of_device_id *of_id;
 	const char *p, *sprop;
 	const __be32 *iprop;
 	u32 dmas[4];
 	int ret;
 
-	of_id = of_match_device(fsl_ssi_ids, dev);
-	if (!of_id || !of_id->data)
-		return -EINVAL;
-
-	ssi->soc = of_id->data;
-
 	ret = of_property_match_string(np, "clock-names", "ipg");
 	/* Get error code if not found */
 	ssi->has_ipg_clk_name = ret >= 0;
@@ -1492,6 +1485,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	ssi->dev = dev;
+	ssi->soc = of_device_get_match_data(&pdev->dev);
 
 	/* Probe from DT */
 	ret = fsl_ssi_probe_from_dt(ssi);
-- 
2.17.1


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

end of thread, other threads:[~2021-01-21  0:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 12:38 [PATCH 1/6] ASoC: fsl_ssi: Use of_device_get_match_data() Fabio Estevam
2021-01-18 12:38 ` [PATCH 2/6] ASoC: fsl_micfil: " Fabio Estevam
2021-01-18 12:38 ` [PATCH 3/6] ASoC: fsl_xcvr: Remove unused of_id variable Fabio Estevam
2021-01-18 12:38 ` [PATCH 4/6] ASoC: fsl_asrc: Remove of_device_get_match_data() error check Fabio Estevam
2021-01-18 12:38 ` [PATCH 5/6] ASoC: fsl_esai: " Fabio Estevam
2021-01-18 12:38 ` [PATCH 6/6] ASoC: fsl_spdif: " Fabio Estevam
2021-01-21  0:05 ` [PATCH 1/6] ASoC: fsl_ssi: Use of_device_get_match_data() 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).