pinctrl:sprd: Check if the pinctrl_dev still exists
Commit Message
to check if the pinctrl_dev still exists before calling
pinctrl_unregister().
Signed-off-by: Lizhe <sensor1010@163.com>
---
drivers/pinctrl/sprd/pinctrl-sprd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
Sun, Apr 30, 2023 at 10:01:29PM +0800, Lizhe kirjoitti:
> to check if the pinctrl_dev still exists before calling
> pinctrl_unregister().
Sending a duplicate won't give anything new here, the patch itself is bogus.
@@ -1114,8 +1114,10 @@ EXPORT_SYMBOL_GPL(sprd_pinctrl_core_probe);
int sprd_pinctrl_remove(struct platform_device *pdev)
{
struct sprd_pinctrl *sprd_pctl = platform_get_drvdata(pdev);
+
+ if (sprd_pctl->pctl)
+ pinctrl_unregister(sprd_pctl->pctl);
- pinctrl_unregister(sprd_pctl->pctl);
return 0;
}
EXPORT_SYMBOL_GPL(sprd_pinctrl_remove);