pinctrl:sprd: Check if the pinctrl_dev still exists
Subsystems (3)
PATCH 1/1 pinctrl:sprd: Check if the pinctrl_dev still exists
to check if the pinctrl_dev still exists before calling pinctrl_unregister().
Signed-off-by Lizhe <[email protected]>
--- drivers/pinctrl/sprd/pinctrl-sprd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pinctrl/sprd/pinctrl-sprd.c +3 -1
@@ -1115,7 +1115,9 @@ int sprd_pinctrl_remove(struct platform_device *pdev) {struct sprd_pinctrl *sprd_pctl =platform_get_drvdata (pdev); -pinctrl_unregister (sprd_pctl->pctl); +if (sprd_pctl->dev) +pinctrl_unregister (sprd_pctl->pctl); +return 0 ; }EXPORT_SYMBOL_GPL (sprd_pinctrl_remove);
Signature · 1 line
2.34.1
Sun, Apr 30, 2023 at 12:22:54PM +0800, Lizhe kirjoitti:
Quoted 2 lines
to check if the
pinctrl_devstill exists before callingpinctrl_unregister().
Besides commit message has no explanation (and English grammar incorrectness)...
...
drivers/pinctrl/sprd/pinctrl-sprd.c int sprd_pinctrl_remove(struct platform_device *pdev) · line 1119
Quoted 8 lines
+++
b/drivers/pinctrl/sprd/pinctrl-sprd.cdrivers/pinctrl/sprd/pinctrl-sprd.c +1
-1@@ -1115,7 +1115,9 @@ int sprd_pinctrl_remove(struct platform_device *pdev) {struct sprd_pinctrl *sprd_pctl =platform_get_drvdata (pdev); -pinctrl_unregister (sprd_pctl->pctl); +if (sprd_pctl->dev)
...this code is not needed.
drivers/pinctrl/sprd/pinctrl-sprd.c int sprd_pinctrl_remove(struct platform_device *pdev) · line 1122
Quoted 3 lines
drivers/pinctrl/sprd/pinctrl-sprd.c +1
-0+pinctrl_unregister (sprd_pctl->pctl);return 0 ; }
NAK.
Signature · 2 lines
With Best Regards, Andy Shevchenko