[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <202211171916504943604@zte.com.cn>
Date: Thu, 17 Nov 2022 19:16:50 +0800 (CST)
From: <ye.xingchen@....com.cn>
To: <tglx@...utronix.de>
Cc: <maz@...nel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH linux-next] irqchip: st: Use device_get_match_data() to simplify the code
From: ye xingchen <ye.xingchen@....com.cn>
Directly get the match data with device_get_match_data().
Signed-off-by: ye xingchen <ye.xingchen@....com.cn>
---
drivers/irqchip/irq-st.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/irqchip/irq-st.c b/drivers/irqchip/irq-st.c
index 801551e46a7b..1b83512b29c6 100644
--- a/drivers/irqchip/irq-st.c
+++ b/drivers/irqchip/irq-st.c
@@ -153,18 +153,13 @@ static int st_irq_syscfg_enable(struct platform_device *pdev)
static int st_irq_syscfg_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
- const struct of_device_id *match;
struct st_irq_syscfg *ddata;
ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
if (!ddata)
return -ENOMEM;
- match = of_match_device(st_irq_syscfg_match, &pdev->dev);
- if (!match)
- return -ENODEV;
-
- ddata->syscfg = (unsigned int)match->data;
+ ddata->syscfg = (unsigned int) device_get_match_data(&pdev->dev);
ddata->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg");
if (IS_ERR(ddata->regmap)) {
--
2.25.1
Powered by blists - more mailing lists