From patchwork Mon May 8 20:51:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13235094 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [85.220.165.71]) (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 1042E53AC for ; Mon, 8 May 2023 20:53:21 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pw7r8-00034L-Jg; Mon, 08 May 2023 22:53:14 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pw7r7-0024q2-RJ; Mon, 08 May 2023 22:53:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pw7r7-002YVh-76; Mon, 08 May 2023 22:53:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Benson Leung , Wolfram Sang , Krzysztof Kozlowski , Wolfram Sang Cc: Guenter Roeck , linux-i2c@vger.kernel.org, chrome-platform@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 15/89] i2c: cros-ec-tunnel: Convert to platform remove callback returning void Date: Mon, 8 May 2023 22:51:52 +0200 Message-Id: <20230508205306.1474415-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230508205306.1474415-1-u.kleine-koenig@pengutronix.de> References: <20230508205306.1474415-1-u.kleine-koenig@pengutronix.de> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1727; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=8x9SNm7wC0nHnafZUA2i+WZqpxZes+tYc4Y8DP8Dkh4=; b=owGbwMvMwMXY3/A7olbonx/jabUkhpTIhFTbMqXGZ1MV/yvOKbou9HJ58HK3362rzC1P3quzs Pj7KOJuJ6MxCwMjF4OsmCKLfeOaTKsqucjOtf8uwwxiZQKZwsDFKQATkVRh/83Cm3lNZtmJuw98 bx/smvfnPpNsSGcso6zCy5j7d9p7rh/VeficX/nSaq9P3Lydvvff/Dr4s/dbi8X8ChtLi58bjFh /2K/wqiz0WHYzgr9fx1JQ7VFWTEu3VMbqwwE2th0q3Q6Xqi0NvxWKTfFREVL4Ml12+6yOG01Xnv ZmT837xiEvk3htodna3AinmZNOysgH3/bL7xOQkvN7YrLQgqdkeaVXc9DvxNQMQXd9Od30x8Grp 09Qtjy/RfZ4tKOOwLni2o3t+95XTl126oa8IuP5c2JbjoTIvri04PBMEfvU619yy4/vc2+sENN2 e+Rx7te0azs5drRpcjk+PvDHRUiq71fB8gMVXxy9Jcx4AQ== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: chrome-platform@lists.linux.dev 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 Reviewed-by: Krzysztof Kozlowski --- drivers/i2c/busses/i2c-cros-ec-tunnel.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c index 8b3ff5bb14d8..2737fd8abd32 100644 --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c @@ -283,13 +283,11 @@ static int ec_i2c_probe(struct platform_device *pdev) return err; } -static int ec_i2c_remove(struct platform_device *dev) +static void ec_i2c_remove(struct platform_device *dev) { struct ec_i2c_device *bus = platform_get_drvdata(dev); i2c_del_adapter(&bus->adap); - - return 0; } static const struct of_device_id cros_ec_i2c_of_match[] __maybe_unused = { @@ -306,7 +304,7 @@ MODULE_DEVICE_TABLE(acpi, cros_ec_i2c_tunnel_acpi_id); static struct platform_driver ec_i2c_tunnel_driver = { .probe = ec_i2c_probe, - .remove = ec_i2c_remove, + .remove_new = ec_i2c_remove, .driver = { .name = "cros-ec-i2c-tunnel", .acpi_match_table = ACPI_PTR(cros_ec_i2c_tunnel_acpi_id),