From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9940C6FD1D for ; Tue, 4 Apr 2023 08:54:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=m/dOAv5OreRuLKdWVks0TqQ7DiClUZ53qqAuZ39pAPs=; b=PfX24ukvHCp9nsbdnxW+cL8Hpm dSh6O/g52qhCd2W9ISQItmz3bAHrkPU/zzlGTiKvB7W2DcAhg2nIDb5IJA25ML5YpzmJl3/LQK/RA Ke1uEhIbNkPWOhYAWRib9ULEviJJGL7umh3zMKswkr8lv47/Z4PIctaG1AdExr63EqEQSJrcLzCPc 7RNrqSXyqdsm+oawamJiL+OYduTgB+4fyYYTUGs5qMmaJ3f2pxmAd9ZCAhC71AteAmxZF0gGMmU/9 HdSD6iCaGX1OsUFfWi5gPjccnRlZoMfxrGxn/QD2rHsWxsfc6Is5vXk5lVqc4T74Es6jqeqzkJvva HA/3NZzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pjcNZ-000aSH-1g; Tue, 04 Apr 2023 08:51:03 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pjcK9-000Z7M-2n for linux-arm-kernel@lists.infradead.org; Tue, 04 Apr 2023 08:47:40 +0000 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> MIME-Version: 1.0 In-Reply-To: <20230403154014.2564054-17-u.kleine-koenig@pengutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230404_014730_278482_BD564228 X-CRM114-Status: GOOD ( 24.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============4481382830422496708==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4481382830422496708== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="X1F0QsZWr8t/LkMj" Content-Disposition: inline --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-- --===============4481382830422496708== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4481382830422496708==--