alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: broonie@kernel.org
Cc: nicoleotsuka@gmail.com, alsa-devel@alsa-project.org,
	Fabio Estevam <festevam@gmail.com>,
	shengjiu.wang@nxp.com, timur@kernel.org
Subject: [PATCH 2/6] ASoC: fsl_micfil: Use of_device_get_match_data()
Date: Mon, 18 Jan 2021 09:38:11 -0300	[thread overview]
Message-ID: <20210118123815.1630882-2-festevam@gmail.com> (raw)
In-Reply-To: <20210118123815.1630882-1-festevam@gmail.com>

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_micfil.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c
index efc5daf53bba..8aedf6590b28 100644
--- a/sound/soc/fsl/fsl_micfil.c
+++ b/sound/soc/fsl/fsl_micfil.c
@@ -637,7 +637,6 @@ static irqreturn_t micfil_err_isr(int irq, void *devid)
 static int fsl_micfil_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
-	const struct of_device_id *of_id;
 	struct fsl_micfil *micfil;
 	struct resource *res;
 	void __iomem *regs;
@@ -651,11 +650,7 @@ static int fsl_micfil_probe(struct platform_device *pdev)
 	micfil->pdev = pdev;
 	strncpy(micfil->name, np->name, sizeof(micfil->name) - 1);
 
-	of_id = of_match_device(fsl_micfil_dt_ids, &pdev->dev);
-	if (!of_id || !of_id->data)
-		return -EINVAL;
-
-	micfil->soc = of_id->data;
+	micfil->soc = of_device_get_match_data(&pdev->dev);
 
 	/* ipg_clk is used to control the registers
 	 * ipg_clk_app is used to operate the filter
-- 
2.17.1


  reply	other threads:[~2021-01-18 12:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18 12:38 [PATCH 1/6] ASoC: fsl_ssi: Use of_device_get_match_data() Fabio Estevam
2021-01-18 12:38 ` Fabio Estevam [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210118123815.1630882-2-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=shengjiu.wang@nxp.com \
    --cc=timur@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).