linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pwm: ab8500: Don't check the return code of pwmchip_remove()
@ 2021-09-08  6:02 zhaoxiao
  2021-09-08  9:17 ` Uwe Kleine-König
  0 siblings, 1 reply; 2+ messages in thread
From: zhaoxiao @ 2021-09-08  6:02 UTC (permalink / raw)
  To: thierry.reding, lee.jones
  Cc: u.kleine-koenig, linux-pwm, linux-kernel, zhaoxiao

pwmchip_remove() returns always 0. Don't use the value to make it
possible to eventually change the function to return void. Also the
driver core ignores the return value of ab8500_pwm_remove()
and considers the device removed anyhow. So returning early results
in a resource leak.

Signed-off-by: zhaoxiao <long870912@gmail.com>
---
 drivers/pwm/pwm-ab8500.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/pwm/pwm-ab8500.c b/drivers/pwm/pwm-ab8500.c
index e2a26d9da25b..51132a076f7f 100644
--- a/drivers/pwm/pwm-ab8500.c
+++ b/drivers/pwm/pwm-ab8500.c
@@ -113,11 +113,8 @@ static int ab8500_pwm_probe(struct platform_device *pdev)
 static int ab8500_pwm_remove(struct platform_device *pdev)
 {
 	struct ab8500_pwm_chip *ab8500 = platform_get_drvdata(pdev);
-	int err;
 
-	err = pwmchip_remove(&ab8500->chip);
-	if (err < 0)
-		return err;
+	pwmchip_remove(&ab8500->chip);
 
 	dev_dbg(&pdev->dev, "pwm driver removed\n");
 
-- 
2.20.1


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

* Re: [PATCH] pwm: ab8500: Don't check the return code of pwmchip_remove()
  2021-09-08  6:02 [PATCH] pwm: ab8500: Don't check the return code of pwmchip_remove() zhaoxiao
@ 2021-09-08  9:17 ` Uwe Kleine-König
  0 siblings, 0 replies; 2+ messages in thread
From: Uwe Kleine-König @ 2021-09-08  9:17 UTC (permalink / raw)
  To: zhaoxiao; +Cc: thierry.reding, lee.jones, linux-pwm, linux-kernel

Hello zhaoxiao,

On Wed, Sep 08, 2021 at 02:02:00PM +0800, zhaoxiao wrote:
> pwmchip_remove() returns always 0. Don't use the value to make it
> possible to eventually change the function to return void. Also the
> driver core ignores the return value of ab8500_pwm_remove()
> and considers the device removed anyhow. So returning early results
> in a resource leak.
> 
> Signed-off-by: zhaoxiao <long870912@gmail.com>

Can you please base your patches on top of linux-next? This patch is
invalid in the presence of 
https://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm.git/commit/?h=for-next&id=14ac9e17f9bd4bd0dfe18e384a3c2ca8dfbffcc8

So this is waste of your (and my) time :-\

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

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

end of thread, other threads:[~2021-09-08  9:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08  6:02 [PATCH] pwm: ab8500: Don't check the return code of pwmchip_remove() zhaoxiao
2021-09-08  9:17 ` Uwe Kleine-König

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