From 78df7bba4ab88dd6f663335858b92f9cfa2cb850 Mon Sep 17 00:00:00 2001 From: AngeloGioacchino Del Regno Date: Tue, 22 Feb 2022 12:11:40 +0100 Subject: pinctrl: mediatek: paris: Unify probe function by using OF match data All of the SoCs using Paris pinctrl are defining a custom probe function that is simply calling mtk_paris_pinctrl_probe() passing a pointer to the SoC specific mtk_pin_soc structure and nothing else. Simplify the probe mechanism across all pinctrl drivers that are using pinctrl-paris by passing the specific mtk_pin_soc as match data and using function mtk_paris_pinctrl_probe as a common probe function for all of them. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220222111144.20796-2-angelogioacchino.delregno@collabora.com Signed-off-by: Linus Walleij --- drivers/pinctrl/mediatek/pinctrl-paris.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/pinctrl/mediatek/pinctrl-paris.c') diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c index 85ce7ae5ec65..74517e810958 100644 --- a/drivers/pinctrl/mediatek/pinctrl-paris.c +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c @@ -1021,8 +1021,7 @@ static int mtk_pctrl_build_state(struct platform_device *pdev) return 0; } -int mtk_paris_pinctrl_probe(struct platform_device *pdev, - const struct mtk_pin_soc *soc) +int mtk_paris_pinctrl_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct pinctrl_pin_desc *pins; @@ -1034,7 +1033,11 @@ int mtk_paris_pinctrl_probe(struct platform_device *pdev, return -ENOMEM; platform_set_drvdata(pdev, hw); - hw->soc = soc; + + hw->soc = device_get_match_data(dev); + if (!hw->soc) + return -ENOENT; + hw->dev = &pdev->dev; if (!hw->soc->nbase_names) -- cgit v1.2.3