mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
pinctrl: samsung: defer pinctrl_enable
dev_pinctrl_register function immediately enables the pinctrl subsystem, which is unpreferable in general, since drivers might be unable to handle calls immediately. Hence devm_pinctrl_register_and_init, which does not call pinctrl_enable, is preferred. In case of our driver using the old function does not seem to be problematic for now, but will become an issue when we postpone parts of pinctrl initialization in a future commit, and it is a good idea to move off a deprecated-ish function anyway. Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Tested-by: Sam Protsenko <semen.protsenko@linaro.org> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://lore.kernel.org/r/20231006125557.212681-2-m.majewski2@samsung.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
This commit is contained in:
parent
4e1e21117e
commit
2aca5c591e
|
|
@ -904,11 +904,11 @@ static int samsung_pinctrl_register(struct platform_device *pdev,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
drvdata->pctl_dev = devm_pinctrl_register(&pdev->dev, ctrldesc,
|
||||
drvdata);
|
||||
if (IS_ERR(drvdata->pctl_dev)) {
|
||||
ret = devm_pinctrl_register_and_init(&pdev->dev, ctrldesc, drvdata,
|
||||
&drvdata->pctl_dev);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "could not register pinctrl driver\n");
|
||||
return PTR_ERR(drvdata->pctl_dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (bank = 0; bank < drvdata->nr_banks; ++bank) {
|
||||
|
|
@ -1176,6 +1176,10 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
|
|||
if (ret)
|
||||
goto err_unregister;
|
||||
|
||||
ret = pinctrl_enable(drvdata->pctl_dev);
|
||||
if (ret)
|
||||
goto err_unregister;
|
||||
|
||||
platform_set_drvdata(pdev, drvdata);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user