summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2021-01-18 09:38:11 -0300
committerMark Brown <broonie@kernel.org>2021-01-20 18:47:31 +0000
commitd7388718d491463ed0fb7383a4c678b94fdda785 (patch)
tree2b064ca48a574ef6b3affe621cb047bf737ead04 /sound
parent9ce63203eb2071fe0117d2e2454c19d79af4a2f1 (diff)
downloadlinux-stable-d7388718d491463ed0fb7383a4c678b94fdda785.tar.gz
linux-stable-d7388718d491463ed0fb7383a4c678b94fdda785.tar.bz2
linux-stable-d7388718d491463ed0fb7383a4c678b94fdda785.zip
ASoC: fsl_micfil: Use of_device_get_match_data()
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> Link: https://lore.kernel.org/r/20210118123815.1630882-2-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_micfil.c7
1 files changed, 1 insertions, 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