pinctrl: samsung: Finish initializing the gpios before registering them

As soon as a gpio is registered, it should be usable by a consumer. So,
do all the initialization before registering the gpios. Without this
change, a consumer can request a GPIO IRQ and have the gpio to IRQ
mapping fail.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Chanho Park <chanho61.park@samsung.com>
Tested-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220727013349.3056826-1-saravanak@google.com
This commit is contained in:
Saravana Kannan 2022-07-26 18:33:48 -07:00 committed by Krzysztof Kozlowski
parent 568035b01c
commit 152a81a0b1

View File

@ -1166,15 +1166,15 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
if (ret) if (ret)
goto err_put_banks; goto err_put_banks;
ret = samsung_gpiolib_register(pdev, drvdata);
if (ret)
goto err_unregister;
if (ctrl->eint_gpio_init) if (ctrl->eint_gpio_init)
ctrl->eint_gpio_init(drvdata); ctrl->eint_gpio_init(drvdata);
if (ctrl->eint_wkup_init) if (ctrl->eint_wkup_init)
ctrl->eint_wkup_init(drvdata); ctrl->eint_wkup_init(drvdata);
ret = samsung_gpiolib_register(pdev, drvdata);
if (ret)
goto err_unregister;
platform_set_drvdata(pdev, drvdata); platform_set_drvdata(pdev, drvdata);
return 0; return 0;