Commit 4e08a286 authored by ye xingchen's avatar ye xingchen Committed by Marc Zyngier

irqchip/st: Use device_get_match_data() to simplify the code

Directly get the match data with device_get_match_data().
Signed-off-by: default avatarye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/202211171916504943604@zte.com.cn
parent 9869f37a
...@@ -153,18 +153,13 @@ static int st_irq_syscfg_enable(struct platform_device *pdev) ...@@ -153,18 +153,13 @@ static int st_irq_syscfg_enable(struct platform_device *pdev)
static int st_irq_syscfg_probe(struct platform_device *pdev) static int st_irq_syscfg_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 *match;
struct st_irq_syscfg *ddata; struct st_irq_syscfg *ddata;
ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL); ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
if (!ddata) if (!ddata)
return -ENOMEM; return -ENOMEM;
match = of_match_device(st_irq_syscfg_match, &pdev->dev); ddata->syscfg = (unsigned int) device_get_match_data(&pdev->dev);
if (!match)
return -ENODEV;
ddata->syscfg = (unsigned int)match->data;
ddata->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); ddata->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg");
if (IS_ERR(ddata->regmap)) { if (IS_ERR(ddata->regmap)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment