irqchip: st: Use device_get_match_data() to simplify the code
PATCH 1/1 irqchip: st: Use device_get_match_data() to simplify the code
From: ye xingchen <[email protected]>
Directly get the match data with device_get_match_data().
Signed-off-by ye xingchen <[email protected]>
--- drivers/irqchip/irq-st.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/irqchip/irq-st.c +1 -6
@@ -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)) {
Signature · 1 line
2.25.1
[irqchip: irq/irqchip-next] irqchip/st: Use device_get_match_data() to simplify the code
The following commit has been merged into the irq/irqchip-next branch of irqchip:
The following commit has been merged into the irq/irqchip-next branch of irqchip:
Commit-ID: 4e08a286b1f7a0a32828d6411255296e4ef51fa6 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/4e08a286b1f7a0a32828d6411255296e4ef51fa6 Author: ye xingchen <[email protected]> AuthorDate: Thu, 17 Nov 2022 19:16:50 +08:00 Committer: Marc Zyngier <[email protected]> CommitterDate: Sat, 26 Nov 2022 13:29:42
irqchip/st: Use device_get_match_data() to simplify the code
Directly get the match data with device_get_match_data().
Signed-off-by ye xingchen <[email protected]>
Signed-off-by Marc Zyngier <[email protected]>
--- drivers/irqchip/irq-st.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/irqchip/irq-st.c +1 -6
@@ -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)) {