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

pinctrl: single: use of_device_get_match_data() to get soc data

Use of_device_get_match_data() instead of of_match_device().
It allows us to remove the forward declaration of pcs_of_match.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Masahiro Yamada and committed by
Linus Walleij
1a8764f4 80fbc2d9

+2 -6
+2 -6
drivers/pinctrl/pinctrl-single.c
··· 1270 1270 #endif 1271 1271 } 1272 1272 1273 - static const struct of_device_id pcs_of_match[]; 1274 - 1275 1273 static int pcs_add_gpio_func(struct device_node *node, struct pcs_device *pcs) 1276 1274 { 1277 1275 const char *propname = "pinctrl-single,gpio-range"; ··· 1635 1637 static int pcs_probe(struct platform_device *pdev) 1636 1638 { 1637 1639 struct device_node *np = pdev->dev.of_node; 1638 - const struct of_device_id *match; 1639 1640 struct pcs_pdata *pdata; 1640 1641 struct resource *res; 1641 1642 struct pcs_device *pcs; 1642 1643 const struct pcs_soc_data *soc; 1643 1644 int ret; 1644 1645 1645 - match = of_match_device(pcs_of_match, &pdev->dev); 1646 - if (!match) 1646 + soc = of_device_get_match_data(&pdev->dev); 1647 + if (WARN_ON(!soc)) 1647 1648 return -EINVAL; 1648 1649 1649 1650 pcs = devm_kzalloc(&pdev->dev, sizeof(*pcs), GFP_KERNEL); ··· 1655 1658 raw_spin_lock_init(&pcs->lock); 1656 1659 mutex_init(&pcs->mutex); 1657 1660 INIT_LIST_HEAD(&pcs->gpiofuncs); 1658 - soc = match->data; 1659 1661 pcs->flags = soc->flags; 1660 1662 memcpy(&pcs->socdata, soc, sizeof(*soc)); 1661 1663