[PATCH v5 5/7] pinctrl: s32cc: change to "devm_pinctrl_register_and_init"
Andrei Stefanescu
andrei.stefanescu at oss.nxp.com
Fri Nov 1 01:06:11 PDT 2024
Switch from "devm_pinctrl_register" to "devm_pinctrl_register_and_init"
and "pinctrl_enable" since this is the recommended way.
Signed-off-by: Andrei Stefanescu <andrei.stefanescu at oss.nxp.com>
---
drivers/pinctrl/nxp/pinctrl-s32cc.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c
index 709e823b9c7c..10bff48852b9 100644
--- a/drivers/pinctrl/nxp/pinctrl-s32cc.c
+++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c
@@ -950,10 +950,10 @@ int s32_pinctrl_probe(struct platform_device *pdev,
return ret;
}
- ipctl->pctl = devm_pinctrl_register(&pdev->dev, s32_pinctrl_desc,
- ipctl);
- if (IS_ERR(ipctl->pctl))
- return dev_err_probe(&pdev->dev, PTR_ERR(ipctl->pctl),
+ ret = devm_pinctrl_register_and_init(&pdev->dev, s32_pinctrl_desc,
+ ipctl, &ipctl->pctl);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret,
"could not register s32 pinctrl driver\n");
#ifdef CONFIG_PM_SLEEP
@@ -966,6 +966,11 @@ int s32_pinctrl_probe(struct platform_device *pdev,
return -ENOMEM;
#endif
+ ret = pinctrl_enable(ipctl->pctl);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret,
+ "failed to enable pinctrl\n");
+
dev_info(&pdev->dev, "initialized s32 pinctrl driver\n");
return 0;
--
2.45.2
More information about the linux-arm-kernel
mailing list