From patchwork Thu Nov 9 20:28:36 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: 13451690 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 26CEEC4332F for ; Thu, 9 Nov 2023 20:29:48 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=b3ABIVl0+Eh14o6wGoceBGhZefxKE0ZvHNEjhgG04Uo=; b=2V7++eQux2NLky fdhqxgpkVFF7Ulv/gRDshWyQ7JaxkXW32ZcYeexfAe0k60etmNKzostoVx4YGreBxuaSQfuCIeNqV oA2bCe0ugyBp9qVbGGl+c3nYygP6gHyn8Tzz50MscC8C2RMinpBcMBXQoY/rf8+DQsZsT+OX/XNTz hjuaulm/1dfgze+9uFNx3+EnoJr/MPbcpO8hZ29fNuHR0wpCbsAwLbpyMEdeJurpDE9PYZfReYT2E YUk/CgJZATbjOFdAzsUDEpmnA5C/XvT6vM4O9LL4L66aotp8HwVrHXhhrBMZzc/rcqtfIpB13q9+V 59Gfo0DJ+ybg+ljN/oGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1BeR-007BXs-0m; Thu, 09 Nov 2023 20:29:19 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1BeO-007BWQ-1D for linux-arm-kernel@lists.infradead.org; Thu, 09 Nov 2023 20:29:17 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1BeH-000307-0E; Thu, 09 Nov 2023 21:29:09 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1BeD-007rWn-TW; Thu, 09 Nov 2023 21:29:05 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1BeD-00GGtj-K5; Thu, 09 Nov 2023 21:29:05 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Arnd Bergmann , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 06/12] bus: sun50i-de2: Convert to platform remove callback returning void Date: Thu, 9 Nov 2023 21:28:36 +0100 Message-ID: <20231109202830.4124591-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231109202830.4124591-1-u.kleine-koenig@pengutronix.de> References: <20231109202830.4124591-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1726; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YjxQ9k2VhTNSjPuszXvrypquoQe61zCjR6hyAesl/x0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTUD1h/FL212JBtXnUYvTOt6e/oAiPyWOeMRVg MwOBzqtJD2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU1A9QAKCRCPgPtYfRL+ TtAtB/40Cw1OEL2T46KLdtC6CPWjFjNclqSJ+qr/t4mj2hWDKwQtf0kTynpCe6dsTwfyifEPBfQ d3VgfUp1eO2NYm9OBdHXDl32gc0MDmOoNpdgDKlCc6aYawUN/noK27PmoPWdFuEcm1VyU9uMAuX sR5pS1cctbTPPozjbI4Y43ApHt0iatVbNW2jxyRqQW7Ac+Bi/tfW+R4g2VJqQ3O78mZ3dSY5MLt q7CyCWxnhD1PXANJFoeNMAgGd65yzDtNxJ66WOLbB/W5SkCO0WrqOoVNBIBUmsCU7nTUwhDZUVT hIhBabSoRtg8sz8beNoY1SfoJ4H6moejJnD+pPh8i+i+h+2g 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_122916_415709_B26D922E X-CRM114-Status: GOOD ( 17.94 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). 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: Andre Przywara Reviewed-by: Jernej Skrabec --- drivers/bus/sun50i-de2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/bus/sun50i-de2.c b/drivers/bus/sun50i-de2.c index 414f29cdedf0..3339311ce068 100644 --- a/drivers/bus/sun50i-de2.c +++ b/drivers/bus/sun50i-de2.c @@ -24,10 +24,9 @@ static int sun50i_de2_bus_probe(struct platform_device *pdev) return 0; } -static int sun50i_de2_bus_remove(struct platform_device *pdev) +static void sun50i_de2_bus_remove(struct platform_device *pdev) { sunxi_sram_release(&pdev->dev); - return 0; } static const struct of_device_id sun50i_de2_bus_of_match[] = { @@ -37,7 +36,7 @@ static const struct of_device_id sun50i_de2_bus_of_match[] = { static struct platform_driver sun50i_de2_bus_driver = { .probe = sun50i_de2_bus_probe, - .remove = sun50i_de2_bus_remove, + .remove_new = sun50i_de2_bus_remove, .driver = { .name = "sun50i-de2-bus", .of_match_table = sun50i_de2_bus_of_match, From patchwork Thu Nov 9 20:28:37 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: 13451691 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 4BBAFC4332F for ; Thu, 9 Nov 2023 20:29:52 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EJwjq1IS2LOyaD7xZQrBko+V5k0zfXH7vy5C3zTWgVI=; b=UIgzWcdenHTl5P Vebt5i07boy5ZlCDCpPLdEsUYG0MVmKARgU6/evLnz3+5QiP/h+rcOGbG9nrsGeAI6MO6FPmVmYV8 c/6+1y1F4CLN0pWZh2JhnTs3QtzaO3jo8N4oamuJopKl8NN1tYNirz3Uhbv3f9dJqqTKWCHpbDPLl ceQDI/GuEMHv9h3gIqtu/8YgN4swy6qbXLsezA+xMBqz02Mfpzo0KCfHRWAtm5VsqT8sS7ZKIp21f IMbA2jF9arbAzrsasjhbRR2AZo/OOkh2zGB62PqHqW7Kb0cj/ypaqmb7p8odVSz7i+msyiGszAt5r 4cyUuSJey5MZVwMY0bnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1BeW-007BaF-35; Thu, 09 Nov 2023 20:29:24 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1BeU-007BYl-0F for linux-arm-kernel@lists.infradead.org; Thu, 09 Nov 2023 20:29:23 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1BeH-00030C-0D; Thu, 09 Nov 2023 21:29:09 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1BeE-007rWs-6t; Thu, 09 Nov 2023 21:29:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1BeD-00GGtn-TH; Thu, 09 Nov 2023 21:29:05 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Arnd Bergmann , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Greg Kroah-Hartman , Hans de Goede , Laurentiu Tudor , Rob Herring , Yangtao Li , Yuan Can Cc: linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 07/12] bus: sunxi-rsb: Convert to platform remove callback returning void Date: Thu, 9 Nov 2023 21:28:37 +0100 Message-ID: <20231109202830.4124591-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231109202830.4124591-1-u.kleine-koenig@pengutronix.de> References: <20231109202830.4124591-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1827; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Ljw1iocUr54lmlYHGt3emJtH6h+URgB1aeVfWaWuuQk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTUD23dZO5dhS0cwcbsOoJZ0FDGjDEMqO4zgGJ m3BUYf5IC+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU1A9gAKCRCPgPtYfRL+ TrHXB/0TOFve/dtvkisgJw9zkcCVDFLSsx+YLtqy1MqcS2oO79o1lTsMGekYQM6+DaRVZ7vqf+T ZBLt41FuXVbcWj5mLK+FrhBlEd73VtGrRCiUBXagwvLu3a1hNKzj394MjGLv+TMjtpN1RZmojdH 64CASdg19YDpS6KBNvJuKR1uvW/YD2Pg2Tz3/OL60r7Xdo0b5BjhjK3tnKRI81mtoSNMfymcOdB uGDz5C7eJbnlGen/U8W0Dgtp+jVmrz8mYo1hzYmclKIOFD8Ypdx3zaWErhBPPGMprnD9kW98UqB iv07DwwQaCkKLOx89X1FvLjKOyNoEkwbxaiX7waYUstQIa3s 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_122922_114604_E97D3ECA X-CRM114-Status: GOOD ( 17.71 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). 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: Andre Przywara Reviewed-by: Jernej Skrabec --- drivers/bus/sunxi-rsb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c index db0ed4e5d315..fd3e9d82340a 100644 --- a/drivers/bus/sunxi-rsb.c +++ b/drivers/bus/sunxi-rsb.c @@ -817,15 +817,13 @@ static int sunxi_rsb_probe(struct platform_device *pdev) return 0; } -static int sunxi_rsb_remove(struct platform_device *pdev) +static void sunxi_rsb_remove(struct platform_device *pdev) { struct sunxi_rsb *rsb = platform_get_drvdata(pdev); device_for_each_child(rsb->dev, NULL, sunxi_rsb_remove_devices); pm_runtime_disable(&pdev->dev); sunxi_rsb_hw_exit(rsb); - - return 0; } static const struct dev_pm_ops sunxi_rsb_dev_pm_ops = { @@ -842,7 +840,7 @@ MODULE_DEVICE_TABLE(of, sunxi_rsb_of_match_table); static struct platform_driver sunxi_rsb_driver = { .probe = sunxi_rsb_probe, - .remove = sunxi_rsb_remove, + .remove_new = sunxi_rsb_remove, .driver = { .name = RSB_CTRL_NAME, .of_match_table = sunxi_rsb_of_match_table,