Skip to content

Commit e091fed

Browse files
AngeloGioacchino Del RegnoLinus Walleij
authored andcommitted
pinctrl: mediatek: common-v1: Add common probe function
As a preparation to cleanup the probe mechanism of mediatek pinctrl drivers that are using the v1 controller, add a common probe function to this driver. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://lore.kernel.org/r/20220222111144.20796-3-angelogioacchino.delregno@collabora.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 78df7bb commit e091fed

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/pinctrl/mediatek/pinctrl-mtk-common.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,3 +1117,14 @@ int mtk_pctrl_init(struct platform_device *pdev,
11171117
gpiochip_remove(pctl->chip);
11181118
return ret;
11191119
}
1120+
1121+
int mtk_pctrl_common_probe(struct platform_device *pdev)
1122+
{
1123+
struct device *dev = &pdev->dev;
1124+
const struct mtk_pinctrl_devdata *data = device_get_match_data(dev);
1125+
1126+
if (!data)
1127+
return -ENODEV;
1128+
1129+
return mtk_pctrl_init(pdev, data, NULL);
1130+
}

drivers/pinctrl/mediatek/pinctrl-mtk-common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ int mtk_pctrl_init(struct platform_device *pdev,
277277
const struct mtk_pinctrl_devdata *data,
278278
struct regmap *regmap);
279279

280+
int mtk_pctrl_common_probe(struct platform_device *pdev);
281+
280282
int mtk_pctrl_spec_pull_set_samereg(struct regmap *regmap,
281283
const struct mtk_pin_spec_pupd_set_samereg *pupd_infos,
282284
unsigned int info_num, unsigned int pin,

0 commit comments

Comments
 (0)