Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <ye.xingchen@zte.com.cn>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/202211171916504943604@zte.com.cn

authored by

ye xingchen and committed by
Marc Zyngier
4e08a286 9869f37a

+1 -6
+1 -6
drivers/irqchip/irq-st.c
··· 153 153 static int st_irq_syscfg_probe(struct platform_device *pdev) 154 154 { 155 155 struct device_node *np = pdev->dev.of_node; 156 - const struct of_device_id *match; 157 156 struct st_irq_syscfg *ddata; 158 157 159 158 ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL); 160 159 if (!ddata) 161 160 return -ENOMEM; 162 161 163 - match = of_match_device(st_irq_syscfg_match, &pdev->dev); 164 - if (!match) 165 - return -ENODEV; 166 - 167 - ddata->syscfg = (unsigned int)match->data; 162 + ddata->syscfg = (unsigned int) device_get_match_data(&pdev->dev); 168 163 169 164 ddata->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); 170 165 if (IS_ERR(ddata->regmap)) {