From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C35B7E; Tue, 4 Apr 2023 08:47:31 +0000 (UTC) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 2366A100003; Tue, 4 Apr 2023 08:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1680598044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dH6w27boEORBTwMCoLxB1gUos3o1R90xxs+JTsuFLxQ=; b=gV21vv0W//P0xSy+YY4G1pVOMC0d0Gg9RXEMk5w7hB43jsfYJb4Bq9KjcSP6VU59oYZoOH audBsNsUI7qxODPHkLaVzk4cTUy0q8gBCrC82NkklKbxeH0N94XBjV3nvm9X88TezfuMt6 4fUuxYZX56JtGSREql+c2wo4+G9XVgElMQeKPQ+5vhG0+SfKMO/Kfq3+LdfTsHpwmp5BHB V6lobiqWW1VuRpmx4Qjvl+P4h/wCJ+Ek+H2eDC/rxc8MWBMzR8jn+H5GTEsves3xzrL2XV E/4vzH1rowSBFxXmj4PGX0kMoUqS62pnePqOE6j73B82mAuXAu9UgskdO6rqKg== Date: Tue, 4 Apr 2023 10:47:18 +0200 From: Paul Kocialkowski To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Cc: Mauro Carvalho Chehab , Greg Kroah-Hartman , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: Re: [PATCH 16/24] staging: media: sun6i-isp: Convert to platform remove callback returning void Message-ID: References: <20230403154014.2564054-1-u.kleine-koenig@pengutronix.de> <20230403154014.2564054-17-u.kleine-koenig@pengutronix.de> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="X1F0QsZWr8t/LkMj" Content-Disposition: inline In-Reply-To: <20230403154014.2564054-17-u.kleine-koenig@pengutronix.de> --X1F0QsZWr8t/LkMj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon 03 Apr 23, 17:40, Uwe Kleine-K=C3=B6nig 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. >=20 > Trivially convert this driver from always returning zero in the remove > callback to the void returning variant. >=20 > Signed-off-by: Uwe Kleine-K=C3=B6nig Reviewed-by: Paul Kocialkowski Thanks, Paul > --- > drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c b/drivers/= staging/media/sunxi/sun6i-isp/sun6i_isp.c > index 7b7947509b69..0dc75adbd9d8 100644 > --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c > +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c > @@ -493,7 +493,7 @@ static int sun6i_isp_probe(struct platform_device *pl= atform_dev) > return ret; > } > =20 > -static int sun6i_isp_remove(struct platform_device *platform_dev) > +static void sun6i_isp_remove(struct platform_device *platform_dev) > { > struct sun6i_isp_device *isp_dev =3D platform_get_drvdata(platform_dev); > =20 > @@ -503,8 +503,6 @@ static int sun6i_isp_remove(struct platform_device *p= latform_dev) > sun6i_isp_v4l2_cleanup(isp_dev); > sun6i_isp_tables_cleanup(isp_dev); > sun6i_isp_resources_cleanup(isp_dev); > - > - return 0; > } > =20 > /* > @@ -540,7 +538,7 @@ MODULE_DEVICE_TABLE(of, sun6i_isp_of_match); > =20 > static struct platform_driver sun6i_isp_platform_driver =3D { > .probe =3D sun6i_isp_probe, > - .remove =3D sun6i_isp_remove, > + .remove_new =3D sun6i_isp_remove, > .driver =3D { > .name =3D SUN6I_ISP_NAME, > .of_match_table =3D of_match_ptr(sun6i_isp_of_match), > --=20 > 2.39.2 >=20 --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --X1F0QsZWr8t/LkMj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmQr5BYACgkQ3cLmz3+f v9FUkAf/R1t1XvAegO7HIBrmxQsZrSgULNDLSWmKvPECq0DbT+oxpevBoT71lnN4 fU0/ybdlg2KX4Aol1ZIQOyMP90odNb8yUhBvc54P/kITS4xvka+S20Hp4Oq4FLcN UfIGZlhICogfVopP5byBvA8JRjYnHjoY+sv6PqnoVgXW/z7fTKpFHH1JbJECxOBp IMJznULWN8srIPUh2bAQSlCGcLdHvDvkUZ2YHxuQ25/Cx8YiK0f+ZcSEZ4d6bOdN eEDx933CG1Fv7bYy802D8SgM9J2uwEbLzBXABAjIshg9RQhH4SbPwke2tO95LNBe TYCj73BkqNYEKX2kdlE766aYTzG1Qw== =Qrwu -----END PGP SIGNATURE----- --X1F0QsZWr8t/LkMj--