linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl:sprd: Check if the pinctrl_dev still exists
@ 2023-04-30  4:22 Lizhe
  2023-04-30  9:43 ` andy.shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Lizhe @ 2023-04-30  4:22 UTC (permalink / raw)
  To: linus.walleij, orsonzhai, baolin.wang, zhang.lyra,
	andriy.shevchenko, sensor1010
  Cc: linux-gpio, linux-kernel

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(-)

diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c
index ca9659f4e4b1..6f3369130e8a 100644
--- a/drivers/pinctrl/sprd/pinctrl-sprd.c
+++ b/drivers/pinctrl/sprd/pinctrl-sprd.c
@@ -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);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] pinctrl:sprd: Check if the pinctrl_dev still exists
  2023-04-30  4:22 Lizhe
@ 2023-04-30  9:43 ` andy.shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: andy.shevchenko @ 2023-04-30  9:43 UTC (permalink / raw)
  To: Lizhe
  Cc: linus.walleij, orsonzhai, baolin.wang, zhang.lyra,
	andriy.shevchenko, linux-gpio, linux-kernel

Sun, Apr 30, 2023 at 12:22:54PM +0800, Lizhe kirjoitti:
> to check if the pinctrl_dev still exists before calling
> pinctrl_unregister().

Besides commit message has no explanation (and English grammar
incorrectness)...

...

> +++ b/drivers/pinctrl/sprd/pinctrl-sprd.c
> @@ -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.

> +		pinctrl_unregister(sprd_pctl->pctl);
>  	return 0;
>  }

NAK.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] pinctrl:sprd: Check if the pinctrl_dev still exists
@ 2023-04-30 14:01 Lizhe
  2023-04-30 19:18 ` andy.shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Lizhe @ 2023-04-30 14:01 UTC (permalink / raw)
  To: linus.walleij, orsonzhai, baolin.wang, zhang.lyra,
	andriy.shevchenko
  Cc: linux-gpio, linux-kernel, Lizhe

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(-)

diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c
index ca9659f4e4b1..52089e34435c 100644
--- a/drivers/pinctrl/sprd/pinctrl-sprd.c
+++ b/drivers/pinctrl/sprd/pinctrl-sprd.c
@@ -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);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] pinctrl:sprd: Check if the pinctrl_dev still exists
  2023-04-30 14:01 [PATCH] pinctrl:sprd: Check if the pinctrl_dev still exists Lizhe
@ 2023-04-30 19:18 ` andy.shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: andy.shevchenko @ 2023-04-30 19:18 UTC (permalink / raw)
  To: Lizhe
  Cc: linus.walleij, orsonzhai, baolin.wang, zhang.lyra,
	andriy.shevchenko, linux-gpio, linux-kernel

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.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-30 19:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-30 14:01 [PATCH] pinctrl:sprd: Check if the pinctrl_dev still exists Lizhe
2023-04-30 19:18 ` andy.shevchenko
  -- strict thread matches above, loose matches on Subject: below --
2023-04-30  4:22 Lizhe
2023-04-30  9:43 ` andy.shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).