mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
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>
This commit is contained in:
parent
9ce63203eb
commit
d7388718d4
1 changed files with 1 additions and 6 deletions
|
@ -637,7 +637,6 @@ static irqreturn_t micfil_err_isr(int irq, void *devid)
|
||||||
static int fsl_micfil_probe(struct platform_device *pdev)
|
static int fsl_micfil_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct device_node *np = pdev->dev.of_node;
|
struct device_node *np = pdev->dev.of_node;
|
||||||
const struct of_device_id *of_id;
|
|
||||||
struct fsl_micfil *micfil;
|
struct fsl_micfil *micfil;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
void __iomem *regs;
|
void __iomem *regs;
|
||||||
|
@ -651,11 +650,7 @@ static int fsl_micfil_probe(struct platform_device *pdev)
|
||||||
micfil->pdev = pdev;
|
micfil->pdev = pdev;
|
||||||
strncpy(micfil->name, np->name, sizeof(micfil->name) - 1);
|
strncpy(micfil->name, np->name, sizeof(micfil->name) - 1);
|
||||||
|
|
||||||
of_id = of_match_device(fsl_micfil_dt_ids, &pdev->dev);
|
micfil->soc = of_device_get_match_data(&pdev->dev);
|
||||||
if (!of_id || !of_id->data)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
micfil->soc = of_id->data;
|
|
||||||
|
|
||||||
/* ipg_clk is used to control the registers
|
/* ipg_clk is used to control the registers
|
||||||
* ipg_clk_app is used to operate the filter
|
* ipg_clk_app is used to operate the filter
|
||||||
|
|
Loading…
Reference in a new issue