Skip to content

Commit e091fed

Browse files
AngeloGioacchino Del Regnolinusw
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 <[email protected]> Reviewed-by: Chen-Yu Tsai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 78df7bb commit e091fed

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

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)