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

Configure Feed

Select the types of activity you want to include in your feed.

gpio: creg-snps: Simplify with device_get_match_data()

Driver's probe function matches against driver's of_device_id table,
where each entry has non-NULL match data, so of_match_node() can be
simplified with device_get_match_data().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20251219-gpio-of-match-v3-2-6b84194a02a8@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

authored by

Krzysztof Kozlowski and committed by
Bartosz Golaszewski
da7c18a4 cecf10b7

+1 -3
+1 -3
drivers/gpio/gpio-creg-snps.c
··· 134 134 135 135 static int creg_gpio_probe(struct platform_device *pdev) 136 136 { 137 - const struct of_device_id *match; 138 137 struct device *dev = &pdev->dev; 139 138 struct creg_gpio *hcg; 140 139 u32 ngpios; ··· 147 148 if (IS_ERR(hcg->regs)) 148 149 return PTR_ERR(hcg->regs); 149 150 150 - match = of_match_node(creg_gpio_ids, pdev->dev.of_node); 151 - hcg->layout = match->data; 151 + hcg->layout = device_get_match_data(dev); 152 152 if (!hcg->layout) 153 153 return -EINVAL; 154 154