linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vignesh Raghavendra <vigneshr@ti.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Tony Lindgren" <tony@atomide.com>,
	"Aaro Koskinen" <aaro.koskinen@iki.fi>,
	"Janusz Krzysztofik" <jmkrzyszt@gmail.com>,
	"Wolfram Sang" <wsa@kernel.org>
Cc: <linux-omap@vger.kernel.org>, <linux-i2c@vger.kernel.org>,
	<kernel@pengutronix.de>
Subject: Re: [PATCH 48/89] i2c: omap: Convert to platform remove callback returning void
Date: Tue, 9 May 2023 11:32:00 +0530	[thread overview]
Message-ID: <34d643ea-b608-c7a6-5895-493c7df8e9fd@ti.com> (raw)
In-Reply-To: <20230508205306.1474415-49-u.kleine-koenig@pengutronix.de>



On 09/05/23 02:22, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/i2c/busses/i2c-omap.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 4199f57a6bf2..58fd6fa3edf1 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -1519,7 +1519,7 @@ omap_i2c_probe(struct platform_device *pdev)
>  	return r;
>  }
>  
> -static int omap_i2c_remove(struct platform_device *pdev)
> +static void omap_i2c_remove(struct platform_device *pdev)
>  {
>  	struct omap_i2c_dev	*omap = platform_get_drvdata(pdev);
>  	int ret;
> @@ -1535,8 +1535,6 @@ static int omap_i2c_remove(struct platform_device *pdev)
>  	pm_runtime_dont_use_autosuspend(&pdev->dev);
>  	pm_runtime_put_sync(&pdev->dev);
>  	pm_runtime_disable(&pdev->dev);
> -
> -	return 0;
>  }
>  
>  static int __maybe_unused omap_i2c_runtime_suspend(struct device *dev)
> @@ -1588,7 +1586,7 @@ static const struct dev_pm_ops omap_i2c_pm_ops = {
>  
>  static struct platform_driver omap_i2c_driver = {
>  	.probe		= omap_i2c_probe,
> -	.remove		= omap_i2c_remove,
> +	.remove_new	= omap_i2c_remove,
>  	.driver		= {
>  		.name	= "omap_i2c",
>  		.pm	= &omap_i2c_pm_ops,


Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>


-- 
Regards
Vignesh

  reply	other threads:[~2023-05-09  6:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-08 20:51 [PATCH 00/89] i2c: Convert to platform remove callback returning void Uwe Kleine-König
2023-05-08 20:52 ` [PATCH 48/89] i2c: omap: " Uwe Kleine-König
2023-05-09  6:02   ` Vignesh Raghavendra [this message]
2023-06-01  7:33 ` [PATCH 00/89] i2c: " Uwe Kleine-König
2023-06-01  7:43   ` Biju Das
2023-06-01 13:54   ` Wolfram Sang
2023-06-05  7:54     ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34d643ea-b608-c7a6-5895-493c7df8e9fd@ti.com \
    --to=vigneshr@ti.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=jmkrzyszt@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).