public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Eugen Hristev" <eugen.hristev@collabora.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@microchip.com>
Cc: <linux-media@vger.kernel.org>, <linux-staging@lists.linux.dev>,
	<linux-arm-kernel@lists.infradead.org>, <kernel@pengutronix.de>
Subject: Re: [PATCH 06/24] staging: media: atmel-sama5d2-isc: Convert to platform remove callback returning void
Date: Mon, 3 Apr 2023 18:24:01 +0200	[thread overview]
Message-ID: <3a883f8b-9f28-34cc-84f2-e6efc5186140@microchip.com> (raw)
In-Reply-To: <20230403154014.2564054-7-u.kleine-koenig@pengutronix.de>

On 03/04/2023 at 17:39, Uwe Kleine-König wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> 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>

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Thanks. Best regards,
   Nicolas

> ---
>   drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
> index ba0614f981a2..cc744cea1d0e 100644
> --- a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
> +++ b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
> @@ -580,7 +580,7 @@ static int atmel_isc_probe(struct platform_device *pdev)
>          return ret;
>   }
> 
> -static int atmel_isc_remove(struct platform_device *pdev)
> +static void atmel_isc_remove(struct platform_device *pdev)
>   {
>          struct isc_device *isc = platform_get_drvdata(pdev);
> 
> @@ -594,8 +594,6 @@ static int atmel_isc_remove(struct platform_device *pdev)
>          clk_disable_unprepare(isc->hclock);
> 
>          atmel_isc_clk_cleanup(isc);
> -
> -       return 0;
>   }
> 
>   static int __maybe_unused isc_runtime_suspend(struct device *dev)
> @@ -638,7 +636,7 @@ MODULE_DEVICE_TABLE(of, atmel_isc_of_match);
> 
>   static struct platform_driver atmel_isc_driver = {
>          .probe  = atmel_isc_probe,
> -       .remove = atmel_isc_remove,
> +       .remove_new = atmel_isc_remove,
>          .driver = {
>                  .name           = "atmel-sama5d2-isc",
>                  .pm             = &atmel_isc_dev_pm_ops,
> --
> 2.39.2
> 

-- 
Nicolas Ferre


  reply	other threads:[~2023-04-03 16:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 06/24] staging: media: atmel-sama5d2-isc: " Uwe Kleine-König
2023-04-03 16:24   ` Nicolas Ferre [this message]
2023-04-03 15:39 ` [PATCH 07/24] staging: media: atmel-sama7g5-isc: " Uwe Kleine-König
2023-04-03 16:23   ` Nicolas Ferre
2023-04-03 15:39 ` [PATCH 08/24] staging: media: imx-media-csi: " Uwe Kleine-König
2023-04-04  8:38   ` Philipp Zabel
2023-04-03 15:39 ` [PATCH 09/24] staging: media: imx-media-dev: " Uwe Kleine-König
2023-04-04  8:38   ` Philipp Zabel
2023-04-03 15:40 ` [PATCH 10/24] staging: media: imx6-mipi-csi2: " Uwe Kleine-König
2023-04-04  8:38   ` Philipp Zabel
2023-04-03 15:40 ` [PATCH 11/24] staging: media: imx8mq-mipi-csi2: " Uwe Kleine-König
2023-04-04  8:38   ` Philipp Zabel
2023-04-03 15:40 ` [PATCH 12/24] staging: media: meson: vdec: " Uwe Kleine-König
2023-04-03 20:38   ` Martin Blumenstingl
2023-04-03 15:40 ` [PATCH 13/24] staging: media: omap4iss: " Uwe Kleine-König
2023-04-04  2:25   ` Laurent Pinchart
2023-04-03 15:40 ` [PATCH 14/24] staging: media: rkvdec: " Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 15/24] staging: media: sunxi: cedrus: " Uwe Kleine-König
2023-04-04  8:47   ` Paul Kocialkowski
2023-04-04 16:53   ` Jernej Škrabec
2023-04-03 15:40 ` [PATCH 16/24] staging: media: sun6i-isp: " Uwe Kleine-König
2023-04-04  8:47   ` Paul Kocialkowski
2023-04-04 16:54   ` Jernej Škrabec
2023-04-03 19:50 ` [PATCH 00/24] staging: " Greg Kroah-Hartman

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=3a883f8b-9f28-34cc-84f2-e6efc5186140@microchip.com \
    --to=nicolas.ferre@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=eugen.hristev@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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