From patchwork Tue Sep 19 13:31:09 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: 13391380 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7757BCD5BBF for ; Tue, 19 Sep 2023 13:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232375AbjISNcY (ORCPT ); Tue, 19 Sep 2023 09:32:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232355AbjISNcU (ORCPT ); Tue, 19 Sep 2023 09:32:20 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 858D7F4 for ; Tue, 19 Sep 2023 06:32:14 -0700 (PDT) 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 1qiapn-0004ah-LC; Tue, 19 Sep 2023 15:32:11 +0200 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 1qiapm-007T2i-MK; Tue, 19 Sep 2023 15:32:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapm-0030dY-Ak; Tue, 19 Sep 2023 15:32:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Olivier Dautricourt , Stefan Roese , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 01/59] dma: altera-msgdma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:09 +0200 Message-Id: <20230919133207.1400430-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1794; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=2rY1FJHqq+fRfCvGjU/T0esfnOtt0QxXvmVaXLXdWDE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaGuZszvvqPldQ1lak6C6LdO7W9KtB/lT7Wgb d9EcuagQ/mJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhrgAKCRCPgPtYfRL+ ToHMB/9W8vvzfJrUcnXhah/n3fjh4f5AABFCvTSkaYmS/+4ewacLlla42qb6Uf7HYp+j12Ym/lP sugUA4goHNp1n1+whd/006im7vVFIGHwVMUqQCR2dwC10KBcdnVfEgj0+jQr5qdcmqi71YZNt+f uiDCecrdr1t0uEPGgQlcv2O+eg/ybx/RL1iohKxxPORuy3jh2jsp6EEtoIXPUJYS326ccWvOkz0 040NBPQBSy/3N9bJSThpwbYNo5wccg2jZDrHxT1X/wMgbDDfy8BWn0RVBFbiwCTsrhyIQUFEsEm g2QACOKeKzzOd3wx6AERzWh/R0xJldnqX7AnXkSTCLhIJ1+7 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 Acked-by: Olivier Dautricourt --- drivers/dma/altera-msgdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/altera-msgdma.c b/drivers/dma/altera-msgdma.c index 4153c2edb049..a8e3615235b8 100644 --- a/drivers/dma/altera-msgdma.c +++ b/drivers/dma/altera-msgdma.c @@ -923,7 +923,7 @@ static int msgdma_probe(struct platform_device *pdev) * * Return: Always '0' */ -static int msgdma_remove(struct platform_device *pdev) +static void msgdma_remove(struct platform_device *pdev) { struct msgdma_device *mdev = platform_get_drvdata(pdev); @@ -933,8 +933,6 @@ static int msgdma_remove(struct platform_device *pdev) msgdma_dev_remove(mdev); dev_notice(&pdev->dev, "Altera mSGDMA driver removed\n"); - - return 0; } #ifdef CONFIG_OF @@ -952,7 +950,7 @@ static struct platform_driver msgdma_driver = { .of_match_table = of_match_ptr(msgdma_match), }, .probe = msgdma_probe, - .remove = msgdma_remove, + .remove_new = msgdma_remove, }; module_platform_driver(msgdma_driver); From patchwork Tue Sep 19 13:31:10 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: 13391424 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBB2BCD5BC6 for ; Tue, 19 Sep 2023 13:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232403AbjISNcs (ORCPT ); Tue, 19 Sep 2023 09:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232428AbjISNci (ORCPT ); Tue, 19 Sep 2023 09:32:38 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73B50F3 for ; Tue, 19 Sep 2023 06:32:31 -0700 (PDT) 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 1qiapp-0004ai-Gn; Tue, 19 Sep 2023 15:32:13 +0200 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 1qiapm-007T2n-Tl; Tue, 19 Sep 2023 15:32:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapm-0030db-Ip; Tue, 19 Sep 2023 15:32:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Hector Martin , Sven Peter , Alyssa Rosenzweig , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 02/59] dma: apple-admac: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:10 +0200 Message-Id: <20230919133207.1400430-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1804; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4cB0nw0yRieunGEduwbEFfSDJhK0MVnXD1ukbBmrjFc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaGvXdbPaKXCELiF60wFgzJrODKGuGkxDr4uF v6NfyFey3mJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhrwAKCRCPgPtYfRL+ TnJuB/9Ytvtvi3cRL9ZOU1ix4RRTQzUaiCnjhzfwyy7LYPKgzsSCJB7vHlQE4G3OuYrEdLZwyou RdoHe3e9rgLob2PuPw/05x7MFT6bpoDr1TPuLdbTyb579GC8f7kg0RKH5IQ+PYn1TqwBrXdcM16 KGDcFLzmtLa3e+wUIw/iyshugOp6fAFgcpRcfgcCYB8XDtYfOULOfzwoUzLYH9EJwIDRjuKJawi ++jGRFsdHqlUODBGBujtzXAuPmrMdHxEoNkWzxhbF3hz827ILv77sd9b3gXEwtDX3x0A0bBWxUq W2F6julJDk+8F4NecdHe9VuPkm2wj+SwwGqNmn7iFZV3GF2K 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/apple-admac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/apple-admac.c b/drivers/dma/apple-admac.c index 3af795635c5c..46bb02858561 100644 --- a/drivers/dma/apple-admac.c +++ b/drivers/dma/apple-admac.c @@ -925,7 +925,7 @@ static int admac_probe(struct platform_device *pdev) return err; } -static int admac_remove(struct platform_device *pdev) +static void admac_remove(struct platform_device *pdev) { struct admac_data *ad = platform_get_drvdata(pdev); @@ -933,8 +933,6 @@ static int admac_remove(struct platform_device *pdev) dma_async_device_unregister(&ad->dma); free_irq(ad->irq, ad); reset_control_rearm(ad->rstc); - - return 0; } static const struct of_device_id admac_of_match[] = { @@ -949,7 +947,7 @@ static struct platform_driver apple_admac_driver = { .of_match_table = admac_of_match, }, .probe = admac_probe, - .remove = admac_remove, + .remove_new = admac_remove, }; module_platform_driver(apple_admac_driver); From patchwork Tue Sep 19 13:31:11 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: 13391409 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2309CD5BC1 for ; Tue, 19 Sep 2023 13:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232435AbjISNck (ORCPT ); Tue, 19 Sep 2023 09:32:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232410AbjISNce (ORCPT ); Tue, 19 Sep 2023 09:32:34 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15BF6102 for ; Tue, 19 Sep 2023 06:32:28 -0700 (PDT) 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 1qiapp-0004aj-Gn; Tue, 19 Sep 2023 15:32:13 +0200 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 1qiapn-007T2q-6B; Tue, 19 Sep 2023 15:32:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapm-0030de-RD; Tue, 19 Sep 2023 15:32:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Ludovic Desroches , Tudor Ambarus , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 03/59] dma: at_hdmac: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:11 +0200 Message-Id: <20230919133207.1400430-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1817; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=3WTsCcLpwO2d5AMEGsOosfwWRyybvlbLM2EBy+s01/0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaGx5v9b0dAzbOD/XzxT4qgy4sj4CUitobcKr UBDEelxq0KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhsQAKCRCPgPtYfRL+ TgwBB/9zE7wuWvbMHiS4YXptR6rD548Z/PEUFU15aHODNkqH7lzLFB70nQpMjDtaZYk86hVkkSn dCM3jY+i+mODcGFMGR1pvk7KheqtAsBFpAJrkV8I5Q0JD6EtBDwggrVaW9czzGvYIOJcQ0Ybe/c DkbjjH+nVBT8DrJP8gRxV1lHlAJpUOj17WFQg/wNAnRjhmUeG6YkJZ2ClSmyBnLwtDEhn0htYk5 mdENlOWgccAxMwn0OOtc20naAv4+2FwalVFmQK3SaOsErUZ7Y6Cp1ImRw3KZNd+AizK3ZrlwrXg xsrq40pHJD+DgKThvE2GDP2VPpIAWGabWF/4xMgy02AL/wWx 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/at_hdmac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index b2876f67471f..417a9428a9b6 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -2100,7 +2100,7 @@ static int __init at_dma_probe(struct platform_device *pdev) return err; } -static int at_dma_remove(struct platform_device *pdev) +static void at_dma_remove(struct platform_device *pdev) { struct at_dma *atdma = platform_get_drvdata(pdev); struct dma_chan *chan, *_chan; @@ -2122,8 +2122,6 @@ static int at_dma_remove(struct platform_device *pdev) } clk_disable_unprepare(atdma->clk); - - return 0; } static void at_dma_shutdown(struct platform_device *pdev) @@ -2242,7 +2240,7 @@ static const struct dev_pm_ops __maybe_unused at_dma_dev_pm_ops = { }; static struct platform_driver at_dma_driver = { - .remove = at_dma_remove, + .remove_new = at_dma_remove, .shutdown = at_dma_shutdown, .id_table = atdma_devtypes, .driver = { From patchwork Tue Sep 19 13:31:12 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: 13391401 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3ABCECD5BC5 for ; Tue, 19 Sep 2023 13:32:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232376AbjISNcg (ORCPT ); Tue, 19 Sep 2023 09:32:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232380AbjISNc3 (ORCPT ); Tue, 19 Sep 2023 09:32:29 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A769B102 for ; Tue, 19 Sep 2023 06:32:22 -0700 (PDT) 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 1qiapp-0004ak-Gn; Tue, 19 Sep 2023 15:32:13 +0200 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 1qiapn-007T2t-E0; Tue, 19 Sep 2023 15:32:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapn-0030dj-2p; Tue, 19 Sep 2023 15:32:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Ludovic Desroches , Tudor Ambarus , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/59] dma: at_xdmac: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:12 +0200 Message-Id: <20230919133207.1400430-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1900; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=WMzT7MswzvnTnNQOYTkT6sMXTETtgMo9PRS2WDhQTdU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaGyMEkEmehbVVOkcMXJyDWd+VI8gADH6biST 8p5vxRaaj6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhsgAKCRCPgPtYfRL+ TrQQCAChmZSScdH6iX6VRwkgK0dXNKREkxTTC96G72lMFyYM5KOQ4EGH6JDVGVl5ddjcz07d+A/ sjN8oN7oXWOKlW3mwOKo3vf6Cx9O9R3oIUNIscae2QndUnWaeSM4w+CjQwFLHde9l7Y1ZzEYQFG qRoPJC7vo7ys4M1JgV1f6PV6xkac88ecO0l9ONZVTnlbLnYlOcZ7P6GISuqgAtv2Mpy7BBo65XA KfoPPvV8b/AiCJ98qK2G+UvVgFT3xxYv06QvWWQdwdfqj+bsrYAAFtbAZcEC7i4NyIW8tS7iunA uGoJxMYGprmFQxOj5XqnWJebDNO3jaZvuoHGHZU1qM+BQULb 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/at_xdmac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index c3b37168b21f..299396121e6d 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -2431,7 +2431,7 @@ static int at_xdmac_probe(struct platform_device *pdev) return ret; } -static int at_xdmac_remove(struct platform_device *pdev) +static void at_xdmac_remove(struct platform_device *pdev) { struct at_xdmac *atxdmac = (struct at_xdmac *)platform_get_drvdata(pdev); int i; @@ -2452,8 +2452,6 @@ static int at_xdmac_remove(struct platform_device *pdev) tasklet_kill(&atchan->tasklet); at_xdmac_free_chan_resources(&atchan->chan); } - - return 0; } static const struct dev_pm_ops __maybe_unused atmel_xdmac_dev_pm_ops = { @@ -2478,7 +2476,7 @@ MODULE_DEVICE_TABLE(of, atmel_xdmac_dt_ids); static struct platform_driver at_xdmac_driver = { .probe = at_xdmac_probe, - .remove = at_xdmac_remove, + .remove_new = at_xdmac_remove, .driver = { .name = "at_xdmac", .of_match_table = of_match_ptr(atmel_xdmac_dt_ids), From patchwork Tue Sep 19 13:31:13 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: 13391379 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01764CD5BBF for ; Tue, 19 Sep 2023 13:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231960AbjISNcU (ORCPT ); Tue, 19 Sep 2023 09:32:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232347AbjISNcT (ORCPT ); Tue, 19 Sep 2023 09:32:19 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91DF8EC for ; Tue, 19 Sep 2023 06:32:13 -0700 (PDT) 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 1qiapo-0004al-1o; Tue, 19 Sep 2023 15:32:12 +0200 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 1qiapn-007T2w-K2; Tue, 19 Sep 2023 15:32:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapn-0030dn-A1; Tue, 19 Sep 2023 15:32:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 05/59] dma: bcm-sba-raid: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:13 +0200 Message-Id: <20230919133207.1400430-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1790; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=A02aCJhftn/IWOTeTpjgUNkzoNIffng9aDifeYyoi7k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaGzllh66NmdjAkSVxEqhWIelUZsp6kuHc6dh rxFfZT6sxuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhswAKCRCPgPtYfRL+ TtvcB/9xDmhT5SuZPR4ZLwP6iayCtu3KE33yyAGIxE9qhVXx0kTba0cMiPSN/Nhz/bkH9JkPgzB oD6wjCDjvwmMlGxDSdBbx+682hxtF16U6KspxCLgZqtBLipT4wiMuDGnzpdOfFZyIbVuGEMJsnb eWOZiAESxNfaqJDhArAiFQyOTyxJP0nJhRpmsPgIIjwLw6noLCLym8JRhVdhMPHqWPUIn63fYWr 7MFFakhEz7BIxsj+EvD0tGbpdpLz6nS84fw5iEz62GI99ZpyeQ3zf9Nc+Hlrs7uRnmvbpKYXnOg T67zz0D4TSYxT7JV62+7CL26siCo4Yr2OxOSHq7gpVPJnTRL 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/bcm-sba-raid.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/bcm-sba-raid.c b/drivers/dma/bcm-sba-raid.c index 94ea35330eb5..fbaacb4c19b2 100644 --- a/drivers/dma/bcm-sba-raid.c +++ b/drivers/dma/bcm-sba-raid.c @@ -1734,7 +1734,7 @@ static int sba_probe(struct platform_device *pdev) return ret; } -static int sba_remove(struct platform_device *pdev) +static void sba_remove(struct platform_device *pdev) { struct sba_device *sba = platform_get_drvdata(pdev); @@ -1745,8 +1745,6 @@ static int sba_remove(struct platform_device *pdev) sba_freeup_channel_resources(sba); mbox_free_channel(sba->mchan); - - return 0; } static const struct of_device_id sba_of_match[] = { @@ -1758,7 +1756,7 @@ MODULE_DEVICE_TABLE(of, sba_of_match); static struct platform_driver sba_driver = { .probe = sba_probe, - .remove = sba_remove, + .remove_new = sba_remove, .driver = { .name = "bcm-sba-raid", .of_match_table = sba_of_match, From patchwork Tue Sep 19 13:31:14 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: 13391388 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66EE8CD5BC7 for ; Tue, 19 Sep 2023 13:32:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232367AbjISNc2 (ORCPT ); Tue, 19 Sep 2023 09:32:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232380AbjISNcY (ORCPT ); Tue, 19 Sep 2023 09:32:24 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E208C122 for ; Tue, 19 Sep 2023 06:32:17 -0700 (PDT) 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 1qiapp-0004cj-Gq; Tue, 19 Sep 2023 15:32:13 +0200 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 1qiapn-007T2z-RG; Tue, 19 Sep 2023 15:32:11 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapn-0030dr-HE; Tue, 19 Sep 2023 15:32:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , dmaengine@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 06/59] dma: bcm2835-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:14 +0200 Message-Id: <20230919133207.1400430-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1665; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4k20QsNbWrgBeaCXZrLrt7KARFXxwozszE9LgnxhIaQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaG0hdzcw3DIm2QlhWlA1IzMMfFAr9NM9T9aB Yz/OExIiA+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhtAAKCRCPgPtYfRL+ ToWYB/9HmrM6dlw0qAvWMCblKNhkYH5qMME6/xAXVQopaV7LJbwobtK9kWJkKpq2qIgPWJGmZSM W6YpTkPYN6eST3GodfEX/KnNbqYHG/P+GdSEE2SeQHEuoGZmbCfVQ6FfNcypUkv7kAPLzPg7Ali JAStmfjX8J333Ig62Be8IquQIQnTTLMIF6QrZU/f8GxMlr46nR8J7GTl9m7aVfVKGIvauQDnrpN C3qr9Xjcx6qpaGMz/uYcTLHYdzbpxH+xlRslCQz6q9FtBy3T266j2sQH+SIO3tmzRGN9mwrnCfr aFdz8GRm2s2NdXuGiBWRUkrG4WRh/O5+75KIjLAPgpIBetg2 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/bcm2835-dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index 0807fb9eb262..9d74fe97452e 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -1019,19 +1019,17 @@ static int bcm2835_dma_probe(struct platform_device *pdev) return rc; } -static int bcm2835_dma_remove(struct platform_device *pdev) +static void bcm2835_dma_remove(struct platform_device *pdev) { struct bcm2835_dmadev *od = platform_get_drvdata(pdev); dma_async_device_unregister(&od->ddev); bcm2835_dma_free(od); - - return 0; } static struct platform_driver bcm2835_dma_driver = { .probe = bcm2835_dma_probe, - .remove = bcm2835_dma_remove, + .remove_new = bcm2835_dma_remove, .driver = { .name = "bcm2835-dma", .of_match_table = of_match_ptr(bcm2835_dma_of_match), From patchwork Tue Sep 19 13:31:15 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: 13391397 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE9AACD5BC4 for ; Tue, 19 Sep 2023 13:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232359AbjISNcd (ORCPT ); Tue, 19 Sep 2023 09:32:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232403AbjISNc0 (ORCPT ); Tue, 19 Sep 2023 09:32:26 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92E1B137 for ; Tue, 19 Sep 2023 06:32:19 -0700 (PDT) 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 1qiapo-0004cn-Kt; Tue, 19 Sep 2023 15:32:12 +0200 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 1qiapo-007T34-8d; Tue, 19 Sep 2023 15:32:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapn-0030dv-OM; Tue, 19 Sep 2023 15:32:11 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Rob Herring , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 07/59] dma: bestcomm: bestcomm: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:15 +0200 Message-Id: <20230919133207.1400430-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1884; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=WCW3e2T4/VRTHCzrUC6e5JaWFtw8EPAjoMcDihaKymQ=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTOhVvNDBT29Hr+zg5M4z9vveYSX47Dn8Qi7anH5fnOn PZbEvCtk9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJPHJi/1+0s/seQ/yFnpY+ pvTe5kJWv90mwgLLY6Zu+OK4X4aT+ZBjqFfvceYHO6cwaV3IV+1j1Tn2pMD9XFV2acUD7xNb9SZ rhKtF/3ivf5DvnZ6xmkAj77MGxp1uR9pkD+5vSmk6EDrjiHLFd7/65Le5d1ddk3FautUsMGsS/1 nvZ+q19hyb5z49bevG6p4R7KvOvi9xT/rmI18yPVZrPPd5rDIx54f5u+TKCcfvBu7aWrWKt3eq/ cQf5+uZyxo5dSRZ79vNjcvPrXQ/3VR29jNH9ttT5ivWCxw52m48u639wOlYzVsp2UVr7VIYfnKY Vd85VBFgLJUZZVy4c+4aTecgz5esGgy5O74sceFbM20NAA== 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/bestcomm/bestcomm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/bestcomm/bestcomm.c b/drivers/dma/bestcomm/bestcomm.c index 80096f94032d..0bbaa7620bdd 100644 --- a/drivers/dma/bestcomm/bestcomm.c +++ b/drivers/dma/bestcomm/bestcomm.c @@ -455,7 +455,7 @@ static int mpc52xx_bcom_probe(struct platform_device *op) } -static int mpc52xx_bcom_remove(struct platform_device *op) +static void mpc52xx_bcom_remove(struct platform_device *op) { /* Clean up the engine */ bcom_engine_cleanup(); @@ -473,8 +473,6 @@ static int mpc52xx_bcom_remove(struct platform_device *op) /* Release memory */ kfree(bcom_eng); bcom_eng = NULL; - - return 0; } static const struct of_device_id mpc52xx_bcom_of_match[] = { @@ -488,7 +486,7 @@ MODULE_DEVICE_TABLE(of, mpc52xx_bcom_of_match); static struct platform_driver mpc52xx_bcom_of_platform_driver = { .probe = mpc52xx_bcom_probe, - .remove = mpc52xx_bcom_remove, + .remove_new = mpc52xx_bcom_remove, .driver = { .name = DRIVER_NAME, .of_match_table = mpc52xx_bcom_of_match, From patchwork Tue Sep 19 13:31:16 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: 13391390 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4EB0CD5BC5 for ; Tue, 19 Sep 2023 13:32:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232395AbjISNc3 (ORCPT ); Tue, 19 Sep 2023 09:32:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232377AbjISNcY (ORCPT ); Tue, 19 Sep 2023 09:32:24 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22B0B123 for ; Tue, 19 Sep 2023 06:32:18 -0700 (PDT) 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 1qiapo-0004cu-T4; Tue, 19 Sep 2023 15:32:12 +0200 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 1qiapo-007T37-Gf; Tue, 19 Sep 2023 15:32:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapo-0030e0-7P; Tue, 19 Sep 2023 15:32:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Lars-Peter Clausen , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 08/59] dma: dma-axi-dmac: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:16 +0200 Message-Id: <20230919133207.1400430-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1872; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=99OwXr0hmWPlmyfASShSvAN68AkTRB2aVRt5rXN0+fg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaG3UlpuujX2zZzYR1gJYk92ofqyh81zQQera j9AnqR6dnOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhtwAKCRCPgPtYfRL+ ToucB/9uFvEtSRuXG/VVj6eStL37PvhkdMaxof8cR7vKNevjpnRHF862poWQwN8bSbfgRPi8VaZ gKAbC/VGotYMw52kPGRqBPPAXiLBzuZyaHgAVUV1lAvhsyBW4T5ukAZTP6R0bJK04lRmF7T+UqP Zj+z76g+bMt8D+UbofyVr1/gbZt2kJKzRPyxjixJBGDKjuyZyMTJlW1Tea0nJLZKra5O1rxsaNI s8wFRq/bPxbjE/6JDCozo1YH9hzo0XlmWYY6+EFwhs4gJpzxiXdkL7iX9b9BWxiyY3I4jx6w40q IG3eC3vcbvc0Vk20LPvevZADO8O6HmnTolNIWb3CiPCeMxH4 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/dma-axi-dmac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index fc7cdad37161..a6d235bc8444 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -1029,7 +1029,7 @@ static int axi_dmac_probe(struct platform_device *pdev) return ret; } -static int axi_dmac_remove(struct platform_device *pdev) +static void axi_dmac_remove(struct platform_device *pdev) { struct axi_dmac *dmac = platform_get_drvdata(pdev); @@ -1038,8 +1038,6 @@ static int axi_dmac_remove(struct platform_device *pdev) tasklet_kill(&dmac->chan.vchan.task); dma_async_device_unregister(&dmac->dma_dev); clk_disable_unprepare(dmac->clk); - - return 0; } static const struct of_device_id axi_dmac_of_match_table[] = { @@ -1054,7 +1052,7 @@ static struct platform_driver axi_dmac_driver = { .of_match_table = axi_dmac_of_match_table, }, .probe = axi_dmac_probe, - .remove = axi_dmac_remove, + .remove_new = axi_dmac_remove, }; module_platform_driver(axi_dmac_driver); From patchwork Tue Sep 19 13:31:17 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: 13391393 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75B19CD5BC2 for ; Tue, 19 Sep 2023 13:32:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232369AbjISNcb (ORCPT ); Tue, 19 Sep 2023 09:32:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232392AbjISNcZ (ORCPT ); Tue, 19 Sep 2023 09:32:25 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B62D135 for ; Tue, 19 Sep 2023 06:32:19 -0700 (PDT) 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 1qiapp-0004d6-3J; Tue, 19 Sep 2023 15:32:13 +0200 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 1qiapo-007T3A-NC; Tue, 19 Sep 2023 15:32:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapo-0030e4-Dr; Tue, 19 Sep 2023 15:32:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Paul Cercueil , linux-mips@vger.kernel.org, dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 09/59] dma: dma-jz4780: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:17 +0200 Message-Id: <20230919133207.1400430-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1903; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=FhsjLKXvVHLLB+zkXg/qHNDpBgdi8jSzi44XfTan6ls=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaG4SWKJOyMrNoDskwDjVRmbL0ID5DzKo6Xs9 764yF+j56mJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhuAAKCRCPgPtYfRL+ TpOZCACFiaHhK8kdTVr7p7RiSCKcsur1lW4OiwJfh32kPSkZgU3amtNn7LH6EcS7kp6D1hrlfzc zqxtix9oNQEKnEtbOQoalACsGfRiHvf5A2FlPmg/g5DROt82jsmFu3xRBDmVYcH9ctU+rxQAvZg px8q4r1jfTfAhYj3dKgXpWwJxkuTPcE5rsdGk83YRmIFf4hSFKmY9kRvx7ORuuyvci2jSgVwnxT MTRN4CrfD5vm+O6nlt54gRXxwdIoqiJkthCw1Xw3nsiYdcekE2r8zDpDZ3VnmC24nALwnfuL+GC SU+pFS3mwFozwSmrWWBTGqtIfZYcgfN4oTbfu+3AZKgzKMJ4 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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: Paul Cercueil Reviewed-by: Philippe Mathieu-Daudé --- drivers/dma/dma-jz4780.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index adbd47bd6adf..c9cfa341db51 100644 --- a/drivers/dma/dma-jz4780.c +++ b/drivers/dma/dma-jz4780.c @@ -1008,7 +1008,7 @@ static int jz4780_dma_probe(struct platform_device *pdev) return ret; } -static int jz4780_dma_remove(struct platform_device *pdev) +static void jz4780_dma_remove(struct platform_device *pdev) { struct jz4780_dma_dev *jzdma = platform_get_drvdata(pdev); int i; @@ -1020,8 +1020,6 @@ static int jz4780_dma_remove(struct platform_device *pdev) for (i = 0; i < jzdma->soc_data->nb_channels; i++) tasklet_kill(&jzdma->chan[i].vchan.task); - - return 0; } static const struct jz4780_dma_soc_data jz4740_dma_soc_data = { @@ -1124,7 +1122,7 @@ MODULE_DEVICE_TABLE(of, jz4780_dma_dt_match); static struct platform_driver jz4780_dma_driver = { .probe = jz4780_dma_probe, - .remove = jz4780_dma_remove, + .remove_new = jz4780_dma_remove, .driver = { .name = "jz4780-dma", .of_match_table = jz4780_dma_dt_match, From patchwork Tue Sep 19 13:31:18 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: 13391384 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A4F2CD5BC3 for ; Tue, 19 Sep 2023 13:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232347AbjISNc0 (ORCPT ); Tue, 19 Sep 2023 09:32:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232372AbjISNcY (ORCPT ); Tue, 19 Sep 2023 09:32:24 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1D12FB for ; Tue, 19 Sep 2023 06:32:16 -0700 (PDT) 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 1qiapp-0004dB-9P; Tue, 19 Sep 2023 15:32:13 +0200 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 1qiapo-007T3E-Sw; Tue, 19 Sep 2023 15:32:12 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapo-0030e7-Jl; Tue, 19 Sep 2023 15:32:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Eugeniy Paltsev , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 10/59] dma: dw-axi-dmac: dw-axi-dmac-platform: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:18 +0200 Message-Id: <20230919133207.1400430-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1940; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=s+4I0CINDG+YzTzb0V5LWp1CEqKdvqZLk5TrxYwFYCA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaG5W9Gd+fS9FdSY+DXQgCA0oQrYlwLVSuzq+ v9/Xp25t1KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhuQAKCRCPgPtYfRL+ TlfQB/9QLZmCt9ZIxv9qnEknVf91DVqzqF6zwUsyyF5Bl4Vgoj9dRsTaj+5MY4Q4NwC+cQaviZ4 VV1ujnQd4FKsubSwSzsif0L2J3THwQXyDhpptJX4McEz1X+pmM3pFcKYIEidnEyi+FXmI1fM0D3 EaAwnoIvAy07DOx5j+Es8IhUjylgmtnMshmZQo6aIf6o9Mf6nSAbRGReLM0IeADJ8nx/EtNuNxd zveMnlG3JhFY6JLDpmTQzg8lkSW68Q89LUOBqTNSODGm+FYFKmQHWEi3S2Bg5V0WWIQ0rqKg6Tb 2C6mmQW7d8BXh1l491eBkGBGLOlmZGwVdjEXV4CKODiOB+jw 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c index dd02f84e404d..974da2fda2e4 100644 --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c @@ -1535,7 +1535,7 @@ static int dw_probe(struct platform_device *pdev) return ret; } -static int dw_remove(struct platform_device *pdev) +static void dw_remove(struct platform_device *pdev) { struct axi_dma_chip *chip = platform_get_drvdata(pdev); struct dw_axi_dma *dw = chip->dw; @@ -1564,8 +1564,6 @@ static int dw_remove(struct platform_device *pdev) list_del(&chan->vc.chan.device_node); tasklet_kill(&chan->vc.task); } - - return 0; } static const struct dev_pm_ops dw_axi_dma_pm_ops = { @@ -1588,7 +1586,7 @@ MODULE_DEVICE_TABLE(of, dw_dma_of_id_table); static struct platform_driver dw_driver = { .probe = dw_probe, - .remove = dw_remove, + .remove_new = dw_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = dw_dma_of_id_table, From patchwork Tue Sep 19 13:31:19 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: 13391398 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AD36CD5BC2 for ; Tue, 19 Sep 2023 13:32:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232257AbjISNce (ORCPT ); Tue, 19 Sep 2023 09:32:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232389AbjISNc1 (ORCPT ); Tue, 19 Sep 2023 09:32:27 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B4D7FB for ; Tue, 19 Sep 2023 06:32:22 -0700 (PDT) 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 1qiapp-0004dP-H1; Tue, 19 Sep 2023 15:32:13 +0200 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 1qiapp-007T3I-2o; Tue, 19 Sep 2023 15:32:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapo-0030eC-Q6; Tue, 19 Sep 2023 15:32:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Viresh Kumar , Andy Shevchenko , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 11/59] dma: dw: platform: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:19 +0200 Message-Id: <20230919133207.1400430-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1822; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=XW6ycHooaIyjqT+sBWy6UWgpr/TYRPc0oGs88HNsnfY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaG6ZyFg+H99NLEGOVH4ho2mSnR79CV1LXSH6 MkCOmHO1PKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhugAKCRCPgPtYfRL+ Tv2IB/wJOrv2/eAJX0MUyhI9hFKKABLDBOPdWBesGwHdNWKJM5J7ZaEVYTOaM7sDSTeNelF9Fv/ 4PtNRY6VtoXqwWy24pmQblToXsoqTDVRMr45C2nDWW+DrzqcXqjnFdC6ptiPW60nxXO7UeNgJyA Oi+K4CT/eAbuFKrMAm1nCK0i74QsVdOMn+H729tZvxhBWznx608PyIB5LVfgzmeW5VYwi0MiIFz L73hqAuBCrXeVhlQebGTdvyKBKbJwyCyXuX5fQIQoFHsfyOoxlLSxVPYzcyw25GptywwU2BMGPa PZcjgploufXpxL2uJvJcnFfDCziuC2Aqc3PnTYZS0fNpXoEP 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 Acked-by: Viresh Kumar --- drivers/dma/dw/platform.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c index 47f2292dba98..7d9d4c951724 100644 --- a/drivers/dma/dw/platform.c +++ b/drivers/dma/dw/platform.c @@ -93,7 +93,7 @@ static int dw_probe(struct platform_device *pdev) return err; } -static int dw_remove(struct platform_device *pdev) +static void dw_remove(struct platform_device *pdev) { struct dw_dma_chip_pdata *data = platform_get_drvdata(pdev); struct dw_dma_chip *chip = data->chip; @@ -109,8 +109,6 @@ static int dw_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); clk_disable_unprepare(chip->clk); - - return 0; } static void dw_shutdown(struct platform_device *pdev) @@ -193,7 +191,7 @@ static const struct dev_pm_ops dw_dev_pm_ops = { static struct platform_driver dw_driver = { .probe = dw_probe, - .remove = dw_remove, + .remove_new = dw_remove, .shutdown = dw_shutdown, .driver = { .name = DRV_NAME, From patchwork Tue Sep 19 13:31:20 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: 13391381 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE8D7CD5BBD for ; Tue, 19 Sep 2023 13:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232387AbjISNcY (ORCPT ); Tue, 19 Sep 2023 09:32:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232347AbjISNcU (ORCPT ); Tue, 19 Sep 2023 09:32:20 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34121F7 for ; Tue, 19 Sep 2023 06:32:15 -0700 (PDT) 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 1qiapp-0004dW-ME; Tue, 19 Sep 2023 15:32:13 +0200 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 1qiapp-007T3M-9U; Tue, 19 Sep 2023 15:32:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapp-0030eG-0Q; Tue, 19 Sep 2023 15:32:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/59] dma: fsl-edma-main: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:20 +0200 Message-Id: <20230919133207.1400430-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1924; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=NFWX8bCcjXb/ARf9UEfUoGFyz+gjJU6M2gobqXPAMbs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaG7b3sWZ1o+WV2dpm8pOJQOCNgn7DlUAT8pC IBqgXZ8N/eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhuwAKCRCPgPtYfRL+ TsP2CACsyK3ago6Jn9cD8jumV35Zl0PEQWDhXEJ/5BZfhz3GgEMmsfXHLVeICWI582uJRgmUQpp Fd1MgkfjUGGbzEjXmjjj8dT5vpjpoJhGw0DWkVd38D50AYN4OpSZdfsOapx2uTVVSEA/1s0v7SX cePIbHv0eANBDOgerR/S1ec8dtc2V1miok/dyYEN9eaZ4xVHoT6TwOB0SSwfs+ndrAamei6VA3F RzgiP3m2r+N0725D6HRpgnrXmksoLTroAx/7dpVQCK2D6LtI3DRrG+LUpDisvOyqxpPrt/m5bGt Ec70WXNZ2R9uRj+oglgfJ1O5tPUIKco6SMMXW2QVVc8tHmyj 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/fsl-edma-main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 63d48d046f04..11da143955b3 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -615,7 +615,7 @@ static int fsl_edma_probe(struct platform_device *pdev) return 0; } -static int fsl_edma_remove(struct platform_device *pdev) +static void fsl_edma_remove(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; struct fsl_edma_engine *fsl_edma = platform_get_drvdata(pdev); @@ -625,8 +625,6 @@ static int fsl_edma_remove(struct platform_device *pdev) of_dma_controller_free(np); dma_async_device_unregister(&fsl_edma->dma_dev); fsl_disable_clocks(fsl_edma, fsl_edma->drvdata->dmamuxs); - - return 0; } static int fsl_edma_suspend_late(struct device *dev) @@ -690,7 +688,7 @@ static struct platform_driver fsl_edma_driver = { .pm = &fsl_edma_pm_ops, }, .probe = fsl_edma_probe, - .remove = fsl_edma_remove, + .remove_new = fsl_edma_remove, }; static int __init fsl_edma_init(void) From patchwork Tue Sep 19 13:31:21 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: 13391383 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78CD3CD5BC2 for ; Tue, 19 Sep 2023 13:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232391AbjISNcZ (ORCPT ); Tue, 19 Sep 2023 09:32:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232359AbjISNcV (ORCPT ); Tue, 19 Sep 2023 09:32:21 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B639F9 for ; Tue, 19 Sep 2023 06:32:15 -0700 (PDT) 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 1qiapp-0004e5-SY; Tue, 19 Sep 2023 15:32:13 +0200 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 1qiapp-007T3Q-Fx; Tue, 19 Sep 2023 15:32:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapp-0030eK-6q; Tue, 19 Sep 2023 15:32:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 13/59] dma: fsl-qdma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:21 +0200 Message-Id: <20230919133207.1400430-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1821; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IaiQ3AbO3+Iv0bt1r5/Fe5lMbWG55qJkI3qoLoHrIN4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaG9+gSbrrS9H4bJVk8U7wcWUh6wu9+JEEr3f SmffBrL/5qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhvQAKCRCPgPtYfRL+ TiiUB/9Pzf/Cmr2qU8SEt6rb/g+rZnxX99jPrNzJK3wkLbtqVUkEyu/BA8EtOH7+SIx5AH/6k6D /wzOiHHeZc2A52bFhydMZfXeICOQI/krP0oy1GKUPK3yEfLhoujxa1MJc828+Im8/HHXQYwIHaS NM2GGW2vyWJL1HnsR7bNwOmGSxuzC3CEHjWuZFjzl/sLZygydptPKcmSss0mPJdPBHsrF69j6cV asBYcR527dswKcbv2G9XAKo11J2O6br2fzRbx9MjBtinvWzYEI2a0y8bbtLTFECKlTWURW0h/jg 1pwldooVntBXic2mo/iTFV5lAnTEjTJXxINBiWo/XBgByZ+1 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/fsl-qdma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c index a8cc8a4bc610..47cb28468049 100644 --- a/drivers/dma/fsl-qdma.c +++ b/drivers/dma/fsl-qdma.c @@ -1266,7 +1266,7 @@ static void fsl_qdma_cleanup_vchan(struct dma_device *dmadev) } } -static int fsl_qdma_remove(struct platform_device *pdev) +static void fsl_qdma_remove(struct platform_device *pdev) { int i; struct fsl_qdma_queue *status; @@ -1283,7 +1283,6 @@ static int fsl_qdma_remove(struct platform_device *pdev) dma_free_coherent(&pdev->dev, sizeof(struct fsl_qdma_format) * status->n_cq, status->cq, status->bus_addr); } - return 0; } static const struct of_device_id fsl_qdma_dt_ids[] = { @@ -1298,7 +1297,7 @@ static struct platform_driver fsl_qdma_driver = { .of_match_table = fsl_qdma_dt_ids, }, .probe = fsl_qdma_probe, - .remove = fsl_qdma_remove, + .remove_new = fsl_qdma_remove, }; module_platform_driver(fsl_qdma_driver); From patchwork Tue Sep 19 13:31:22 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: 13391382 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF406CD5BC1 for ; Tue, 19 Sep 2023 13:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232397AbjISNcZ (ORCPT ); Tue, 19 Sep 2023 09:32:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232364AbjISNcV (ORCPT ); Tue, 19 Sep 2023 09:32:21 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4C9BEC for ; Tue, 19 Sep 2023 06:32:15 -0700 (PDT) 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 1qiapq-0004ev-5l; Tue, 19 Sep 2023 15:32:14 +0200 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 1qiapp-007T3Y-Ob; Tue, 19 Sep 2023 15:32:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapp-0030eO-FP; Tue, 19 Sep 2023 15:32:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 14/59] dma: fsl_raid: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:22 +0200 Message-Id: <20230919133207.1400430-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1788; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=v3VRHkdVrKlET1Zuc/3I4iwdDbftxLnfNR5rPQCW040=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaG+3ZxPj+vPvQmZnHE5bvOh0DYl4QknuIFvh LTGepyWNFGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhvgAKCRCPgPtYfRL+ TppCB/9od4skhY7Oi1naJNJyo/XBk1gTT5C3tTzA0zNgxPa4C68qquHlWYnWsRHQ1bO9iNhm8NQ Yh5cx7uIFlEARtnA7aN45aubpxNsZdOLwKf5Cbfvn4sqm25sQBIRcOJ0y5ce7pXqvqciev8McbE FYpyj4peJc/jE/pr67iw83u/n+QIllYQwP48NJ8THHyLJ0fZ0RYhlz7iW+lDFo+pKt004IlhAxM mYoJ0/qiVuXRO5eiTIFtNCBnaTTZQKWRUuq87DFZTUb4CYwVPBEnOe+NcvseEhFEAyrqJUgxEDq IodvCRnTSDbOeqVupIqUARh2BTvN5jY96TP2pqBifbIoonin 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/fsl_raid.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/fsl_raid.c b/drivers/dma/fsl_raid.c index 0b9ca93ce3dc..014ff523d5ec 100644 --- a/drivers/dma/fsl_raid.c +++ b/drivers/dma/fsl_raid.c @@ -857,7 +857,7 @@ static void fsl_re_remove_chan(struct fsl_re_chan *chan) chan->oub_phys_addr); } -static int fsl_re_remove(struct platform_device *ofdev) +static void fsl_re_remove(struct platform_device *ofdev) { struct fsl_re_drv_private *re_priv; struct device *dev; @@ -872,8 +872,6 @@ static int fsl_re_remove(struct platform_device *ofdev) /* Unregister the driver */ dma_async_device_unregister(&re_priv->dma_dev); - - return 0; } static const struct of_device_id fsl_re_ids[] = { @@ -888,7 +886,7 @@ static struct platform_driver fsl_re_driver = { .of_match_table = fsl_re_ids, }, .probe = fsl_re_probe, - .remove = fsl_re_remove, + .remove_new = fsl_re_remove, }; module_platform_driver(fsl_re_driver); From patchwork Tue Sep 19 13:31:23 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: 13391433 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07E2DCD5BBD for ; Tue, 19 Sep 2023 13:32:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232446AbjISNcw (ORCPT ); Tue, 19 Sep 2023 09:32:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232425AbjISNcl (ORCPT ); Tue, 19 Sep 2023 09:32:41 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 786AEF5 for ; Tue, 19 Sep 2023 06:32:33 -0700 (PDT) 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 1qiapq-0004gh-E9; Tue, 19 Sep 2023 15:32:14 +0200 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 1qiapp-007T3c-Uh; Tue, 19 Sep 2023 15:32:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapp-0030eS-LR; Tue, 19 Sep 2023 15:32:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Li Yang , Zhang Wei , linuxppc-dev@lists.ozlabs.org, dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 15/59] dma: fsldma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:23 +0200 Message-Id: <20230919133207.1400430-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1707; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=lH2QKyTRMosTUBamQ8ap+SHPRBpiN3LLvYfnazK5ypI=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTOhfvdfOtrIzfVP8kqMm7kTXnOtUOS3+aZMOtktuhPe e0Xv7d1MhqzMDByMciKKbLYN67JtKqSi+xc++8yzCBWJpApDFycAjCRAAP2/wGutwOmb0g1PS2w VTSEX7DLruP55Wm/Zx+ZkPfpcbPilVyOxXfNtouIs3814GQvf169Jr9xt9Eml3M3OPeFZe9+ILh F6PwaNtdFmb03vx3n8youkLc9w2+idfrNB/eIlr2spUwrxdvcQ2587Ko/0HhSyWQ7X9wW6+I+Y0 /PT7svJy/rT8iv9XtQu+l175O9AZMW18nz+UbLtAt0+b/2++s869WSVex7bvCnWHq8vbPrZ3BNh b3r87NfvK8f4raQ+JIk1hi6sVvKWZwtKaBt8//4WRcYrm45nlnhuos96L23TmOL7uMVy34bNyz+ bjtRYJ6V1D0OQyUeiXK2+FUfbBhOvJo4g0s9XzRXc28kAA== 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/fsldma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index ddcf736d283d..18a6c4bf6275 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c @@ -1306,7 +1306,7 @@ static int fsldma_of_probe(struct platform_device *op) return err; } -static int fsldma_of_remove(struct platform_device *op) +static void fsldma_of_remove(struct platform_device *op) { struct fsldma_device *fdev; unsigned int i; @@ -1324,8 +1324,6 @@ static int fsldma_of_remove(struct platform_device *op) iounmap(fdev->regs); kfree(fdev); - - return 0; } #ifdef CONFIG_PM @@ -1406,7 +1404,7 @@ static struct platform_driver fsldma_of_driver = { #endif }, .probe = fsldma_of_probe, - .remove = fsldma_of_remove, + .remove_new = fsldma_of_remove, }; /*----------------------------------------------------------------------------*/ From patchwork Tue Sep 19 13:31:24 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: 13391385 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12F99CD5BC4 for ; Tue, 19 Sep 2023 13:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232355AbjISNc0 (ORCPT ); Tue, 19 Sep 2023 09:32:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232369AbjISNcX (ORCPT ); Tue, 19 Sep 2023 09:32:23 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93C5EF3 for ; Tue, 19 Sep 2023 06:32:16 -0700 (PDT) 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 1qiapq-0004hc-Pc; Tue, 19 Sep 2023 15:32:14 +0200 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 1qiapq-007T3g-3J; Tue, 19 Sep 2023 15:32:14 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapp-0030eV-Qe; Tue, 19 Sep 2023 15:32:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 16/59] dma: idma64: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:24 +0200 Message-Id: <20230919133207.1400430-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1747; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=sFh7t+ASWODCri2NYm+N/G20spRWcYqtBybqkG+lhgs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHAWCzwX98yP44bDPLuBi7IfBy/Z55KDeBI+ 0PUMeC1q9eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhwAAKCRCPgPtYfRL+ Ts49B/98k+5hxMFzrMKMLPIdCKbKPORpJhHaN7PGndqzOuBxGBQvSzaK94jayJ2QoCVCkYmr/bI S29uqhpSh3xxmsiZQnKdwfunQGsiB3vuJRAJoN/aWyPrBtqEQNtEGtExoC86Rx71UZXXzOoEZbJ tAaL0fW46aG++AsZgE3dREUcy5XdRGde8n2RtL8l7EPR/O33+iHSLOHyJBx5Z5NrEJtRK0KpLSe gGU+CqB9RiNaPbRsKOKP71F1LeotThHVV6MibCDcTo/qXmsZfXGTF1tv5xCewxtSX7QovKnpgRS YUlGdKfvwGjzWAjQ8cX3bsrkah14h0g7edAoF74+G5H9hDdi 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/idma64.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/idma64.c b/drivers/dma/idma64.c index 0ac634a51c5e..78a938969d7d 100644 --- a/drivers/dma/idma64.c +++ b/drivers/dma/idma64.c @@ -660,13 +660,11 @@ static int idma64_platform_probe(struct platform_device *pdev) return 0; } -static int idma64_platform_remove(struct platform_device *pdev) +static void idma64_platform_remove(struct platform_device *pdev) { struct idma64_chip *chip = platform_get_drvdata(pdev); idma64_remove(chip); - - return 0; } static int __maybe_unused idma64_pm_suspend(struct device *dev) @@ -691,7 +689,7 @@ static const struct dev_pm_ops idma64_dev_pm_ops = { static struct platform_driver idma64_platform_driver = { .probe = idma64_platform_probe, - .remove = idma64_platform_remove, + .remove_new = idma64_platform_remove, .driver = { .name = LPSS_IDMA64_DRIVER_NAME, .pm = &idma64_dev_pm_ops, From patchwork Tue Sep 19 13:31:25 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: 13391386 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12AF4CD5BC6 for ; Tue, 19 Sep 2023 13:32:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232383AbjISNc0 (ORCPT ); Tue, 19 Sep 2023 09:32:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232373AbjISNcY (ORCPT ); Tue, 19 Sep 2023 09:32:24 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB1DB100 for ; Tue, 19 Sep 2023 06:32:16 -0700 (PDT) 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 1qiapr-0004ic-2O; Tue, 19 Sep 2023 15:32:15 +0200 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 1qiapq-007T3j-9j; Tue, 19 Sep 2023 15:32:14 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapq-0030eZ-0l; Tue, 19 Sep 2023 15:32:14 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 17/59] dma: img-mdc-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:25 +0200 Message-Id: <20230919133207.1400430-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1854; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cTzWD784bno/dGHDEoHhhnkeX/LMdfIgHp/VjsyUXHw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHBQSmAoQRS/RFOYaqoUGY8cC6vhXCOhhHLH efBxXonjHqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhwQAKCRCPgPtYfRL+ TgTSB/90BZ+VHh3qshqev3qyVZBu3eKmfV+LpY+i1mgseroOPx3srl+rY3irno9T5P7RBUhT5rN 8el1ipKDZjkeYy/zFphcSYCey9SJiNaV8vfd2C4VYFo7c5ntmfvVB9sBRP6AK5xEOU2q2yJDOIp xn2kqjFRi6hEG5cjvH2KlG+4tO/6ee9sl172jFqVtW3r4piU1I9ZVXsT5F2Ur+5Th0V1uUFKVi4 pRLR5y0xMq/d4l+XUhrFGzMXWl8Uz8rIxiD4p/iJC9VRUvSzG3UlOgAfyIMcAtbCJtSAD+hMuCn CwNl+rR+bIzzSzTZJq8rIl63WIVCrvKXY2/mYwBL7HiXqYHr 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/img-mdc-dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/img-mdc-dma.c b/drivers/dma/img-mdc-dma.c index 9be0d3226e19..0532dd2640dc 100644 --- a/drivers/dma/img-mdc-dma.c +++ b/drivers/dma/img-mdc-dma.c @@ -1017,7 +1017,7 @@ static int mdc_dma_probe(struct platform_device *pdev) return ret; } -static int mdc_dma_remove(struct platform_device *pdev) +static void mdc_dma_remove(struct platform_device *pdev) { struct mdc_dma *mdma = platform_get_drvdata(pdev); struct mdc_chan *mchan, *next; @@ -1037,8 +1037,6 @@ static int mdc_dma_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) img_mdc_runtime_suspend(&pdev->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1078,7 +1076,7 @@ static struct platform_driver mdc_dma_driver = { .of_match_table = of_match_ptr(mdc_dma_of_match), }, .probe = mdc_dma_probe, - .remove = mdc_dma_remove, + .remove_new = mdc_dma_remove, }; module_platform_driver(mdc_dma_driver); From patchwork Tue Sep 19 13:31:26 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: 13391403 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7DA1CD5BC4 for ; Tue, 19 Sep 2023 13:32:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232364AbjISNcg (ORCPT ); Tue, 19 Sep 2023 09:32:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232405AbjISNca (ORCPT ); Tue, 19 Sep 2023 09:32:30 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61221123 for ; Tue, 19 Sep 2023 06:32:25 -0700 (PDT) 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 1qiapr-0004jD-95; Tue, 19 Sep 2023 15:32:15 +0200 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 1qiapq-007T3o-Jj; Tue, 19 Sep 2023 15:32:14 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapq-0030ee-AU; Tue, 19 Sep 2023 15:32:14 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 18/59] dma: imx-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:26 +0200 Message-Id: <20230919133207.1400430-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1804; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=jFClRoZci1hZIqjL65iDQsFtOH3Eq+23KmERQ04Ia5c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHCjERJqV3CFl+utVhnbbZEll1ydaFNVNPmM 23PlcthRDmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhwgAKCRCPgPtYfRL+ TsVEB/sGXeKszBGDm+qUaIyIOhvSGu54UBTEg1/4ipdmzakd9J0LBla4+AgspBmdrch8qINZP/H hdfvPYIhjxytFSOZ5CvfhtZCSlRS3tz4kVwIsXMW2HgTpEQEI0NXcjwfWGaSNpJxhE+JbfsBZNQ M+hnkmBMab7TdplpXU/3ccNLLtdljxMoV8wgjvF3Xcuyog15cvqVCqMGIDqJl5GagTCad1205LY wrq78/nIX8z+VVlmvIpZQvJ6R0EU71ihRVaEY6UExLwYqTO4TERFr7Gjc4cD4H4kNFH9hTCfHCS svR0JjxzDNv550f2NnXIl7jAN2XPxZIkYgRQvvpByai5ZYzT 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/imx-dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index 114f254b9f50..ebf7c115d553 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -1216,7 +1216,7 @@ static void imxdma_free_irq(struct platform_device *pdev, struct imxdma_engine * } } -static int imxdma_remove(struct platform_device *pdev) +static void imxdma_remove(struct platform_device *pdev) { struct imxdma_engine *imxdma = platform_get_drvdata(pdev); @@ -1229,8 +1229,6 @@ static int imxdma_remove(struct platform_device *pdev) clk_disable_unprepare(imxdma->dma_ipg); clk_disable_unprepare(imxdma->dma_ahb); - - return 0; } static struct platform_driver imxdma_driver = { @@ -1238,7 +1236,7 @@ static struct platform_driver imxdma_driver = { .name = "imx-dma", .of_match_table = imx_dma_of_dev_id, }, - .remove = imxdma_remove, + .remove_new = imxdma_remove, }; static int __init imxdma_module_init(void) From patchwork Tue Sep 19 13:31:27 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: 13391405 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39C28CD5BC3 for ; Tue, 19 Sep 2023 13:32:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232405AbjISNch (ORCPT ); Tue, 19 Sep 2023 09:32:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232372AbjISNca (ORCPT ); Tue, 19 Sep 2023 09:32:30 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C1ECF3 for ; Tue, 19 Sep 2023 06:32:24 -0700 (PDT) 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 1qiapr-0004jd-I4; Tue, 19 Sep 2023 15:32:15 +0200 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 1qiapq-007T3r-SY; Tue, 19 Sep 2023 15:32:14 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapq-0030ei-JD; Tue, 19 Sep 2023 15:32:14 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 19/59] dma: imx-sdma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:27 +0200 Message-Id: <20230919133207.1400430-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1699; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hneMaQhy4moY5StDkH7l6uC8+I3TNb891DRslxYBUjA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHEH6xKY8NvJQR0M7d5tMp1WDfiRw7/hGO4J kN02Tr08oeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhxAAKCRCPgPtYfRL+ TrLdCAC5OfTTfvkvZxYmEgg5IqvV2FbSOuCsVYrE281z1s3lNwuWRAUzCSbqrmRpIxG1Z/uGE6y MolzVBZzfdfor2ibiMA01l0K2HML3UeFSgi5kYPUc0Dx6ZBGAHeL7SKUStDhEDvCYlwMthf3kQI 3QYUXcWGsUtHCx+9RS9IeG7ESn/+s2gVnHMTaj3kzsNCR+Go4BQJKN/gfGatTHn5zs6EX7t7Rci jBxP2GL9doIDHfLNb2dApU4M66d3R3AF2vQAQ4Jdg52T36RK7eJqNVsfGadWCnj8wNHd96+OwCi 1qiYQJVte5bD783lq+4Z0o+ssjO8sq8BoQXubNZaq8BiPtII 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/imx-sdma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 51012bd39900..f81ecf5863e8 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -2358,7 +2358,7 @@ static int sdma_probe(struct platform_device *pdev) return ret; } -static int sdma_remove(struct platform_device *pdev) +static void sdma_remove(struct platform_device *pdev) { struct sdma_engine *sdma = platform_get_drvdata(pdev); int i; @@ -2377,7 +2377,6 @@ static int sdma_remove(struct platform_device *pdev) } platform_set_drvdata(pdev, NULL); - return 0; } static struct platform_driver sdma_driver = { @@ -2385,7 +2384,7 @@ static struct platform_driver sdma_driver = { .name = "imx-sdma", .of_match_table = sdma_dt_ids, }, - .remove = sdma_remove, + .remove_new = sdma_remove, .probe = sdma_probe, }; From patchwork Tue Sep 19 13:31:28 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: 13391387 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACE96CD5BBF for ; Tue, 19 Sep 2023 13:32:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232373AbjISNc1 (ORCPT ); Tue, 19 Sep 2023 09:32:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232357AbjISNcY (ORCPT ); Tue, 19 Sep 2023 09:32:24 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DD28102 for ; Tue, 19 Sep 2023 06:32:17 -0700 (PDT) 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 1qiapr-0004kV-LK; Tue, 19 Sep 2023 15:32:15 +0200 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 1qiapr-007T3v-2T; Tue, 19 Sep 2023 15:32:15 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapq-0030em-PV; Tue, 19 Sep 2023 15:32:14 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 20/59] dma: k3dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:28 +0200 Message-Id: <20230919133207.1400430-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1723; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=9+90O+VNf7DEV2uM3hmuqaM/WHvfJCH1YURre3KlQ0I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHFL3FWDu2t1SRmcBfdqW150hbgM47jMZIIl aJeg7MvaZOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhxQAKCRCPgPtYfRL+ ToguCACTDBlTO9RTnfd7T+KZy4VCHCst8U7TylgkwFsSoap5zQKsCPQb4jkt5cGmorbMtlEr4jH nblnQYM1ObnSaupx46vy5SwS1lPo88mZbGmaj1Fp/Qs2OfHS6i4bKz/zaMvLfT6nFGGm4trvYU1 4HA9yzm+LZ1R4bCwc9P6H4T+wnJ0JF7L9UQeYh0CbVi6K1TMRjogbDrFXXw+X5XbMhCi4qlZcZ/ h2jjxADElxpY46GklTiuruokp7RGCS7OmvyNftJ1zQVzoVS4SgdJYydrTn08RrcNfYX/ZEZ8jbc l/xeb+pNPiQ0LCnXq+mg4hgXgUeyS8iDukfQ+RexCwJD0PIX 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/k3dma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c index ecdaada95120..22b37b525a48 100644 --- a/drivers/dma/k3dma.c +++ b/drivers/dma/k3dma.c @@ -974,7 +974,7 @@ static int k3_dma_probe(struct platform_device *op) return ret; } -static int k3_dma_remove(struct platform_device *op) +static void k3_dma_remove(struct platform_device *op) { struct k3_dma_chan *c, *cn; struct k3_dma_dev *d = platform_get_drvdata(op); @@ -990,7 +990,6 @@ static int k3_dma_remove(struct platform_device *op) } tasklet_kill(&d->task); clk_disable_unprepare(d->clk); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1034,7 +1033,7 @@ static struct platform_driver k3_pdma_driver = { .of_match_table = k3_pdma_dt_ids, }, .probe = k3_dma_probe, - .remove = k3_dma_remove, + .remove_new = k3_dma_remove, }; module_platform_driver(k3_pdma_driver); From patchwork Tue Sep 19 13:31:29 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: 13391389 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E50E7CD5BBD for ; Tue, 19 Sep 2023 13:32:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232357AbjISNc1 (ORCPT ); Tue, 19 Sep 2023 09:32:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232376AbjISNcY (ORCPT ); Tue, 19 Sep 2023 09:32:24 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E99A114 for ; Tue, 19 Sep 2023 06:32:17 -0700 (PDT) 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 1qiapr-0004l8-SX; Tue, 19 Sep 2023 15:32:15 +0200 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 1qiapr-007T3z-Bf; Tue, 19 Sep 2023 15:32:15 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapq-0030ep-Vu; Tue, 19 Sep 2023 15:32:15 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 21/59] dma: mcf-edma-main: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:29 +0200 Message-Id: <20230919133207.1400430-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1800; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=x7UfmXVGm7Okn+cBzQEEASwC552geO68PJM2twF1NLs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHGU+hiiIWkjwPhSqFwxR0TfULYwb2C2z5Ti PPJE+XUXkmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhxgAKCRCPgPtYfRL+ Tq1ZB/9lbH50D/1zYLMVvEB2pXSo8UYaxZXene+0VcBLY18z4liHy53qosbQCJlHNwXyWss/iMB 3yn2eMrcHMZhhl9mzlleAxvi0UUUjgFkX3QGtO4Yt6W0MFFIFeBz8eMa7NxdXb8p3i0NHo/s5Lp b+mRRh7+7eK/kgwSehgdX+iw/494NlrJ1fS+fytWtyeTbC4wEXNBeg0JiP17P0DcpzWW6ebNj+s Lhz14ctgtKPBhvRs7J6POG4Y3uEmbX/smxryy3IrxCrfkvH2sOAEBzr9AhEpNNSuayYh1tVZsnS 1E0kOGigCV82+wakpI/B3Rm7SqHKlKy9+yrA+Ibx4NoHaDWV 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/mcf-edma-main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c index b359421ee9ea..ab21455d9c3a 100644 --- a/drivers/dma/mcf-edma-main.c +++ b/drivers/dma/mcf-edma-main.c @@ -255,15 +255,13 @@ static int mcf_edma_probe(struct platform_device *pdev) return 0; } -static int mcf_edma_remove(struct platform_device *pdev) +static void mcf_edma_remove(struct platform_device *pdev) { struct fsl_edma_engine *mcf_edma = platform_get_drvdata(pdev); mcf_edma_irq_free(pdev, mcf_edma); fsl_edma_cleanup_vchan(&mcf_edma->dma_dev); dma_async_device_unregister(&mcf_edma->dma_dev); - - return 0; } static struct platform_driver mcf_edma_driver = { @@ -271,7 +269,7 @@ static struct platform_driver mcf_edma_driver = { .name = "mcf-edma", }, .probe = mcf_edma_probe, - .remove = mcf_edma_remove, + .remove_new = mcf_edma_remove, }; bool mcf_edma_filter_fn(struct dma_chan *chan, void *param) From patchwork Tue Sep 19 13:31:30 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: 13391404 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C6BBCD5BC2 for ; Tue, 19 Sep 2023 13:32:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232372AbjISNch (ORCPT ); Tue, 19 Sep 2023 09:32:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232398AbjISNca (ORCPT ); Tue, 19 Sep 2023 09:32:30 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45DE1F5 for ; Tue, 19 Sep 2023 06:32:24 -0700 (PDT) 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 1qiaps-0004lU-2q; Tue, 19 Sep 2023 15:32:16 +0200 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 1qiapr-007T43-Hv; Tue, 19 Sep 2023 15:32:15 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapr-0030eu-8Q; Tue, 19 Sep 2023 15:32:15 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 22/59] dma: mediatek: mtk-cqdma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:30 +0200 Message-Id: <20230919133207.1400430-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1816; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YJbeovTY/lshOQ9H/y+Krl2XAltInqDgPcX2R8AjpCQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHH9ujjB5HmrSGUbvrIzAR4yuMWtHJ9HDkOm CQ78TXL1OiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhxwAKCRCPgPtYfRL+ TvIlCACfKCVspXcqAoqSCz8HES+XLDWJAvS5U3mb49tYIQ7MAR8BjUH1ZFRM/+rRHno4UDtzU6i 6CW3aKThZ/2sQmsX78pxUaKLctRU+Dg0jKx0N7g3d42wFRdfUOogI3l4YxEz2h7Q5BGTuuQ3yIA HpLed1bOlCcQ3+HARE6KBlKTzNymiohy0CJ4wF+lrftR7MIz0VOF3Kxe12WyLI2GJcEwdpDlRuH skrWojmXT33Hp3aEvZ2jUgFP02BzU5WqwPpucgXkfTZ8Th653DBdaeRux6Zx+YTyG4GOJpQB8mt PRS0ATmaUxUQGhiahT/qCa3BDuu0k83Bs56uHQaaVF9ptEj4 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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: AngeloGioacchino Del Regno --- drivers/dma/mediatek/mtk-cqdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/mediatek/mtk-cqdma.c b/drivers/dma/mediatek/mtk-cqdma.c index 324b7387b1b9..529100c5b9f5 100644 --- a/drivers/dma/mediatek/mtk-cqdma.c +++ b/drivers/dma/mediatek/mtk-cqdma.c @@ -885,7 +885,7 @@ static int mtk_cqdma_probe(struct platform_device *pdev) return err; } -static int mtk_cqdma_remove(struct platform_device *pdev) +static void mtk_cqdma_remove(struct platform_device *pdev) { struct mtk_cqdma_device *cqdma = platform_get_drvdata(pdev); struct mtk_cqdma_vchan *vc; @@ -918,13 +918,11 @@ static int mtk_cqdma_remove(struct platform_device *pdev) dma_async_device_unregister(&cqdma->ddev); of_dma_controller_free(pdev->dev.of_node); - - return 0; } static struct platform_driver mtk_cqdma_driver = { .probe = mtk_cqdma_probe, - .remove = mtk_cqdma_remove, + .remove_new = mtk_cqdma_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = mtk_cqdma_match, From patchwork Tue Sep 19 13:31:31 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: 13391400 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A16B3CD5BC0 for ; Tue, 19 Sep 2023 13:32:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232414AbjISNcf (ORCPT ); Tue, 19 Sep 2023 09:32:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232376AbjISNc3 (ORCPT ); Tue, 19 Sep 2023 09:32:29 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5DD3100 for ; Tue, 19 Sep 2023 06:32:22 -0700 (PDT) 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 1qiaps-0004ll-7p; Tue, 19 Sep 2023 15:32:16 +0200 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 1qiapr-007T47-Np; Tue, 19 Sep 2023 15:32:15 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapr-0030ey-Eh; Tue, 19 Sep 2023 15:32:15 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 23/59] dma: mediatek: mtk-hsdma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:31 +0200 Message-Id: <20230919133207.1400430-24-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1813; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IJ1lQBioULCY9DIp65+ezFk+Xj3QQq4U4gQ/TbmHhG0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHIFkHM3tFAVudlDyBAD/HTot2UmAFvMKJAZ W4j2F8u8ViJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhyAAKCRCPgPtYfRL+ Tod4CACLWe7DruMnd2TxKN6OnitRd/oivVvOi0J6GYqGQDBRgLPjatYtSZhA9rP2PbB+JH5M9mz 32yGXAt6fzOZuVkGD0cRujbiIuJH6NcAIOE0GnqeQxCxFsbZQL6rSGZqFdiAUO4Nkt4gSwuOn5X VsthkIIy27ek0ymdwOmH20K8ZFjCAjZ2yX33AWfgdpr1NTiyWBVcXBoN4mr8odkOiJUKVlb9nb6 ah+2OzC/tnkMHKJkSOQIjORCZLHTpL6p5+UJGoOBDOnNQ3in/qSRZXSANXbVHQDhOouWyRzko1O 9HnbzdgKeV2EG462hSjwxWifT5PkbeUguDdoVeqSwYcEIE11 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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: AngeloGioacchino Del Regno --- drivers/dma/mediatek/mtk-hsdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c index 64120767d983..36ff11e909ea 100644 --- a/drivers/dma/mediatek/mtk-hsdma.c +++ b/drivers/dma/mediatek/mtk-hsdma.c @@ -1009,7 +1009,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev) return err; } -static int mtk_hsdma_remove(struct platform_device *pdev) +static void mtk_hsdma_remove(struct platform_device *pdev) { struct mtk_hsdma_device *hsdma = platform_get_drvdata(pdev); struct mtk_hsdma_vchan *vc; @@ -1034,13 +1034,11 @@ static int mtk_hsdma_remove(struct platform_device *pdev) dma_async_device_unregister(&hsdma->ddev); of_dma_controller_free(pdev->dev.of_node); - - return 0; } static struct platform_driver mtk_hsdma_driver = { .probe = mtk_hsdma_probe, - .remove = mtk_hsdma_remove, + .remove_new = mtk_hsdma_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = mtk_hsdma_match, From patchwork Tue Sep 19 13:31:32 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: 13391402 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C398CD5BC1 for ; Tue, 19 Sep 2023 13:32:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232408AbjISNcg (ORCPT ); Tue, 19 Sep 2023 09:32:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232364AbjISNc3 (ORCPT ); Tue, 19 Sep 2023 09:32:29 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47D70118 for ; Tue, 19 Sep 2023 06:32:23 -0700 (PDT) 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 1qiaps-0004mC-D4; Tue, 19 Sep 2023 15:32:16 +0200 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 1qiapr-007T4B-UU; Tue, 19 Sep 2023 15:32:15 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapr-0030f2-L2; Tue, 19 Sep 2023 15:32:15 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 24/59] dma: mediatek: mtk-uart-apdma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:32 +0200 Message-Id: <20230919133207.1400430-25-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1931; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=wUbraRdeXmRBw3Mbj/6UX6zPs2CjQGjrTI14q+QjZaE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHKS5+AhUvdT2bl40gApNiQ3KFTPSuKLtcbm gR63aS/LsiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhygAKCRCPgPtYfRL+ TuzKB/95CaBCD0g/JL73MgWnCheF6AyO79HEHbWfRlHqmChu6bi7T9Y/zuSSRCs9nM13J3NvCBF 8jiOZCQyuvTb1Lrh8l3ukSvL6kJl4gsmC4Jh+FhBI2m4ZvuT7Ca41Vmrn9ym0PDEW2pLxOKcaQA N0FIMlvGJf8IFsQ6igKzue5tMLkiGd1oH5U9uFJtjIIpNA+fKbx5qh2lCLuWG40BTKBxgxs29cr oQDmJR/tOb+Ytz84Qg+7uMQfIACkTJVn2E8riJNLYii48dTzT7GGN84b1+0U1e2Vwc6MQByDgK8 eI907asvIjxgaPRi5om7joa3mZZ3db8IXrcYblNEJKlqjdv4 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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: AngeloGioacchino Del Regno --- drivers/dma/mediatek/mtk-uart-apdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/mediatek/mtk-uart-apdma.c b/drivers/dma/mediatek/mtk-uart-apdma.c index c51dc017b48a..8552531b4d64 100644 --- a/drivers/dma/mediatek/mtk-uart-apdma.c +++ b/drivers/dma/mediatek/mtk-uart-apdma.c @@ -573,7 +573,7 @@ static int mtk_uart_apdma_probe(struct platform_device *pdev) return rc; } -static int mtk_uart_apdma_remove(struct platform_device *pdev) +static void mtk_uart_apdma_remove(struct platform_device *pdev) { struct mtk_uart_apdmadev *mtkd = platform_get_drvdata(pdev); @@ -584,8 +584,6 @@ static int mtk_uart_apdma_remove(struct platform_device *pdev) dma_async_device_unregister(&mtkd->ddev); pm_runtime_disable(&pdev->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -640,7 +638,7 @@ static const struct dev_pm_ops mtk_uart_apdma_pm_ops = { static struct platform_driver mtk_uart_apdma_driver = { .probe = mtk_uart_apdma_probe, - .remove = mtk_uart_apdma_remove, + .remove_new = mtk_uart_apdma_remove, .driver = { .name = KBUILD_MODNAME, .pm = &mtk_uart_apdma_pm_ops, From patchwork Tue Sep 19 13:31:33 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: 13391391 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADCDCCD5BC1 for ; Tue, 19 Sep 2023 13:32:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232377AbjISNca (ORCPT ); Tue, 19 Sep 2023 09:32:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232381AbjISNcY (ORCPT ); Tue, 19 Sep 2023 09:32:24 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 248E9125 for ; Tue, 19 Sep 2023 06:32:18 -0700 (PDT) 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 1qiaps-0004nD-Hu; Tue, 19 Sep 2023 15:32:16 +0200 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 1qiaps-007T4F-48; Tue, 19 Sep 2023 15:32:16 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapr-0030f6-RL; Tue, 19 Sep 2023 15:32:15 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 25/59] dma: mmp_pdma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:33 +0200 Message-Id: <20230919133207.1400430-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1789; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=SSPLBYKR5cuYX0AgQzE9mTTs9THe3pRG3xWwJV/oUfw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHLXG2NhgkDDb+3mmTEhDMq40mbmn6yCzbDK oz6b6lgZnyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhywAKCRCPgPtYfRL+ TlNWCACuqjlFFSX//qi+TgUrnmzlOfCWRvlZkaiuVi0uxeDADxxMdj+d/PX74UwJpbD+81yDJC8 cy8IqutEd0R77eloXfxwPzITVgEA7U3tWz6AMlonl1TQRrXnt1TOhhN1KeDfx1LT1cimK8VyTU6 JFmLTD6fpXuD9UN0BjH4EzPs2y3yRyh/pxfkf/p1gQh8TiNHip+lC4fOsAawmGsIGP3UDEcf1UL tLl6fW9TVDhPCH2nifNnx2/JZe2n09oAi1yriCgS/DH3x8LYTWw+GTV0aaKb+MjlAGgJ5OrqGNe agkVKXaaEzHYL5JdRvFY0tP20ZL48EdUQpnAMTiKFONpejRP 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/mmp_pdma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index ebdfdcbb4f7a..492ec491a59b 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c @@ -932,7 +932,7 @@ static void dma_do_tasklet(struct tasklet_struct *t) } } -static int mmp_pdma_remove(struct platform_device *op) +static void mmp_pdma_remove(struct platform_device *op) { struct mmp_pdma_device *pdev = platform_get_drvdata(op); struct mmp_pdma_phy *phy; @@ -958,7 +958,6 @@ static int mmp_pdma_remove(struct platform_device *op) } dma_async_device_unregister(&pdev->device); - return 0; } static int mmp_pdma_chan_init(struct mmp_pdma_device *pdev, int idx, int irq) @@ -1141,7 +1140,7 @@ static struct platform_driver mmp_pdma_driver = { }, .id_table = mmp_pdma_id_table, .probe = mmp_pdma_probe, - .remove = mmp_pdma_remove, + .remove_new = mmp_pdma_remove, }; module_platform_driver(mmp_pdma_driver); From patchwork Tue Sep 19 13:31:34 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: 13391392 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 040C9CD5BC0 for ; Tue, 19 Sep 2023 13:32:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232382AbjISNca (ORCPT ); Tue, 19 Sep 2023 09:32:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232384AbjISNcY (ORCPT ); Tue, 19 Sep 2023 09:32:24 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DE6F129 for ; Tue, 19 Sep 2023 06:32:18 -0700 (PDT) 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 1qiaps-0004oz-PD; Tue, 19 Sep 2023 15:32:16 +0200 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 1qiaps-007T4K-Cl; Tue, 19 Sep 2023 15:32:16 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiaps-0030fA-3e; Tue, 19 Sep 2023 15:32:16 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 26/59] dma: mmp_tdma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:34 +0200 Message-Id: <20230919133207.1400430-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1664; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ExUgVQjU60Xy+Ix6S4j8D/SL67FKgT+QoqD6fJZAkwE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHMjNvWiAft8ma3jLXizifVX97cabSOLI6Oi PDTr+c+cimJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhzAAKCRCPgPtYfRL+ TlX5CACZmaKXv316VWtuLa5/kLAjzkKBZG74v+IFi157XkYIkaIJit2QC6Raq9bSGnHMaFoF1sG 8SYzDmsytug4eTlmDNMQkOQvieClsZ0LQVKs8Q1cfvvwlWg5fSRQaOjZjkN6nVUVMJrJUPeIPeR GQZyepjRjRyn7KS3GcwYD4qNdT/pjTGhbHte+bhVXa2r5S7JYLRGgNhCQZpJGuCg+loI8CMSDq6 4sdAdNMbv3WDBlomHxzoSMdfvTKdHqKAdL6TNn8ySkvAalNxto0//FILMPIFq1OFwGNaYmtN6lI hNdYQ3kzaKnyHhThQY+VCZGFmVrrY3jwKKFgbVR/pbSxSoj1 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/mmp_tdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c index d49fa6bc6775..f039e07181f7 100644 --- a/drivers/dma/mmp_tdma.c +++ b/drivers/dma/mmp_tdma.c @@ -552,12 +552,10 @@ static void mmp_tdma_issue_pending(struct dma_chan *chan) mmp_tdma_enable_chan(tdmac); } -static int mmp_tdma_remove(struct platform_device *pdev) +static void mmp_tdma_remove(struct platform_device *pdev) { if (pdev->dev.of_node) of_dma_controller_free(pdev->dev.of_node); - - return 0; } static int mmp_tdma_chan_init(struct mmp_tdma_device *tdev, @@ -753,7 +751,7 @@ static struct platform_driver mmp_tdma_driver = { }, .id_table = mmp_tdma_id_table, .probe = mmp_tdma_probe, - .remove = mmp_tdma_remove, + .remove_new = mmp_tdma_remove, }; module_platform_driver(mmp_tdma_driver); From patchwork Tue Sep 19 13:31:35 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: 13391395 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89CA4CD5BBD for ; Tue, 19 Sep 2023 13:32:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232388AbjISNcc (ORCPT ); Tue, 19 Sep 2023 09:32:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232359AbjISNcZ (ORCPT ); Tue, 19 Sep 2023 09:32:25 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F16F912F for ; Tue, 19 Sep 2023 06:32:18 -0700 (PDT) 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 1qiaps-0004pd-VI; Tue, 19 Sep 2023 15:32:17 +0200 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 1qiaps-007T4O-Ik; Tue, 19 Sep 2023 15:32:16 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiaps-0030fE-95; Tue, 19 Sep 2023 15:32:16 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 27/59] dma: moxart-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:35 +0200 Message-Id: <20230919133207.1400430-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1816; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=bqYSeygDthAQ/q4ws7NUTrBbEaJKVSKEzcasn4q5cN0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHNyXgjTX+3W35L7FIR+OQGIQD/RFbLeMqpG Q5gUC3QIUiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhzQAKCRCPgPtYfRL+ Th8BCACky83aEPs+bK/P6Vd328FE+YpB+k6sL7JR8CraBA6h4zkwCvHgQLIIEv/kWqLuKwYl6eM 9PTc7Um3GDeD2ahRS1uhVdI0th5o0Z8OqxzqDepI1s7+sdd6UPVdPyTQOi5BvE8CdJWaL4fycyR MpAicr7h0NFaF9WlqLQ6DWKFQnxULP8L4AN7aTmgOr2pw8Qyuv4zPAPZ/NQWt8TPeyne+HT+VmB 2fLKlzUeeOYXz+How95biTPs7GMlEJbaf4VTcd21a0ZS1v3Hi5NNMtNyossTz8CSacwIFjE4qH+ ZAfD0g6foy8uSE7gLBgTjVrXFOifTjzGnvfEu4PEYIuwqUco 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/moxart-dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c index 7565ad98ba66..a03953b3016b 100644 --- a/drivers/dma/moxart-dma.c +++ b/drivers/dma/moxart-dma.c @@ -630,7 +630,7 @@ static int moxart_probe(struct platform_device *pdev) return 0; } -static int moxart_remove(struct platform_device *pdev) +static void moxart_remove(struct platform_device *pdev) { struct moxart_dmadev *m = platform_get_drvdata(pdev); @@ -640,8 +640,6 @@ static int moxart_remove(struct platform_device *pdev) if (pdev->dev.of_node) of_dma_controller_free(pdev->dev.of_node); - - return 0; } static const struct of_device_id moxart_dma_match[] = { @@ -652,7 +650,7 @@ MODULE_DEVICE_TABLE(of, moxart_dma_match); static struct platform_driver moxart_driver = { .probe = moxart_probe, - .remove = moxart_remove, + .remove_new = moxart_remove, .driver = { .name = "moxart-dma-engine", .of_match_table = moxart_dma_match, From patchwork Tue Sep 19 13:31: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: 13391394 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14626CD5BBF for ; Tue, 19 Sep 2023 13:32:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232381AbjISNcb (ORCPT ); Tue, 19 Sep 2023 09:32:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232396AbjISNcZ (ORCPT ); Tue, 19 Sep 2023 09:32:25 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F18E1131 for ; Tue, 19 Sep 2023 06:32:18 -0700 (PDT) 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 1qiapt-0004q1-70; Tue, 19 Sep 2023 15:32:17 +0200 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 1qiaps-007T4S-Pd; Tue, 19 Sep 2023 15:32:16 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiaps-0030fI-GO; Tue, 19 Sep 2023 15:32:16 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 28/59] dma: mpc512x_dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:36 +0200 Message-Id: <20230919133207.1400430-29-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1857; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=PRoivkEtcfbuHE9ZbUxYJCJ+0aPuj5WKKjd+mLKUqKY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHOtukGsQkz/cwdt+X3iUevjRNq7bF2piFLG 3Yi7q65Pe6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmhzgAKCRCPgPtYfRL+ Tu2SCACm9XYiNzwMOIdeRLySHMDis1IcAC/GlhUXEaPaf80IY0tl3i2txX1cNKCdiR8WjdCVK6w sWIaPKL5qwxi/3Gy1ZtZMIvgkHpcKPwQPgKaSUDw2Vn8HBr0Ye1NTH6SonAkY7qcreJaDzXc00J V3RE0LGjOXAgJEk/aBp17VX7SmXOiZVsT7PmZ77pWx/uPxtUYX971N8fRHUT/ma6iBVexVDjoLP lLwcIMM7IdgWNvxqtAyxaTYKSqRIXip2AdynUTRCPAtl/MyXJWnboQPJovsUsyNgtaOPD+TkIEI OKPlx+e1DJOVRNVarefPtXh3eugv5cDK7Z93kpOyi4E+Mgj5 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/mpc512x_dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c index 1104017320b8..68c247a46321 100644 --- a/drivers/dma/mpc512x_dma.c +++ b/drivers/dma/mpc512x_dma.c @@ -1084,7 +1084,7 @@ static int mpc_dma_probe(struct platform_device *op) return retval; } -static int mpc_dma_remove(struct platform_device *op) +static void mpc_dma_remove(struct platform_device *op) { struct device *dev = &op->dev; struct mpc_dma *mdma = dev_get_drvdata(dev); @@ -1099,8 +1099,6 @@ static int mpc_dma_remove(struct platform_device *op) free_irq(mdma->irq, mdma); irq_dispose_mapping(mdma->irq); tasklet_kill(&mdma->tasklet); - - return 0; } static const struct of_device_id mpc_dma_match[] = { @@ -1112,7 +1110,7 @@ MODULE_DEVICE_TABLE(of, mpc_dma_match); static struct platform_driver mpc_dma_driver = { .probe = mpc_dma_probe, - .remove = mpc_dma_remove, + .remove_new = mpc_dma_remove, .driver = { .name = DRV_NAME, .of_match_table = mpc_dma_match, From patchwork Tue Sep 19 13:31: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: 13391396 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A44D9CD5BC1 for ; Tue, 19 Sep 2023 13:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232384AbjISNcd (ORCPT ); Tue, 19 Sep 2023 09:32:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232399AbjISNcZ (ORCPT ); Tue, 19 Sep 2023 09:32:25 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 547FA134 for ; Tue, 19 Sep 2023 06:32:19 -0700 (PDT) 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 1qiapt-0004s7-IN; Tue, 19 Sep 2023 15:32:17 +0200 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 1qiapt-007T4W-3T; Tue, 19 Sep 2023 15:32:17 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiaps-0030fM-Mm; Tue, 19 Sep 2023 15:32:16 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 29/59] dma: mv_xor_v2: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:37 +0200 Message-Id: <20230919133207.1400430-30-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1845; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Lir/2pWM6pJT+COkVu4De9PMrWTrkno4TIttFZrPsXc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHQ09/PAXDnFt1i0Ucup2gZnzsSx1jn3apFv CFV80uk3CeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh0AAKCRCPgPtYfRL+ TiH/B/9GoTZ2m3UFK2B4iWL+3ij5CID2pa3WutdiKrF+NrPYBHVl8hjUSxjW2SlH50xRwX3Bn12 ACj/rgCGAFKHBouJ+W8DAM8J6BnGuN5RlA1U62Hfqnm0mfdiWAfYsYZEFbFXQJ3m5z2cq+TdMDi YDBA6f415lZ7Zmr++uo5qmX3fiXw2GfUHziOnRrT049I5+eWzOVke6h8sUPVtLIz9iucPlbFz/X 8LAYKmIBUgrqznCdovfEtt3t7pu24A9rPm3Ml2qLwPfmypJV3+LhLM9OFsUH80HEEf9X3kP0JKJ QDwnk2BcRneYXOhCnEsa2idmDIoOR0O1ekO8Wt/lwD6lhuXY 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/mv_xor_v2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c index 0e1e9ca1c005..1ebfbe88e733 100644 --- a/drivers/dma/mv_xor_v2.c +++ b/drivers/dma/mv_xor_v2.c @@ -855,7 +855,7 @@ static int mv_xor_v2_probe(struct platform_device *pdev) return ret; } -static int mv_xor_v2_remove(struct platform_device *pdev) +static void mv_xor_v2_remove(struct platform_device *pdev) { struct mv_xor_v2_device *xor_dev = platform_get_drvdata(pdev); @@ -870,8 +870,6 @@ static int mv_xor_v2_remove(struct platform_device *pdev) platform_msi_domain_free_irqs(&pdev->dev); tasklet_kill(&xor_dev->irq_tasklet); - - return 0; } #ifdef CONFIG_OF @@ -886,7 +884,7 @@ static struct platform_driver mv_xor_v2_driver = { .probe = mv_xor_v2_probe, .suspend = mv_xor_v2_suspend, .resume = mv_xor_v2_resume, - .remove = mv_xor_v2_remove, + .remove_new = mv_xor_v2_remove, .driver = { .name = "mv_xor_v2", .of_match_table = of_match_ptr(mv_xor_v2_dt_ids), From patchwork Tue Sep 19 13:31:38 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: 13391399 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 603B4CD5BBF for ; Tue, 19 Sep 2023 13:32:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232411AbjISNcf (ORCPT ); Tue, 19 Sep 2023 09:32:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232406AbjISNc0 (ORCPT ); Tue, 19 Sep 2023 09:32:26 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A59F4F5 for ; Tue, 19 Sep 2023 06:32:19 -0700 (PDT) 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 1qiapt-0004tB-TG; Tue, 19 Sep 2023 15:32:17 +0200 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 1qiapt-007T4a-De; Tue, 19 Sep 2023 15:32:17 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapt-0030fQ-0s; Tue, 19 Sep 2023 15:32:17 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 30/59] dma: nbpfaxi: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:38 +0200 Message-Id: <20230919133207.1400430-31-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1795; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=takWHPj10cZzZ9nJ9ty/1Gp5zQm1g+jwqPCdtIsZr/k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHR8ifDkJbduFvOq/uwhTPeJ03l13NnHt2Bi 9xyN5D0ia2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh0QAKCRCPgPtYfRL+ Tsw6B/0YG/Tgg0HC+oJRWqmJtw0f3rajgF/4dH+3/KBlfE1YervWIgk9JfD2Q0uRckdGjMCGhuP iiLaV2IzFZR6QjWIMTWfshFqvpynDg35+0hggSY2SNGw5+qJ1cV/ccY8m5sFp6WTxJdRJblJPrB nyRoF3xSF7mGAelwwh7EzyEAqGRV/wtiHczJBeXtkQrR11yPrDClOXSLgE5aFUIm4xd6o8GkjjH kXifXI48ZdvRpxdaUy0fZcmujik8tdNddRY1LP2ABV22Jl1qeHyQnjTWIBkhpcLGJ71ZFIVaGpo FyzIVdDwoiAcg2Ry55jGvtgiUhoJxzXoMUPifskoopWDHNMS 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/nbpfaxi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c index 0b2f96fd8bf0..c08916339aa7 100644 --- a/drivers/dma/nbpfaxi.c +++ b/drivers/dma/nbpfaxi.c @@ -1454,7 +1454,7 @@ static int nbpf_probe(struct platform_device *pdev) return ret; } -static int nbpf_remove(struct platform_device *pdev) +static void nbpf_remove(struct platform_device *pdev) { struct nbpf_device *nbpf = platform_get_drvdata(pdev); int i; @@ -1472,8 +1472,6 @@ static int nbpf_remove(struct platform_device *pdev) of_dma_controller_free(pdev->dev.of_node); dma_async_device_unregister(&nbpf->dma_dev); clk_disable_unprepare(nbpf->clk); - - return 0; } static const struct platform_device_id nbpf_ids[] = { @@ -1517,7 +1515,7 @@ static struct platform_driver nbpf_driver = { }, .id_table = nbpf_ids, .probe = nbpf_probe, - .remove = nbpf_remove, + .remove_new = nbpf_remove, }; module_platform_driver(nbpf_driver); From patchwork Tue Sep 19 13:31:39 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: 13391406 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81989CD5BC7 for ; Tue, 19 Sep 2023 13:32:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232398AbjISNci (ORCPT ); Tue, 19 Sep 2023 09:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232401AbjISNca (ORCPT ); Tue, 19 Sep 2023 09:32:30 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C101F7 for ; Tue, 19 Sep 2023 06:32:24 -0700 (PDT) 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 1qiapu-0004vU-EJ; Tue, 19 Sep 2023 15:32:18 +0200 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 1qiapt-007T4f-OT; Tue, 19 Sep 2023 15:32:17 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapt-0030fU-Aj; Tue, 19 Sep 2023 15:32:17 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 31/59] dma: owl-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:39 +0200 Message-Id: <20230919133207.1400430-32-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1684; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oOZXmk+cA7NyUUQsE5sqJFm+83NftNjhIquYm4zw3ns=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTOhZdE/hwvv2pv2n7SS8ez9kyTdYDhgzn9bvJ55yV4s /qFQ7I6GY1ZGBi5GGTFFFnsG9dkWlXJRXau/XcZZhArE8gUBi5OAZhIdzL7f7eGGtEaj3xxXTMe V8E95/ZrZJZaH7zK4V9/2Klx5fq2PRG2p776FU6anqg3v1O2Q1aM7ZG3aLRAb6d9l8yzpyZ7Jxr NX1r6x8P+iMcl4wkyTuLcmXoPl60TOif0/YOzbcnkx/s/zfZxuZA9dX+aycH5z59O/3Qh+pmGTl dsRa512bxrDG1qQkwsvGGWz8sqfs+oyH5oEvNvlVsYL0fKy5UKzvrBLBInbm48XhBwxlRJgj8vk 0GdIVO/V+ruqvBuw+c3XpXl3Fohv/Mdl3xuT/b3nBmbI20Tk/s8Jm+vVnQ1ZMx/2RR2eHN10O8J XY79GSZ5nL/MtAubuy/ph5nu+LD5yIXUN3oNqmXTnwIA 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/owl-dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c index 384476757c5e..4e76c4ec2d39 100644 --- a/drivers/dma/owl-dma.c +++ b/drivers/dma/owl-dma.c @@ -1231,7 +1231,7 @@ static int owl_dma_probe(struct platform_device *pdev) return ret; } -static int owl_dma_remove(struct platform_device *pdev) +static void owl_dma_remove(struct platform_device *pdev) { struct owl_dma *od = platform_get_drvdata(pdev); @@ -1248,13 +1248,11 @@ static int owl_dma_remove(struct platform_device *pdev) clk_disable_unprepare(od->clk); dma_pool_destroy(od->lli_pool); - - return 0; } static struct platform_driver owl_dma_driver = { .probe = owl_dma_probe, - .remove = owl_dma_remove, + .remove_new = owl_dma_remove, .driver = { .name = "dma-owl", .of_match_table = of_match_ptr(owl_dma_match), From patchwork Tue Sep 19 13:31:40 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: 13391418 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60C0ACD5BBD for ; Tue, 19 Sep 2023 13:32:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232380AbjISNcp (ORCPT ); Tue, 19 Sep 2023 09:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232403AbjISNcg (ORCPT ); Tue, 19 Sep 2023 09:32:36 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CADE812B for ; Tue, 19 Sep 2023 06:32:29 -0700 (PDT) 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 1qiapu-0004x8-ON; Tue, 19 Sep 2023 15:32:18 +0200 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 1qiapt-007T4i-V0; Tue, 19 Sep 2023 15:32:17 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapt-0030fY-LZ; Tue, 19 Sep 2023 15:32:17 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: ye xingchen , Rob Herring , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 32/59] dma: ppc4xx: adma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:40 +0200 Message-Id: <20230919133207.1400430-33-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1988; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nsAdusj5aYvPL6Xrpokl/tz2ob6tdpRyWRuJFliBCS4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHT4uwi3P85zWuppooSvKRsZik2GRxgKpGYG JOKpn7S0/WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh0wAKCRCPgPtYfRL+ TsMsB/9Hk5bEfuRf64VGwFE0HBcj5+8MEHjUbu83bihzx2ff4k00YvgU3fS8eumDrqV6lQD6vmB 6oZLyh1qJcIkqkHB3v+cmEQ883jz37ZNZiyJjAo5E1PW7936t7pJRlb+ioLeGkNYi+AnIUampW/ zxpeWDhYhYZwP4CfJ4wMPlumq89lZWo9UFfeIfDZnqh1H2FvrD3qrxkW0qEgJjyE+DXp9w84hRp eJdcxZk2Ae7gUiqfQJ6Fuz5+roDcVZl7tNlrpnUVt+NJekEA8Os5/KrbcYFJ2V0VJjfAPqFt9Bm uf+Bwu6aLOx/bagD2g75HybKFotYvCnHyUxi4UGiwxjJmQV/ 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/ppc4xx/adma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c index f9b82dff3387..bbb60a970dab 100644 --- a/drivers/dma/ppc4xx/adma.c +++ b/drivers/dma/ppc4xx/adma.c @@ -4230,7 +4230,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev) /** * ppc440spe_adma_remove - remove the asynch device */ -static int ppc440spe_adma_remove(struct platform_device *ofdev) +static void ppc440spe_adma_remove(struct platform_device *ofdev) { struct ppc440spe_adma_device *adev = platform_get_drvdata(ofdev); struct device_node *np = ofdev->dev.of_node; @@ -4278,7 +4278,6 @@ static int ppc440spe_adma_remove(struct platform_device *ofdev) of_address_to_resource(np, 0, &res); release_mem_region(res.start, resource_size(&res)); kfree(adev); - return 0; } /* @@ -4550,7 +4549,7 @@ MODULE_DEVICE_TABLE(of, ppc440spe_adma_of_match); static struct platform_driver ppc440spe_adma_driver = { .probe = ppc440spe_adma_probe, - .remove = ppc440spe_adma_remove, + .remove_new = ppc440spe_adma_remove, .driver = { .name = "PPC440SP(E)-ADMA", .of_match_table = ppc440spe_adma_of_match, From patchwork Tue Sep 19 13:31:41 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: 13391422 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF4F6CD5BC5 for ; Tue, 19 Sep 2023 13:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232422AbjISNcq (ORCPT ); Tue, 19 Sep 2023 09:32:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232412AbjISNch (ORCPT ); Tue, 19 Sep 2023 09:32:37 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F52F123 for ; Tue, 19 Sep 2023 06:32:31 -0700 (PDT) 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 1qiapu-0004yP-Vj; Tue, 19 Sep 2023 15:32:18 +0200 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 1qiapu-007T4m-4g; Tue, 19 Sep 2023 15:32:18 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapt-0030fb-RU; Tue, 19 Sep 2023 15:32:17 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 33/59] dma: pxa_dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:41 +0200 Message-Id: <20230919133207.1400430-34-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1670; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cZkPNZ4w9JL9VC7qtGIA7/wdht7yiqOk4Uw2lbPQNjI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHUlWUwXBTZouyzvrRusl3ojNr0iLSzd7Xpd H2TJLnzzHWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh1AAKCRCPgPtYfRL+ Tr6OCACMlGLPCZkhol0eZZ63icgXdmmkuGAbL5JOVUP0rsjQZ+j78T/SJd3f+z/ghA7jiKyDV34 J6PmUVUYy3/e4WoF7SBvE5xa5yuoQB+AQRD2kSpL64LbhZuv4agt9R0lrSL2cT73kqPWoWVs+6d alEt6J6+swTyHSrJNiQup3PXnIaY2eQ/W15RZNtfDS1/bC8HaYlx+AqZMhMAy3UvjhrGPjKlB/k EVl17nS4YklccyKLAjTzHwmOiKO+5D/S60laSfZB2UBAmF2elGgIRKY3bBPzRmSx1j3k2N6ZYzD aSZ6KEPXMIJCL8iiJvk5fW/BXNM/Eo6bX6Y+FkoS6n6YFKco 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/pxa_dma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index 1b046d9a3a26..3c574dc0613b 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -1221,13 +1221,12 @@ static void pxad_free_channels(struct dma_device *dmadev) } } -static int pxad_remove(struct platform_device *op) +static void pxad_remove(struct platform_device *op) { struct pxad_device *pdev = platform_get_drvdata(op); pxad_cleanup_debugfs(pdev); pxad_free_channels(&pdev->slave); - return 0; } static int pxad_init_phys(struct platform_device *op, @@ -1444,7 +1443,7 @@ static struct platform_driver pxad_driver = { }, .id_table = pxad_id_table, .probe = pxad_probe, - .remove = pxad_remove, + .remove_new = pxad_remove, }; static bool pxad_filter_fn(struct dma_chan *chan, void *param) From patchwork Tue Sep 19 13:31:42 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: 13391416 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F380CD5BC1 for ; Tue, 19 Sep 2023 13:32:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232409AbjISNco (ORCPT ); Tue, 19 Sep 2023 09:32:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232390AbjISNcg (ORCPT ); Tue, 19 Sep 2023 09:32:36 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6835122 for ; Tue, 19 Sep 2023 06:32:29 -0700 (PDT) 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 1qiapw-00050U-3h; Tue, 19 Sep 2023 15:32:20 +0200 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 1qiapu-007T4p-Dl; Tue, 19 Sep 2023 15:32:18 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapu-0030fg-4L; Tue, 19 Sep 2023 15:32:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 34/59] dma: qcom: bam_dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:42 +0200 Message-Id: <20230919133207.1400430-35-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1850; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0cAcvIAz+mB1p4VR0D7nAMhLTtA7jGJNOdsv/F0fQRE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHVzkM8GSSJ0ZA+qd+Jl1+D7+2iYGUCHOUss CcKSudxtT6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh1QAKCRCPgPtYfRL+ ThfiB/wIDZTgqESs7NT+Jb2r4vv5CL8wulWPFEgFX5tHuoC3DK7bonuDMe08VwFFeat+pDK8xlW lNMr2JmIQIQwUkxHagaSkatls9dLasDjjD1a2oumP73h1Ypck4+2uoOfj6Mr4Y95nasyBG0wiGM TfuptJdqVaWJ7CjPNwZddqNFUE+9TjMZtJxUaLuBXDu36iNbnAAqWv5trd8Sn8S879JPWDZa8RR Cs7haiSNBKy08NzC25X5n4brTqMf6BhaU4Dxlyxg6g4XMA5IW627z7Ftwk1tAoEeqsN7MfSyGR7 qjR1K1zT2EuFOO20KXxflJLfNkz3bg4pHSu2MMlmiwNCwRMV 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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: Konrad Dybcio --- drivers/dma/qcom/bam_dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index 4c3eb972039d..c4f8d17d0c68 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -1386,7 +1386,7 @@ static int bam_dma_probe(struct platform_device *pdev) return ret; } -static int bam_dma_remove(struct platform_device *pdev) +static void bam_dma_remove(struct platform_device *pdev) { struct bam_device *bdev = platform_get_drvdata(pdev); u32 i; @@ -1416,8 +1416,6 @@ static int bam_dma_remove(struct platform_device *pdev) tasklet_kill(&bdev->task); clk_disable_unprepare(bdev->bamclk); - - return 0; } static int __maybe_unused bam_dma_runtime_suspend(struct device *dev) @@ -1475,7 +1473,7 @@ static const struct dev_pm_ops bam_dma_pm_ops = { static struct platform_driver bam_dma_driver = { .probe = bam_dma_probe, - .remove = bam_dma_remove, + .remove_new = bam_dma_remove, .driver = { .name = "bam-dma-engine", .pm = &bam_dma_pm_ops, From patchwork Tue Sep 19 13:31:43 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: 13391434 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91B22CD5BC0 for ; Tue, 19 Sep 2023 13:32:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232425AbjISNcw (ORCPT ); Tue, 19 Sep 2023 09:32:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232406AbjISNcl (ORCPT ); Tue, 19 Sep 2023 09:32:41 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CD98FB for ; Tue, 19 Sep 2023 06:32:34 -0700 (PDT) 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 1qiapw-00051x-6x; Tue, 19 Sep 2023 15:32:20 +0200 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 1qiapu-007T4t-K8; Tue, 19 Sep 2023 15:32:18 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapu-0030fk-At; Tue, 19 Sep 2023 15:32:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Sinan Kaya , Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 35/59] dma: qcom: hidma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:43 +0200 Message-Id: <20230919133207.1400430-36-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1806; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=P6otLyS2DqtXyKK4usj/EupHT4UWFzluyg14384Vi8o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHXmH7Kwduc3bm/Jp1m9aLSYirQ7vkttOswU UmbQjFnjV+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh1wAKCRCPgPtYfRL+ ThRTCAC2bEELW3W8JE2Sl8xkyJA6QVT82KJemptgx68auQLPL4i7xoC0oriOAkyajZfJVxQozw3 dFmPlhDkoQSkZi5iglrEU5cMrWerWgAljq65mHapAaR/AJDYD8Q/d9b1lCGGwuOSaM0CaIO2Rh7 +F3l3oCI0815jwqiZk7PbUcKZkjPbRqaljDh1XeIb10LdAK7IDeBKG6vFWdGvEmq8lf0lCMXEN+ O3d0l6Oi3Wo2Qdm94sLrF2jmCfApS41l0BC0pPcov56X57gKQhG3WDSCKI2ag6Zp8KHfrJrfH5F BSP6xbpodDTjaYFAIUmRnYPTcpFYkjeFKy5Vd3zE6NnyTveN 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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: Konrad Dybcio --- drivers/dma/qcom/hidma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c index 834ae519c15d..f4659553945b 100644 --- a/drivers/dma/qcom/hidma.c +++ b/drivers/dma/qcom/hidma.c @@ -915,7 +915,7 @@ static void hidma_shutdown(struct platform_device *pdev) } -static int hidma_remove(struct platform_device *pdev) +static void hidma_remove(struct platform_device *pdev) { struct hidma_dev *dmadev = platform_get_drvdata(pdev); @@ -935,8 +935,6 @@ static int hidma_remove(struct platform_device *pdev) dev_info(&pdev->dev, "HI-DMA engine removed\n"); pm_runtime_put_sync_suspend(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } #if IS_ENABLED(CONFIG_ACPI) @@ -960,7 +958,7 @@ MODULE_DEVICE_TABLE(of, hidma_match); static struct platform_driver hidma_driver = { .probe = hidma_probe, - .remove = hidma_remove, + .remove_new = hidma_remove, .shutdown = hidma_shutdown, .driver = { .name = "hidma", From patchwork Tue Sep 19 13:31:44 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: 13391425 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88A60CD5BBD for ; Tue, 19 Sep 2023 13:32:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232428AbjISNcs (ORCPT ); Tue, 19 Sep 2023 09:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232286AbjISNci (ORCPT ); Tue, 19 Sep 2023 09:32:38 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 140E1128 for ; Tue, 19 Sep 2023 06:32:32 -0700 (PDT) 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 1qiapw-00053f-Ij; Tue, 19 Sep 2023 15:32:20 +0200 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 1qiapu-007T4w-Qa; Tue, 19 Sep 2023 15:32:18 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapu-0030fo-HE; Tue, 19 Sep 2023 15:32:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 36/59] dma: qcom: qcom_adm: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:44 +0200 Message-Id: <20230919133207.1400430-37-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1861; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=MTHxMVOKj0c5e8s0Wrd0Yn3TaQHw/1jODqrJpVqwjPA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHYImy6GB6sJinxFG9tw1qyO9ufCht1F+ARl Dc7gOpD0rqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh2AAKCRCPgPtYfRL+ TrsaB/wIsrOJnCPHFsjVpLmU1/zLdUIKIG1cCmwf+CcZDJqkbghT0BwChEtyUDkcu4XMRS6wX7L zAlu3qeJJp7brZmHlPzSwgalSaY+XT9uv8+sozfHbpToTDPTN2EUWh4ZeLvRppDRsJyimItsrSq QsSnKgke661Ipaa6cU2euWzoC/u99jaXwt/GRkjUkMv42a/GKYpaKnBOULEWDreO9rFPpbDFVc3 c2KO5gafaTxIXy3Rnbn2hY9Y+dphbiXWKhhyL+YP7F+KuQRcqs/SkaFJ6jLA1SPfRf6ec/fPjS7 a3SIh+idPa+DOQiszsAaHsshgLWKqFzVUa51oY2MNVh4X4bl 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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: Konrad Dybcio --- drivers/dma/qcom/qcom_adm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/qcom/qcom_adm.c b/drivers/dma/qcom/qcom_adm.c index d56caf1681ff..53f4273b657c 100644 --- a/drivers/dma/qcom/qcom_adm.c +++ b/drivers/dma/qcom/qcom_adm.c @@ -904,7 +904,7 @@ static int adm_dma_probe(struct platform_device *pdev) return ret; } -static int adm_dma_remove(struct platform_device *pdev) +static void adm_dma_remove(struct platform_device *pdev) { struct adm_device *adev = platform_get_drvdata(pdev); struct adm_chan *achan; @@ -927,8 +927,6 @@ static int adm_dma_remove(struct platform_device *pdev) clk_disable_unprepare(adev->core_clk); clk_disable_unprepare(adev->iface_clk); - - return 0; } static const struct of_device_id adm_of_match[] = { @@ -939,7 +937,7 @@ MODULE_DEVICE_TABLE(of, adm_of_match); static struct platform_driver adm_dma_driver = { .probe = adm_dma_probe, - .remove = adm_dma_remove, + .remove_new = adm_dma_remove, .driver = { .name = "adm-dma-engine", .of_match_table = adm_of_match, From patchwork Tue Sep 19 13:31:45 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: 13391407 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 272DACD5BC0 for ; Tue, 19 Sep 2023 13:32:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232401AbjISNci (ORCPT ); Tue, 19 Sep 2023 09:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232400AbjISNca (ORCPT ); Tue, 19 Sep 2023 09:32:30 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D535FB for ; Tue, 19 Sep 2023 06:32:24 -0700 (PDT) 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 1qiapw-00054x-K8; Tue, 19 Sep 2023 15:32:20 +0200 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 1qiapv-007T50-02; Tue, 19 Sep 2023 15:32:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapu-0030fr-NA; Tue, 19 Sep 2023 15:32:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 37/59] dma: sa11x0-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:45 +0200 Message-Id: <20230919133207.1400430-38-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1812; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=GAyk3hyimkSYenbksbwYOpwaMajyz0JdjA4JLJvF+qw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHZ7hGGTk7W0scPlbjFiOPGVWs+ttk57cZUV URzrHZ9VFCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh2QAKCRCPgPtYfRL+ TiRpB/9Xe4pnwJciwn285zEEPeyfmb57woqf6DCcTXEnKVLhjheiLw9UOzGEVCy0R/qh9MatEoP 9xgLkD3B04fpS4DgkEd+/nZkx9rdKXUPmCsGXRvEpFqCN+72Nh7UX90spoUdVfYv2h/lVR/YxPI okciSxegTeNeAftC1y/Z+y0Xw2jscg0YS+uDSlpswb4DgEEi/fynuTfKAYXOT1RwgcOp7KEelnD UwoQhIhhWbFHrWHMjPAlPz8km2876fGhX3QmxshR7Il5mM5OMWXIrHBaf+cTjOXYOUpxXIkTdoc 0JgMIHU4uFMHGM197Z+0pSQJ2sWQrsGJ55WuTfZQKltewbvJ 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/sa11x0-dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sa11x0-dma.c b/drivers/dma/sa11x0-dma.c index a29c13cae716..488408e6826a 100644 --- a/drivers/dma/sa11x0-dma.c +++ b/drivers/dma/sa11x0-dma.c @@ -984,7 +984,7 @@ static int sa11x0_dma_probe(struct platform_device *pdev) return ret; } -static int sa11x0_dma_remove(struct platform_device *pdev) +static void sa11x0_dma_remove(struct platform_device *pdev) { struct sa11x0_dma_dev *d = platform_get_drvdata(pdev); unsigned pch; @@ -997,8 +997,6 @@ static int sa11x0_dma_remove(struct platform_device *pdev) tasklet_kill(&d->task); iounmap(d->base); kfree(d); - - return 0; } static __maybe_unused int sa11x0_dma_suspend(struct device *dev) @@ -1081,7 +1079,7 @@ static struct platform_driver sa11x0_dma_driver = { .pm = &sa11x0_dma_pm_ops, }, .probe = sa11x0_dma_probe, - .remove = sa11x0_dma_remove, + .remove_new = sa11x0_dma_remove, }; static int __init sa11x0_dma_init(void) From patchwork Tue Sep 19 13:31:46 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: 13391408 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B963ACD5BBD for ; Tue, 19 Sep 2023 13:32:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232400AbjISNcj (ORCPT ); Tue, 19 Sep 2023 09:32:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232392AbjISNcb (ORCPT ); Tue, 19 Sep 2023 09:32:31 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB9A7100 for ; Tue, 19 Sep 2023 06:32:25 -0700 (PDT) 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 1qiapw-000567-U0; Tue, 19 Sep 2023 15:32:21 +0200 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 1qiapv-007T54-6f; Tue, 19 Sep 2023 15:32:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapu-0030fw-U1; Tue, 19 Sep 2023 15:32:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Green Wan , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 38/59] dma: sf-pdma: sf-pdma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:46 +0200 Message-Id: <20230919133207.1400430-39-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1837; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=X9L+fQGB2a2TQpTdPeTCssyhoZqjmVNipmC+ryvry+0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHaDpg6fzmNVZZQ+e+9V2C1r0CidRsamSAoh QpJNX/OCYeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh2gAKCRCPgPtYfRL+ Tq36B/sFP97CeTpCDrBWqdh/WERADkXEyfHDdLlFQG428zoMLVx/GUhR0DiT0fBBm4+3fXymbzc VmuNQb1/MSwB1VleVAKgABG19VF7yF08NaJXPBEgT/GOS1q4m9Ifq2gCE87n6DLmujmKuOYNqDQ Pe/1MW5kyAiJDlNzUkjJt2N1n6G1Cv1WedF1M+BJRzZZmk6N3gpq5DcSjt4oG50jIRG+JDYzkJB G5hustO3o/QuMgP4f1X2k5M4V25Sj5MXQiGPZCHVRzIzbOfFVbzsWSGg8bcTSQD6kAvnQ3ejLu6 yyf5DFY8t2RRBZ5Bqo7vVW7oLjBOobcTB/jjaJCGpmz4493P 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/sf-pdma/sf-pdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sf-pdma/sf-pdma.c b/drivers/dma/sf-pdma/sf-pdma.c index d1c6956af452..3125a2f162b4 100644 --- a/drivers/dma/sf-pdma/sf-pdma.c +++ b/drivers/dma/sf-pdma/sf-pdma.c @@ -566,7 +566,7 @@ static int sf_pdma_probe(struct platform_device *pdev) return 0; } -static int sf_pdma_remove(struct platform_device *pdev) +static void sf_pdma_remove(struct platform_device *pdev) { struct sf_pdma *pdma = platform_get_drvdata(pdev); struct sf_pdma_chan *ch; @@ -584,8 +584,6 @@ static int sf_pdma_remove(struct platform_device *pdev) } dma_async_device_unregister(&pdma->dma_dev); - - return 0; } static const struct of_device_id sf_pdma_dt_ids[] = { @@ -597,7 +595,7 @@ MODULE_DEVICE_TABLE(of, sf_pdma_dt_ids); static struct platform_driver sf_pdma_driver = { .probe = sf_pdma_probe, - .remove = sf_pdma_remove, + .remove_new = sf_pdma_remove, .driver = { .name = "sf-pdma", .of_match_table = sf_pdma_dt_ids, From patchwork Tue Sep 19 13:31:47 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: 13391410 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0ADFCD5BC2 for ; Tue, 19 Sep 2023 13:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232443AbjISNck (ORCPT ); Tue, 19 Sep 2023 09:32:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232399AbjISNcd (ORCPT ); Tue, 19 Sep 2023 09:32:33 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13311100 for ; Tue, 19 Sep 2023 06:32:28 -0700 (PDT) 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 1qiapx-000575-2D; Tue, 19 Sep 2023 15:32:21 +0200 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 1qiapv-007T57-D6; Tue, 19 Sep 2023 15:32:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapv-0030g0-3v; Tue, 19 Sep 2023 15:32:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Kees Cook , "Gustavo A. R. Silva" , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 39/59] dma: sh: rcar-dmac: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:47 +0200 Message-Id: <20230919133207.1400430-40-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1825; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=czlgMS1A0e/2ND5H4loot1SC9OAsE3RXu9tC94tqfjA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHbWY5QJDz9MGEdNcceIKTjoAFtvwOpLsCqL vENncm5svqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh2wAKCRCPgPtYfRL+ TmIvB/4qniJw6K+tq2+/Fi2t1Pvq70yq5L37MMWvFsKKX0nMIUgF9zXFoEGxTShdciNwqhmjD/y NI+7mfEbMky/bJQkVUqyCzXRSLSTc1Ssc/vqzzY2+CFULYquKImQ0xlKCuBY1YR20B9lO+j+7+W rN3w2bCjnaYTcNmNX39mmE8P43/47HiZeMnpS6dGEfV2hV2JbuILR23SwR4gfyJLfqKhEGv+Cdl bryQkVj4lwKzBLo6KglzgJtIvBcCeLF0WUI5OKPd2+qKfubY2s61vnOSRSesFWBqBPzgFFtWBnh OG0MSJB25xmQqrd5RkM9TLVdP+4Cg5MJ6CDQv+nw6w9wLi4F 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/sh/rcar-dmac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 641d689d17ff..40482cb73d79 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -1990,7 +1990,7 @@ static int rcar_dmac_probe(struct platform_device *pdev) return ret; } -static int rcar_dmac_remove(struct platform_device *pdev) +static void rcar_dmac_remove(struct platform_device *pdev) { struct rcar_dmac *dmac = platform_get_drvdata(pdev); @@ -1998,8 +1998,6 @@ static int rcar_dmac_remove(struct platform_device *pdev) dma_async_device_unregister(&dmac->engine); pm_runtime_disable(&pdev->dev); - - return 0; } static void rcar_dmac_shutdown(struct platform_device *pdev) @@ -2041,7 +2039,7 @@ static struct platform_driver rcar_dmac_driver = { .of_match_table = rcar_dmac_of_ids, }, .probe = rcar_dmac_probe, - .remove = rcar_dmac_remove, + .remove_new = rcar_dmac_remove, .shutdown = rcar_dmac_shutdown, }; From patchwork Tue Sep 19 13:31:48 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: 13391429 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 651A0CD5BC8 for ; Tue, 19 Sep 2023 13:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232445AbjISNcu (ORCPT ); Tue, 19 Sep 2023 09:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232438AbjISNck (ORCPT ); Tue, 19 Sep 2023 09:32:40 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD43C134 for ; Tue, 19 Sep 2023 06:32:32 -0700 (PDT) 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 1qiapx-00058Q-7N; Tue, 19 Sep 2023 15:32:21 +0200 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 1qiapv-007T5A-Ka; Tue, 19 Sep 2023 15:32:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapv-0030g4-B2; Tue, 19 Sep 2023 15:32:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Biju Das , Geert Uytterhoeven , Lad Prabhakar , Pavel Machek , Hien Huynh , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 40/59] dma: sh: rz-dmac: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:48 +0200 Message-Id: <20230919133207.1400430-41-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1829; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=tnDkyZi5NmaUHcTC0eDvISGVXJeLAI2z22myyberCMI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHdUrdpeiFaBrv61kkg+jMsQAcMPovs/55KD ojfkUyou2SJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh3QAKCRCPgPtYfRL+ TvB7B/9eE8iIF5QTVny1r3W+zrVvBFWvhfBBnXN8By+Glt3p0TfDzz2QLNd4mrLGTg3140hKPPY 0WDZt2K2x9pMXQjdRYI/xWKBC1BaRM1FQpqxNybY/DyjG8GrSzQij0rdVsJRj7fDX0ojqSYNraV M9au0CgnbXK7SA9opvYdPdFsNjIcSzXETxPWRBGcvejkLf1bwfeDsh4yJyenMURbvmIFqvhw0b7 x7/pvohAHj9bq8xMGDIXjsZLxgTtjOsXKtISo64y1sHp8Nl6VQ0kKcpDzjIe+L0l5SDt0s64AuP 8HFEfduB6VimJsC8DXp+VknIEWqZSGbh5pqcuwdp3eqDS4md 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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: Geert Uytterhoeven --- drivers/dma/sh/rz-dmac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index f777addda8ba..fea5bda34bc2 100644 --- a/drivers/dma/sh/rz-dmac.c +++ b/drivers/dma/sh/rz-dmac.c @@ -969,7 +969,7 @@ static int rz_dmac_probe(struct platform_device *pdev) return ret; } -static int rz_dmac_remove(struct platform_device *pdev) +static void rz_dmac_remove(struct platform_device *pdev) { struct rz_dmac *dmac = platform_get_drvdata(pdev); unsigned int i; @@ -987,8 +987,6 @@ static int rz_dmac_remove(struct platform_device *pdev) reset_control_assert(dmac->rstc); pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id of_rz_dmac_match[] = { @@ -1003,7 +1001,7 @@ static struct platform_driver rz_dmac_driver = { .of_match_table = of_rz_dmac_match, }, .probe = rz_dmac_probe, - .remove = rz_dmac_remove, + .remove_new = rz_dmac_remove, }; module_platform_driver(rz_dmac_driver); From patchwork Tue Sep 19 13:31:49 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: 13391413 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83748CD5BBD for ; Tue, 19 Sep 2023 13:32:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232410AbjISNcm (ORCPT ); Tue, 19 Sep 2023 09:32:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232415AbjISNcf (ORCPT ); Tue, 19 Sep 2023 09:32:35 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDCB4FB for ; Tue, 19 Sep 2023 06:32:29 -0700 (PDT) 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 1qiapx-00059Q-8J; Tue, 19 Sep 2023 15:32:21 +0200 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 1qiapv-007T5D-QF; Tue, 19 Sep 2023 15:32:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapv-0030g8-Gz; Tue, 19 Sep 2023 15:32:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Yangtao Li , Rob Herring , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 41/59] dma: sh: shdmac: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:49 +0200 Message-Id: <20230919133207.1400430-42-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1804; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rYNJ/hyDPKAyxl8y9sj/oFox4EIyWt191HYFVPvevUo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHe9KOGQPfiseO563h2MdG9z6ZCAA2u69jlM cigCNDjs2WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh3gAKCRCPgPtYfRL+ TuyQCAC78KvEpsXczqdfmSjF/eUFE7WN8b/U4QTcCLoWqIWSUC/6suYtJlow2CylcGpEwJ9DF7S RSyEtP65ecUHjRfo3vg1e4QCCjrQ+KQouHVzMaY1c6c46Un1GNMFGSYoGNKonM9cLb9Mh/9fCYC PDXBvfwb8i/MmBcwwDKXBvwVYZurEEty035XDAGmHLad65LDk1eVwWUDRxjuJ/scaejc1tjPgk1 44ONwQC8gCBM/rz+PG1wWoGOfziGM5O1gMsF0D+oXa6uykbcgXPgIVTaOJ4GLlBXnesmhi+M0Y7 SpY+ubbt9dYXjeMYjOOH7m9YvK5q9W6LvY7gGKYRVZ3+GsdS 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/sh/shdmac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c index 00067b29e232..7cc9eb2217e8 100644 --- a/drivers/dma/sh/shdmac.c +++ b/drivers/dma/sh/shdmac.c @@ -882,7 +882,7 @@ static int sh_dmae_probe(struct platform_device *pdev) return err; } -static int sh_dmae_remove(struct platform_device *pdev) +static void sh_dmae_remove(struct platform_device *pdev) { struct sh_dmae_device *shdev = platform_get_drvdata(pdev); struct dma_device *dma_dev = &shdev->shdma_dev.dma_dev; @@ -899,8 +899,6 @@ static int sh_dmae_remove(struct platform_device *pdev) shdma_cleanup(&shdev->shdma_dev); synchronize_rcu(); - - return 0; } static struct platform_driver sh_dmae_driver = { @@ -908,7 +906,7 @@ static struct platform_driver sh_dmae_driver = { .pm = &sh_dmae_pm, .name = SH_DMAE_DRV_NAME, }, - .remove = sh_dmae_remove, + .remove_new = sh_dmae_remove, }; static int __init sh_dmae_init(void) From patchwork Tue Sep 19 13:31:50 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: 13391411 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92D92CD5BC4 for ; Tue, 19 Sep 2023 13:32:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232433AbjISNcl (ORCPT ); Tue, 19 Sep 2023 09:32:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232396AbjISNce (ORCPT ); Tue, 19 Sep 2023 09:32:34 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D285B119 for ; Tue, 19 Sep 2023 06:32:28 -0700 (PDT) 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 1qiapx-0005AZ-Qf; Tue, 19 Sep 2023 15:32:22 +0200 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 1qiapw-007T5G-0n; Tue, 19 Sep 2023 15:32:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapv-0030gC-Na; Tue, 19 Sep 2023 15:32:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Peter Ujfalusi , Tudor Ambarus , Jernej Skrabec , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 42/59] dma: sh: usb-dmac: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:50 +0200 Message-Id: <20230919133207.1400430-43-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1842; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=a0thsDxu14TpYtSb5s2ZnW0vRGKQHvIIJBxsuxeu4II=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHfmuPZ2M3K6tkJKOUqSy8cY8xz0lbU6XVRm RJhGTb0Cx6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh3wAKCRCPgPtYfRL+ TkVwB/9sv9soRVOoJoK5CSfOQ8oEXLaOI0ZvAj7xxm5u5I0qL0sj9WjEJrFnWjYTFa1W1HJqkgL z1fWc35qFxAnNqtdGSzW2xtVGY9icTJzkYyp6abenhyhfLX/H+os3+q5K+RNx/rKMjlcbzPfvJQ zMBceE356kyaz19H9oO45GgC1jwDbS/uVlyEVp4AfWPajqsPCXlPKlNypyQ4Jm1z6UHhP6D088C LJyfdWYkKLMsfUkC4dP5CxRCenR3kJD8uNeypYQL57+2HRhZIjO1YncFjz8rYCAgddfjKT38eSv CjCLJZkHj/aMNlFRtrxtd5iiIVrrQjaq/Yqy0Dp8JRs+w+7c 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/sh/usb-dmac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sh/usb-dmac.c b/drivers/dma/sh/usb-dmac.c index b14cf350b669..d8c93faa424d 100644 --- a/drivers/dma/sh/usb-dmac.c +++ b/drivers/dma/sh/usb-dmac.c @@ -866,7 +866,7 @@ static void usb_dmac_chan_remove(struct usb_dmac *dmac, devm_free_irq(dmac->dev, uchan->irq, uchan); } -static int usb_dmac_remove(struct platform_device *pdev) +static void usb_dmac_remove(struct platform_device *pdev) { struct usb_dmac *dmac = platform_get_drvdata(pdev); int i; @@ -877,8 +877,6 @@ static int usb_dmac_remove(struct platform_device *pdev) dma_async_device_unregister(&dmac->engine); pm_runtime_disable(&pdev->dev); - - return 0; } static void usb_dmac_shutdown(struct platform_device *pdev) @@ -901,7 +899,7 @@ static struct platform_driver usb_dmac_driver = { .of_match_table = usb_dmac_of_ids, }, .probe = usb_dmac_probe, - .remove = usb_dmac_remove, + .remove_new = usb_dmac_remove, .shutdown = usb_dmac_shutdown, }; From patchwork Tue Sep 19 13:31:51 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: 13391428 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB4D1CD5BBF for ; Tue, 19 Sep 2023 13:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232427AbjISNct (ORCPT ); Tue, 19 Sep 2023 09:32:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232431AbjISNci (ORCPT ); Tue, 19 Sep 2023 09:32:38 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2602131 for ; Tue, 19 Sep 2023 06:32:31 -0700 (PDT) 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 1qiapx-0005By-QP; Tue, 19 Sep 2023 15:32:21 +0200 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 1qiapw-007T5J-6t; Tue, 19 Sep 2023 15:32:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapv-0030gG-Ts; Tue, 19 Sep 2023 15:32:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Orson Zhai , Baolin Wang , Chunyan Zhang , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 43/59] dma: sprd-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:51 +0200 Message-Id: <20230919133207.1400430-44-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1851; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VLMqnrQaM3pkJaqRiSQLo7cg0ca3HbzYkbAo4PQVlDQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHg3S+Rw27tH6Pj6Dc5pFdAooXxoZvV241Sp tAfoJK/zvSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh4AAKCRCPgPtYfRL+ TnqGCACIJW+tQCF6Qi9DDVdY1dFZ2M37nEbodFDOK5/unVtJtM96xAaSUQIAHD4QGkGv853mhcA Rww87H5XtTcbRSWx2bVPV5kajS7JAYSaA6WfVW6AARbuBG61chXwnFA1r+u7tMYEyCOF2mRY0CJ XfnZX4+HZ5MEaUqF8Rx0ht4lbFnfrXVbH8jKVOKMR5BausYLnEBu3H7qjuXkJAgOzKkfZ4tGpXN 6zVlnux5d/CP47zFxhm2AGIRENXtN1njv26mNKWulB25DCgjt2isxg9bzEhkv7iAzsT3lhH08/o iaKewsWJ84ezGaVFxK1IcXTEyrrVUpl5ig/jL2QiIm/6TnRU 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/sprd-dma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 168aa0bd73a0..97e3dedb6c12 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -1232,7 +1232,7 @@ static int sprd_dma_probe(struct platform_device *pdev) return ret; } -static int sprd_dma_remove(struct platform_device *pdev) +static void sprd_dma_remove(struct platform_device *pdev) { struct sprd_dma_dev *sdev = platform_get_drvdata(pdev); struct sprd_dma_chn *c, *cn; @@ -1255,7 +1255,6 @@ static int sprd_dma_remove(struct platform_device *pdev) pm_runtime_put_noidle(&pdev->dev); pm_runtime_disable(&pdev->dev); - return 0; } static const struct of_device_id sprd_dma_match[] = { @@ -1292,7 +1291,7 @@ static const struct dev_pm_ops sprd_dma_pm_ops = { static struct platform_driver sprd_dma_driver = { .probe = sprd_dma_probe, - .remove = sprd_dma_remove, + .remove_new = sprd_dma_remove, .driver = { .name = "sprd-dma", .of_match_table = sprd_dma_match, From patchwork Tue Sep 19 13:31: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: 13391412 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E46E9CD5BC0 for ; Tue, 19 Sep 2023 13:32:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232396AbjISNcl (ORCPT ); Tue, 19 Sep 2023 09:32:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232409AbjISNcf (ORCPT ); Tue, 19 Sep 2023 09:32:35 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0A76123 for ; Tue, 19 Sep 2023 06:32:28 -0700 (PDT) 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 1qiapx-0005DK-Mg; Tue, 19 Sep 2023 15:32:21 +0200 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 1qiapw-007T5O-GB; Tue, 19 Sep 2023 15:32:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapw-0030gJ-3c; Tue, 19 Sep 2023 15:32:20 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Patrice Chotard , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 44/59] dma: st_fdma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:52 +0200 Message-Id: <20230919133207.1400430-45-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1770; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=mLxlKUjXeKKBwDxG0klsa06EXs5EvAdx6DPXjRAOFo8=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTOhQ+3XBPzVvMp9a/6r2U14bZXaPbxlIRfYU+v10RNr WJ/Wx3VyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBELk7jYJgqk1IfuFynLUG4 htXt3gqV4OUv9ym8WjB3S/OT68JzI3ONP3y6nRqzw4Sd25Tv7Le9kS5vr5SqPItVKZ7Am9/8JDd r7t3oq5osktamxw6mPs25b69+aFnARO0fEuJs/4+pPAhx6/kTe6iuaIL9le06Vj55u/Xi56/37/ dJm7bg/P18yS0H3VQk1jXa/bMo9A1VWxpvoqlaNi2xon4m/97ixh3cNjOs7sU4l6V5vloU84Z9Y uTe2X4+E/gFPxlt/9vNobDurd+zGXcZVXXmnDQ3uN32cklWgmL96uo1zAxnJgjk3ZdVL5n1SCY1 OJFBszy18C772aLMuhY96XkLOK+/7LrKvThf0epG/cv/AA== 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/st_fdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c index d95c421877fb..145bd0f2496e 100644 --- a/drivers/dma/st_fdma.c +++ b/drivers/dma/st_fdma.c @@ -849,15 +849,13 @@ static int st_fdma_probe(struct platform_device *pdev) return ret; } -static int st_fdma_remove(struct platform_device *pdev) +static void st_fdma_remove(struct platform_device *pdev) { struct st_fdma_dev *fdev = platform_get_drvdata(pdev); devm_free_irq(&pdev->dev, fdev->irq, fdev); st_slim_rproc_put(fdev->slim_rproc); of_dma_controller_free(pdev->dev.of_node); - - return 0; } static struct platform_driver st_fdma_platform_driver = { @@ -866,7 +864,7 @@ static struct platform_driver st_fdma_platform_driver = { .of_match_table = st_fdma_match, }, .probe = st_fdma_probe, - .remove = st_fdma_remove, + .remove_new = st_fdma_remove, }; module_platform_driver(st_fdma_platform_driver); From patchwork Tue Sep 19 13:31:53 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: 13391421 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1BEDCD5BC4 for ; Tue, 19 Sep 2023 13:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232412AbjISNcr (ORCPT ); Tue, 19 Sep 2023 09:32:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232429AbjISNci (ORCPT ); Tue, 19 Sep 2023 09:32:38 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2060130 for ; Tue, 19 Sep 2023 06:32:31 -0700 (PDT) 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 1qiapy-0005ED-K6; Tue, 19 Sep 2023 15:32:22 +0200 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 1qiapw-007T5R-NT; Tue, 19 Sep 2023 15:32:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapw-0030gO-CT; Tue, 19 Sep 2023 15:32:20 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 45/59] dma: sun4i-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:53 +0200 Message-Id: <20230919133207.1400430-46-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1845; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=tdSrGzB1P3A08YWfYfl02UYCIKs62cLV6Iz/r1JsvCM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHjPLjFYT4hC+C8a2gKPED1g0kPoR7jQSlDn C5y+NPpRrOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh4wAKCRCPgPtYfRL+ TqZTCACwmoBJYTuOpE6rMjAY39Ol/EbQog2Gh/wBph6y0oQyt36ciOIOj0RPhqFlyo8j6T1mrYW zM0qHB1G9T1LmWvznb3w/OICbBw+mppPwSGUtt4AQ9YRkx2bGTMrrZJpaZYT4L0dI3Lv0powSBL E46buKhMdIcoglCp8wlzNZQ+hoq8vJLnUtiPtGiAv0bHHgYC2q1DbMSKGZUP6wxFoN411D0iKCc aXFXq/u2OCqdhDBZwFn/YpsgVA/47G7BvbIApMtaKsHJ+v2yDmBtHw/DdOYuZKFs1qar4A4IAIm oCIlR7MuVp1h4LEAwTI45p0iZI0PCsB1uB3YSBERALs4iLDc 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 Acked-by: Jernej Skrabec --- drivers/dma/sun4i-dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sun4i-dma.c b/drivers/dma/sun4i-dma.c index e86c8829513a..2e7f9b07fdd2 100644 --- a/drivers/dma/sun4i-dma.c +++ b/drivers/dma/sun4i-dma.c @@ -1271,7 +1271,7 @@ static int sun4i_dma_probe(struct platform_device *pdev) return ret; } -static int sun4i_dma_remove(struct platform_device *pdev) +static void sun4i_dma_remove(struct platform_device *pdev) { struct sun4i_dma_dev *priv = platform_get_drvdata(pdev); @@ -1282,8 +1282,6 @@ static int sun4i_dma_remove(struct platform_device *pdev) dma_async_device_unregister(&priv->slave); clk_disable_unprepare(priv->clk); - - return 0; } static const struct of_device_id sun4i_dma_match[] = { @@ -1294,7 +1292,7 @@ MODULE_DEVICE_TABLE(of, sun4i_dma_match); static struct platform_driver sun4i_dma_driver = { .probe = sun4i_dma_probe, - .remove = sun4i_dma_remove, + .remove_new = sun4i_dma_remove, .driver = { .name = "sun4i-dma", .of_match_table = sun4i_dma_match, From patchwork Tue Sep 19 13:31:54 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: 13391435 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70C16CD5BBF for ; Tue, 19 Sep 2023 13:32:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232437AbjISNcw (ORCPT ); Tue, 19 Sep 2023 09:32:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232444AbjISNcl (ORCPT ); Tue, 19 Sep 2023 09:32:41 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E541C137 for ; Tue, 19 Sep 2023 06:32:33 -0700 (PDT) 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 1qiapz-0005Eq-Lw; Tue, 19 Sep 2023 15:32:23 +0200 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 1qiapx-007T5W-5j; Tue, 19 Sep 2023 15:32:21 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapw-0030gS-OX; Tue, 19 Sep 2023 15:32:20 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 46/59] dma: sun6i-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:54 +0200 Message-Id: <20230919133207.1400430-47-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1700; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/KDvS+CXYRRVq7p2n6w+Wx6Yq0sSMi2c+ORHwPV0uNo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHkPUHsHPWjEpNduMX1j8W4MLRiqFHpyO4io mhewaVT8YaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh5AAKCRCPgPtYfRL+ TjsBCAC31HbQIkIhMyiAC2OJeHT6/KhgWA8G1/NQgesVSFxefAySIjH+4v9pxg+WStET7ATkjNf OHhkyTr1EHsTm6src/w4P9BWcK//gCwYbN4ifO17FqlZZsTcisJyRIWVmSLIqmDRUcgQ25MrIiu 1k/v27GSElDPzZSfoq0VeF0gcQZj1knIvz5ivIge3wPTf+OHwZWOmFUANqbbPmsomh/+GGm03YM B60BMHofQlo2izXqjMN0VyCMHJ+FFBC05/ZJyxwQM9K5DC+XMy+sudiD6e4AzvU2ZbdAxmu5ZFq phUxi8OvAbegwG8QC+Hr2u73zfMEH26sKgK+X/jKS214+iLA 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 Acked-by: Jernej Skrabec --- drivers/dma/sun6i-dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c index 2469efddf540..583bf49031cf 100644 --- a/drivers/dma/sun6i-dma.c +++ b/drivers/dma/sun6i-dma.c @@ -1470,7 +1470,7 @@ static int sun6i_dma_probe(struct platform_device *pdev) return ret; } -static int sun6i_dma_remove(struct platform_device *pdev) +static void sun6i_dma_remove(struct platform_device *pdev) { struct sun6i_dma_dev *sdc = platform_get_drvdata(pdev); @@ -1484,13 +1484,11 @@ static int sun6i_dma_remove(struct platform_device *pdev) reset_control_assert(sdc->rstc); sun6i_dma_free(sdc); - - return 0; } static struct platform_driver sun6i_dma_driver = { .probe = sun6i_dma_probe, - .remove = sun6i_dma_remove, + .remove_new = sun6i_dma_remove, .driver = { .name = "sun6i-dma", .of_match_table = sun6i_dma_match, From patchwork Tue Sep 19 13:31:55 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: 13391427 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A0C8CD5BC7 for ; Tue, 19 Sep 2023 13:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232426AbjISNct (ORCPT ); Tue, 19 Sep 2023 09:32:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232427AbjISNcj (ORCPT ); Tue, 19 Sep 2023 09:32:39 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 838FF132 for ; Tue, 19 Sep 2023 06:32:32 -0700 (PDT) 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 1qiapz-0005FI-HG; Tue, 19 Sep 2023 15:32:23 +0200 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 1qiapx-007T5Z-Ek; Tue, 19 Sep 2023 15:32:21 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapx-0030gW-5J; Tue, 19 Sep 2023 15:32:21 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Laxman Dewangan , Jon Hunter , Thierry Reding , dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 47/59] dma: tegra186-gpc-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:55 +0200 Message-Id: <20230919133207.1400430-48-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1790; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iHs4HlU8wdvJhxErQlTdc9ftb0/Pep+KtGw3IGGHh/0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHlSic1zq2Y2fiV9uSKVBoR8akw1xLuq3gVB Ps1amKPa+2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh5QAKCRCPgPtYfRL+ Tgu1CACIza9DIwjqTGbElojU4hUCj/puU1Aq47DSEOsjutLY1QTYl4pet1JOMkqnG38LiYLgY2Z MQvcHCMV5vU/5LNteyjsRT6khNkeqmcFJmH06NLvHEcEQZxqYGxy8R4jiMCmI7aowJU3FpHzV6N Jr00jeYGItOweyNjOATxpeh29Qsr+ihp7l1QMb7MrNCtla+2I35HMULplIN9q0gC6Nh3cOFwcla mAPwRcrq4D1FQmNVQQs7ckFY194V1Sw/cqZpikJ5Cx8I3KcEcHRL6bG2gA6qyJcf3OrwOwhi+sn o5ZuUUTslqwJw0/arFgpSI9Y7qsg0Tu3fSuU8cWYxEEZNbiH 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/tegra186-gpc-dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/tegra186-gpc-dma.c b/drivers/dma/tegra186-gpc-dma.c index 33b101001100..868c18cc72b1 100644 --- a/drivers/dma/tegra186-gpc-dma.c +++ b/drivers/dma/tegra186-gpc-dma.c @@ -1473,14 +1473,12 @@ static int tegra_dma_probe(struct platform_device *pdev) return 0; } -static int tegra_dma_remove(struct platform_device *pdev) +static void tegra_dma_remove(struct platform_device *pdev) { struct tegra_dma *tdma = platform_get_drvdata(pdev); of_dma_controller_free(pdev->dev.of_node); dma_async_device_unregister(&tdma->dma_dev); - - return 0; } static int __maybe_unused tegra_dma_pm_suspend(struct device *dev) @@ -1533,7 +1531,7 @@ static struct platform_driver tegra_dma_driver = { .of_match_table = tegra_dma_of_match, }, .probe = tegra_dma_probe, - .remove = tegra_dma_remove, + .remove_new = tegra_dma_remove, }; module_platform_driver(tegra_dma_driver); From patchwork Tue Sep 19 13:31:56 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: 13391426 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF13ECD5BC3 for ; Tue, 19 Sep 2023 13:32:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232286AbjISNcs (ORCPT ); Tue, 19 Sep 2023 09:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232426AbjISNcj (ORCPT ); Tue, 19 Sep 2023 09:32:39 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FACA12C for ; Tue, 19 Sep 2023 06:32:32 -0700 (PDT) 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 1qiapz-0005H3-TO; Tue, 19 Sep 2023 15:32:23 +0200 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 1qiapx-007T5g-Nj; Tue, 19 Sep 2023 15:32:21 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapx-0030ga-BN; Tue, 19 Sep 2023 15:32:21 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Laxman Dewangan , Jon Hunter , Thierry Reding , dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 48/59] dma: tegra20-apb-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:56 +0200 Message-Id: <20230919133207.1400430-49-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1895; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=p0YNfNQ6rouQIshDwy8m+PHxQVDwpmwbI3Nov3/BeKg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHmPBHdEjzWGISv2of5x1I1zzP3z3ZxeIr9d VobHEa/ZveJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh5gAKCRCPgPtYfRL+ TiexB/wN8AWTLCtkpJhI4/E5XP7DAQZay6Uj2FoPcfiY4HPZXfooQ8tf2bOEj28C55B1Q5rf8R+ NKqhZ+8eWlaLzIPo52WhuJg2g0P7r1tvUNwQV2zIi66mV6Ix6KdW/yRjvn6vFHVb7leg/H2vc35 7PPBXJk0LtP3dMGMxPhL1pND0zO+dv0m6cDVGPXoJG61ygMFSwltlX7xBejuT+35dgdCbtHbi5J iDJmpqKKf0pcPkChfOA+eEMYTB1cUcdl1xbxbUqWU/smyI27EL3l4cWGVarMTiT7mETGMuC95y8 IoRDYtYblRChC5+uR1Rfxtfu1OM1l1GdYG8haATzrBjKhI7+ 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/tegra20-apb-dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 063022f9df76..ac69778827f2 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -1581,7 +1581,7 @@ static int tegra_dma_probe(struct platform_device *pdev) return ret; } -static int tegra_dma_remove(struct platform_device *pdev) +static void tegra_dma_remove(struct platform_device *pdev) { struct tegra_dma *tdma = platform_get_drvdata(pdev); @@ -1589,8 +1589,6 @@ static int tegra_dma_remove(struct platform_device *pdev) dma_async_device_unregister(&tdma->dma_dev); pm_runtime_disable(&pdev->dev); clk_unprepare(tdma->dma_clk); - - return 0; } static int __maybe_unused tegra_dma_runtime_suspend(struct device *dev) @@ -1677,7 +1675,7 @@ static struct platform_driver tegra_dmac_driver = { .of_match_table = tegra_dma_of_match, }, .probe = tegra_dma_probe, - .remove = tegra_dma_remove, + .remove_new = tegra_dma_remove, }; module_platform_driver(tegra_dmac_driver); From patchwork Tue Sep 19 13:31:57 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: 13391431 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33588CD5BC4 for ; Tue, 19 Sep 2023 13:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232448AbjISNcv (ORCPT ); Tue, 19 Sep 2023 09:32:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232437AbjISNck (ORCPT ); Tue, 19 Sep 2023 09:32:40 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DAAC114 for ; Tue, 19 Sep 2023 06:32:33 -0700 (PDT) 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 1qiaq0-0005IQ-2W; Tue, 19 Sep 2023 15:32:24 +0200 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 1qiapy-007T5j-2b; Tue, 19 Sep 2023 15:32:22 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapx-0030ge-KP; Tue, 19 Sep 2023 15:32:21 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Laxman Dewangan , Jon Hunter , Thierry Reding , dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 49/59] dma: tegra210-adma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:57 +0200 Message-Id: <20230919133207.1400430-50-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1852; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=5+mecjlFKmd8TVrFW4MYCmacqxPAp/lAxa8imCO+1Hw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHn/+7xPNMV2n5nb3por5jxSDs8U3DxWFGf5 cEtaDrmksaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh5wAKCRCPgPtYfRL+ Tj7vB/sHCmK3Fhdtbl+g31xhTzCDBfHmUcq76KFXy5+rTG7NrzwlipfOr7hriY3Y/iiVnT8UVzL MHQ0rMLAQ+xrRL/RFAEygrNmxDjm+ze9KCvIfMjqYjUKalru9/G/i+QakerD4TszEoEWjpQ2VoV K4kcL7DNnfrhTehEmlfGD6IxK3nhHeybg9GQdDBkVrk45lJS5au+Ot5G3r9b5p4oS1A+Oqxo69O EBaDrPA2x4ROMkdyg/7XjtcUPa2xC1ER/ek1TEQqtZ20QBudCJNAyyCZE23UIJNxNsLQ9LJWncK 3RUjyA4cxUvBkNUGMosrqXbUzKyf0UxPyp+FRXFIVSrkQ6Eu 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/tegra210-adma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c index e557bada1510..60111d40325e 100644 --- a/drivers/dma/tegra210-adma.c +++ b/drivers/dma/tegra210-adma.c @@ -949,7 +949,7 @@ static int tegra_adma_probe(struct platform_device *pdev) return ret; } -static int tegra_adma_remove(struct platform_device *pdev) +static void tegra_adma_remove(struct platform_device *pdev) { struct tegra_adma *tdma = platform_get_drvdata(pdev); int i; @@ -961,8 +961,6 @@ static int tegra_adma_remove(struct platform_device *pdev) irq_dispose_mapping(tdma->channels[i].irq); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct dev_pm_ops tegra_adma_dev_pm_ops = { @@ -979,7 +977,7 @@ static struct platform_driver tegra_admac_driver = { .of_match_table = tegra_adma_of_match, }, .probe = tegra_adma_probe, - .remove = tegra_adma_remove, + .remove_new = tegra_adma_remove, }; module_platform_driver(tegra_admac_driver); From patchwork Tue Sep 19 13:31:58 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: 13391423 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 881DFCD5BC1 for ; Tue, 19 Sep 2023 13:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232429AbjISNcr (ORCPT ); Tue, 19 Sep 2023 09:32:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232430AbjISNci (ORCPT ); Tue, 19 Sep 2023 09:32:38 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8420BFB for ; Tue, 19 Sep 2023 06:32:31 -0700 (PDT) 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 1qiaq0-0005Je-La; Tue, 19 Sep 2023 15:32:24 +0200 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 1qiapy-007T5p-9G; Tue, 19 Sep 2023 15:32:22 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapx-0030gi-VF; Tue, 19 Sep 2023 15:32:21 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Peter Ujfalusi , Tudor Ambarus , Jernej Skrabec , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 50/59] dma: ti: cppi41: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:58 +0200 Message-Id: <20230919133207.1400430-51-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1895; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=pdZs2mpxrwwB99tDUJ7sIFNa8QSLEn1C5iWYhRjxrt0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHpKt0CrbwXMUQwVwTilGTwdMR/21IDTUNIk HkDtZYQEgGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh6QAKCRCPgPtYfRL+ TkFLB/970Fiz4twQUtX2WWerpZIMpeB7+uhYXv4+7NOW5h4guR2zbc9MHClox5XWLnOqhQP6db7 hXKqFiWhy1bNc87tZGrR9y/0oryCKzyvWL30Ziz1R1z3CAzrj4AvhSWIWeGkAfJCoi/QnFYjySA xUOjg5UcJDta+WLNf7cqqwHWmysKfqjMPdpAvZzAMsP/zopySQY/7wdOV5eAh3eE3TX8fDyAQJf tzmWM2Oxflbuuk50zgm3DP0PetL0vsLjV4J+FU4B6H3cMIjT+pE/5AjhtmQQ4q5OW8X5nUF0fMS kcTWQloPR0nxziWBQ9naQYWKS+dsqZvSZPcsVpP4awEJ4kam 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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: Peter Ujfalusi --- drivers/dma/ti/cppi41.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dma/ti/cppi41.c b/drivers/dma/ti/cppi41.c index c3555cfb0681..7e0b06b5dff0 100644 --- a/drivers/dma/ti/cppi41.c +++ b/drivers/dma/ti/cppi41.c @@ -1156,7 +1156,7 @@ static int cppi41_dma_probe(struct platform_device *pdev) return ret; } -static int cppi41_dma_remove(struct platform_device *pdev) +static void cppi41_dma_remove(struct platform_device *pdev) { struct cppi41_dd *cdd = platform_get_drvdata(pdev); int error; @@ -1173,7 +1173,6 @@ static int cppi41_dma_remove(struct platform_device *pdev) pm_runtime_dont_use_autosuspend(&pdev->dev); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - return 0; } static int __maybe_unused cppi41_suspend(struct device *dev) @@ -1244,7 +1243,7 @@ static const struct dev_pm_ops cppi41_pm_ops = { static struct platform_driver cpp41_dma_driver = { .probe = cppi41_dma_probe, - .remove = cppi41_dma_remove, + .remove_new = cppi41_dma_remove, .driver = { .name = "cppi41-dma-engine", .pm = &cppi41_pm_ops, From patchwork Tue Sep 19 13:31:59 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: 13391419 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6E7FCD5BC2 for ; Tue, 19 Sep 2023 13:32:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232389AbjISNcp (ORCPT ); Tue, 19 Sep 2023 09:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232420AbjISNch (ORCPT ); Tue, 19 Sep 2023 09:32:37 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A3E212F for ; Tue, 19 Sep 2023 06:32:30 -0700 (PDT) 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 1qiaq0-0005LP-Mk; Tue, 19 Sep 2023 15:32:24 +0200 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 1qiapy-007T5s-Ij; Tue, 19 Sep 2023 15:32:22 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapy-0030gm-7s; Tue, 19 Sep 2023 15:32:22 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Peter Ujfalusi , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 51/59] dma: ti: edma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:31:59 +0200 Message-Id: <20230919133207.1400430-52-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1778; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=WoPPd5nbPfOkJMaisGu9C32+CD+ZpnjuG2i0AtsUo5k=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTOha9O/FbenTlxT2VtBM8Lb34xzjb+9QkVrveCDd5/C 4wXN+vqZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAi/qXs/6Puro4oWHrjQaWi YS/HjF0S3O8d+fgl2xlXGbNlna7+rupTeIQlZk2V+bLSQr7sU2xZPqcV2/eWvfy9eYveOnnFJ4Y eV4zOy9mm3szkZN9lHsbIYJtvPcWsz3FN0+ejRz93RnQ9Dkyfm/pzXtOi33OOuF7+37IpIly6qP d7yqLi99lbLyzMdNv/0FCAv6D+xM4VtxIPLni69JJhXKUxu4Sjc7oQ68Pqpr8cE+fMmPnmDU/Pt XeBTI/+KFSeuLlltsiOiXKVadwT43sCchSspi99ueviPWc5yf9Pwqu/hf9RE/XT3sZQ6XRvxZen 17KbvhgIrAz+w5vkyOZ9J9kileWHeEyUm4rqesvJorFeAA== 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 Acked-by: Peter Ujfalusi --- drivers/dma/ti/edma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c index aa8e2e8ac260..3ed022918ec0 100644 --- a/drivers/dma/ti/edma.c +++ b/drivers/dma/ti/edma.c @@ -2550,7 +2550,7 @@ static void edma_cleanupp_vchan(struct dma_device *dmadev) } } -static int edma_remove(struct platform_device *pdev) +static void edma_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct edma_cc *ecc = dev_get_drvdata(dev); @@ -2568,8 +2568,6 @@ static int edma_remove(struct platform_device *pdev) edma_free_slot(ecc, ecc->dummy_slot); pm_runtime_put_sync(dev); pm_runtime_disable(dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -2628,7 +2626,7 @@ static const struct dev_pm_ops edma_pm_ops = { static struct platform_driver edma_driver = { .probe = edma_probe, - .remove = edma_remove, + .remove_new = edma_remove, .driver = { .name = "edma", .pm = &edma_pm_ops, From patchwork Tue Sep 19 13:32:00 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: 13391420 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58070CD5BBF for ; Tue, 19 Sep 2023 13:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232420AbjISNcq (ORCPT ); Tue, 19 Sep 2023 09:32:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232422AbjISNch (ORCPT ); Tue, 19 Sep 2023 09:32:37 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69C6612D for ; Tue, 19 Sep 2023 06:32:30 -0700 (PDT) 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 1qiaq0-0005Mf-Ml; Tue, 19 Sep 2023 15:32:24 +0200 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 1qiapy-007T5w-Od; Tue, 19 Sep 2023 15:32:22 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapy-0030gq-F7; Tue, 19 Sep 2023 15:32:22 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Peter Ujfalusi , dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 52/59] dma: ti: omap-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:32:00 +0200 Message-Id: <20230919133207.1400430-53-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1829; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=q//S5SKUTn3bvdczkMRBhDuNEA33PewLguXEgYXTTZI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHr3F20+LnW5AGY1wjUknw6+DDYuwhhTr/BU 8W30QysxUiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh6wAKCRCPgPtYfRL+ TvdzB/9zsVrw5hhKwLhhf13JWoU+mZsLTlVPjwv3UXhrCWSQ0CYxah5ZBButl1BZLoxAlez28tn Nwc6Fpt2VT4xMJSgUm8J5azzeErCop9l/6Ts4yoUTBqqgwKfskU82M7MzKxtSSh3JEtQzaRC8A3 rPukfrz3QQghrcI1GV/rsiP8IoYMtxEeuCY4GPNiwEvl6HMxDgcUBLlAQPIWLTIKDh+2yLdc+XN WBS6dAOcksbMtTEmejfDLrFzU36IdWw8LzlT2eHE7KVzXcPv24z8KP3fjUk23aErRF7/X7Q6RrE 6TMev4C5X8ft7XUUjf9dGX4L1OpH/ZsnO33YV3gJkfxwSkuN 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 Acked-by: Peter Ujfalusi --- drivers/dma/ti/omap-dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c index cf96cf915c0c..76db0fc19524 100644 --- a/drivers/dma/ti/omap-dma.c +++ b/drivers/dma/ti/omap-dma.c @@ -1844,7 +1844,7 @@ static int omap_dma_probe(struct platform_device *pdev) return rc; } -static int omap_dma_remove(struct platform_device *pdev) +static void omap_dma_remove(struct platform_device *pdev) { struct omap_dmadev *od = platform_get_drvdata(pdev); int irq; @@ -1869,8 +1869,6 @@ static int omap_dma_remove(struct platform_device *pdev) dma_pool_destroy(od->desc_pool); omap_dma_free(od); - - return 0; } static const struct omap_dma_config omap2420_data = { @@ -1918,7 +1916,7 @@ MODULE_DEVICE_TABLE(of, omap_dma_match); static struct platform_driver omap_dma_driver = { .probe = omap_dma_probe, - .remove = omap_dma_remove, + .remove_new = omap_dma_remove, .driver = { .name = "omap-dma-engine", .of_match_table = omap_dma_match, From patchwork Tue Sep 19 13:32:01 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: 13391415 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6ACDCD5BC7 for ; Tue, 19 Sep 2023 13:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232419AbjISNcn (ORCPT ); Tue, 19 Sep 2023 09:32:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232389AbjISNcg (ORCPT ); Tue, 19 Sep 2023 09:32:36 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C936B128 for ; Tue, 19 Sep 2023 06:32:29 -0700 (PDT) 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 1qiaq0-0005Nh-NL; Tue, 19 Sep 2023 15:32:24 +0200 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 1qiapy-007T60-V0; Tue, 19 Sep 2023 15:32:22 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapy-0030gt-L9; Tue, 19 Sep 2023 15:32:22 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 53/59] dma: timb_dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:32:01 +0200 Message-Id: <20230919133207.1400430-54-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1782; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=R7UQG3BNS22hG5Ey3S6ZDo6icHMCN8EqOM1kWJ7zMkw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHs4CiIuv9ZqZt8rYtEbRtxCvMXP5cwpv6Vd k/GobpTPw+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh7AAKCRCPgPtYfRL+ TotECACnj3m1yRyQz5++1wbOzWklDFdA4AbUia5kf832I6w6oTJTtiOBU+xlJLzv43EwZcaFRU/ 7gpEyb628HQ+c/JHAmRLSEyb64RsnpsvUAgjpzY/b0mFE8hLTE6R86uVBJ2cE2iqEqnTFp5TPGQ pdmWP4u4ePKBcNgM4mPIOJQ4VVZ/jjmox7LRX454NLw4G5iihhyA+uOj8XB5hwDFCt0qLNOBKT9 nLP2Q4Si09Zo6P6Tnlbm8bHPUq7bUSBClsgqKizP92sqc0EPzShrSeLceoCrr16PZs1gkohs2cP CYa/KUxbMcMGr8AafClfjfFe8qpCjoitEoU2Fo363xIqUkYQ 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/timb_dma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c index 3f524be69efb..7410025605e0 100644 --- a/drivers/dma/timb_dma.c +++ b/drivers/dma/timb_dma.c @@ -740,7 +740,7 @@ static int td_probe(struct platform_device *pdev) } -static int td_remove(struct platform_device *pdev) +static void td_remove(struct platform_device *pdev) { struct timb_dma *td = platform_get_drvdata(pdev); struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -754,7 +754,6 @@ static int td_remove(struct platform_device *pdev) release_mem_region(iomem->start, resource_size(iomem)); dev_dbg(&pdev->dev, "Removed...\n"); - return 0; } static struct platform_driver td_driver = { @@ -762,7 +761,7 @@ static struct platform_driver td_driver = { .name = DRIVER_NAME, }, .probe = td_probe, - .remove = td_remove, + .remove_new = td_remove, }; module_platform_driver(td_driver); From patchwork Tue Sep 19 13:32:02 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: 13391417 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8804CD5BC3 for ; Tue, 19 Sep 2023 13:32:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232390AbjISNco (ORCPT ); Tue, 19 Sep 2023 09:32:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232380AbjISNcg (ORCPT ); Tue, 19 Sep 2023 09:32:36 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA8C9129 for ; Tue, 19 Sep 2023 06:32:29 -0700 (PDT) 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 1qiaq1-0005Ol-B1; Tue, 19 Sep 2023 15:32:25 +0200 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 1qiapz-007T63-6u; Tue, 19 Sep 2023 15:32:23 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapy-0030gx-Rm; Tue, 19 Sep 2023 15:32:22 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 54/59] dma: txx9dmac: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:32:02 +0200 Message-Id: <20230919133207.1400430-55-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2595; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=R11KPobSn7r186XiXMFetAdcJGYGunyGcsscfFvQUfg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHt1lItaf/VF2sdW1fL8S7rQ8t9Ox6rkHMyo fAMygXG/6uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh7QAKCRCPgPtYfRL+ TvBYB/42ztlFQOxuJ6UtTQMv/91SZ8X/YWLmem3LLedxhD/7eqzspwG/wavZCoRQqt/8qaEjjMs jd841PftR9w1oTPO00UUYPXR6GF2cC0L1RgML3Wqct93IMLD3z7sY8mmxvc42/qDe89cxbs1nOs ZenY+TT7sAX8Mq1/LQV+f1V9NnvfuQ5LjH0awZW5hX3QjpW3AeXvoxLtUkwrVoPVgG/k6WqkJaT OfDy2GYz5pzVKif4os0MEfNqIBP/rXHTCRc9JVeLe/sJQ/kgQSx8+qxY1tFFC29Igi9W7e5N0oe mUKt5qfXibB9LE3OnneUxqWBVjgbDRO+gB6A1GiG/W5IBh/0 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/txx9dmac.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c index 5b6b375a257e..44ba377b4b5a 100644 --- a/drivers/dma/txx9dmac.c +++ b/drivers/dma/txx9dmac.c @@ -1151,7 +1151,7 @@ static int __init txx9dmac_chan_probe(struct platform_device *pdev) return 0; } -static int txx9dmac_chan_remove(struct platform_device *pdev) +static void txx9dmac_chan_remove(struct platform_device *pdev) { struct txx9dmac_chan *dc = platform_get_drvdata(pdev); @@ -1162,7 +1162,6 @@ static int txx9dmac_chan_remove(struct platform_device *pdev) tasklet_kill(&dc->tasklet); } dc->ddev->chan[pdev->id % TXX9_DMA_MAX_NR_CHANNELS] = NULL; - return 0; } static int __init txx9dmac_probe(struct platform_device *pdev) @@ -1215,7 +1214,7 @@ static int __init txx9dmac_probe(struct platform_device *pdev) return 0; } -static int txx9dmac_remove(struct platform_device *pdev) +static void txx9dmac_remove(struct platform_device *pdev) { struct txx9dmac_dev *ddev = platform_get_drvdata(pdev); @@ -1224,7 +1223,6 @@ static int txx9dmac_remove(struct platform_device *pdev) devm_free_irq(&pdev->dev, ddev->irq, ddev); tasklet_kill(&ddev->tasklet); } - return 0; } static void txx9dmac_shutdown(struct platform_device *pdev) @@ -1262,14 +1260,14 @@ static const struct dev_pm_ops txx9dmac_dev_pm_ops = { }; static struct platform_driver txx9dmac_chan_driver = { - .remove = txx9dmac_chan_remove, + .remove_new = txx9dmac_chan_remove, .driver = { .name = "txx9dmac-chan", }, }; static struct platform_driver txx9dmac_driver = { - .remove = txx9dmac_remove, + .remove_new = txx9dmac_remove, .shutdown = txx9dmac_shutdown, .driver = { .name = "txx9dmac", From patchwork Tue Sep 19 13:32:03 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: 13391414 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42075CD5BBF for ; Tue, 19 Sep 2023 13:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232399AbjISNcm (ORCPT ); Tue, 19 Sep 2023 09:32:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232419AbjISNcf (ORCPT ); Tue, 19 Sep 2023 09:32:35 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C92F0125 for ; Tue, 19 Sep 2023 06:32:29 -0700 (PDT) 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 1qiaq1-0005Pi-AX; Tue, 19 Sep 2023 15:32:25 +0200 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 1qiapz-007T66-Eh; Tue, 19 Sep 2023 15:32:23 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapz-0030h2-4K; Tue, 19 Sep 2023 15:32:23 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: dmaengine@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 55/59] dma: xgene-dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:32:03 +0200 Message-Id: <20230919133207.1400430-56-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1830; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=USoMClqln1iL9Q1cbh+gC3Zp0/ti44srvL+C7Pc7GZg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHuACSxsvu1jo4+mW25/aFpZ7bGLJhHMfG7B aNCay7CNIiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh7gAKCRCPgPtYfRL+ Thl2B/wNFhRo/yoRES/4YstoQBlA7p3bx2Wz3F1PfflC+puZJ3xJyMkwlABjQMF/05+KSphgWP7 z/ob7gIyTo+YFL7l59qn57vBMphTxhy7JNRpiONva9CesKafhwtm8vsz8cdMD9YctjNccWJTKIt KAb75pQ3UPwV/m/kPVoFATkTfYAraTfewafKg1PaqU2XJco4qLXCcT7YIYTayGKAVS/qfOH8Vj0 nEzNHwadbA3S4FXYtB8CFGNDFX+eGY0fvDS2K4f0fm0LrIqXEZM52f7wOupGTTOAl9HtV2v1DZ9 QQVRhxunSYioz6lzKry1WWCgMXQ0IP0LXUZTzlDVZ5dWALq2 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/xgene-dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c index bb4ff8c86733..fd4397adeb79 100644 --- a/drivers/dma/xgene-dma.c +++ b/drivers/dma/xgene-dma.c @@ -1776,7 +1776,7 @@ static int xgene_dma_probe(struct platform_device *pdev) return ret; } -static int xgene_dma_remove(struct platform_device *pdev) +static void xgene_dma_remove(struct platform_device *pdev) { struct xgene_dma *pdma = platform_get_drvdata(pdev); struct xgene_dma_chan *chan; @@ -1797,8 +1797,6 @@ static int xgene_dma_remove(struct platform_device *pdev) if (!IS_ERR(pdma->clk)) clk_disable_unprepare(pdma->clk); - - return 0; } #ifdef CONFIG_ACPI @@ -1817,7 +1815,7 @@ MODULE_DEVICE_TABLE(of, xgene_dma_of_match_ptr); static struct platform_driver xgene_dma_driver = { .probe = xgene_dma_probe, - .remove = xgene_dma_remove, + .remove_new = xgene_dma_remove, .driver = { .name = "X-Gene-DMA", .of_match_table = xgene_dma_of_match_ptr, From patchwork Tue Sep 19 13:32:04 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: 13391432 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B73ECD5BC6 for ; Tue, 19 Sep 2023 13:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232450AbjISNcv (ORCPT ); Tue, 19 Sep 2023 09:32:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232446AbjISNcl (ORCPT ); Tue, 19 Sep 2023 09:32:41 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E956118 for ; Tue, 19 Sep 2023 06:32:35 -0700 (PDT) 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 1qiaq1-0005R1-ET; Tue, 19 Sep 2023 15:32:25 +0200 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 1qiapz-007T69-Mk; Tue, 19 Sep 2023 15:32:23 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapz-0030h5-Bg; Tue, 19 Sep 2023 15:32:23 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Lizhi Hou , Brian Xu , Raj Kumar Rampelli , Michal Simek , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 56/59] dma: xilinx: xdma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:32:04 +0200 Message-Id: <20230919133207.1400430-57-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1788; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=sC1e8XJTChK1hqfmNfjLBa8n8F4EYU6xG4pax8b38go=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHwutEfREUe+TsY3JOTt/GOI6T83oxZ7vSZH Pq4RcG7cyCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh8AAKCRCPgPtYfRL+ TvAhB/9X9uyZRMV7OGmuYpdyBbRooeXKE8CmA9szakE9VnNPpZQWkm4g8yBlydZxxXExzFZKA+p jbNHOKB70fkr3qu8rXIKWMOqf5TA2JnOMOoZVfeuc6mmqWOfDAF4gguzmq+StFCMqb/vQ7wTy99 +jTswJaOol+nlRNum9RVXqVbg9e27FZzgJJgzwdLmCdpL9ASIHdHIokTuYpW0VTcy/zpvenbiQW tNdOlisK5Sa1XAyXs4utVX9zxBAqgHfWrmstNkS9mdDZdR7Jno1M/r1PXmWTvssrp3qcM4akhZV YxVARj6SD7EO+rPqgka4dECLa5ae/4+US8aaeToOEuTAWFgT 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/xilinx/xdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c index e0bfd129d563..459e7b9838ed 100644 --- a/drivers/dma/xilinx/xdma.c +++ b/drivers/dma/xilinx/xdma.c @@ -841,7 +841,7 @@ EXPORT_SYMBOL(xdma_get_user_irq); * xdma_remove - Driver remove function * @pdev: Pointer to the platform_device structure */ -static int xdma_remove(struct platform_device *pdev) +static void xdma_remove(struct platform_device *pdev) { struct xdma_device *xdev = platform_get_drvdata(pdev); @@ -850,8 +850,6 @@ static int xdma_remove(struct platform_device *pdev) if (xdev->status & XDMA_DEV_STATUS_REG_DMA) dma_async_device_unregister(&xdev->dma_dev); - - return 0; } /** @@ -966,7 +964,7 @@ static struct platform_driver xdma_driver = { }, .id_table = xdma_id_table, .probe = xdma_probe, - .remove = xdma_remove, + .remove_new = xdma_remove, }; module_platform_driver(xdma_driver); From patchwork Tue Sep 19 13:32:05 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: 13391436 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 321E3CD5BC2 for ; Tue, 19 Sep 2023 13:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232406AbjISNcx (ORCPT ); Tue, 19 Sep 2023 09:32:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232415AbjISNcn (ORCPT ); Tue, 19 Sep 2023 09:32:43 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E55EC119 for ; Tue, 19 Sep 2023 06:32:35 -0700 (PDT) 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 1qiaq1-0005Rt-Pr; Tue, 19 Sep 2023 15:32:25 +0200 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 1qiapz-007T6D-US; Tue, 19 Sep 2023 15:32:23 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapz-0030hA-J8; Tue, 19 Sep 2023 15:32:23 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Michal Simek , Radhey Shyam Pandey , Rob Herring , Peter Korsgaard , Liu Shixin , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 57/59] dma: xilinx: xilinx_dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:32:05 +0200 Message-Id: <20230919133207.1400430-58-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1882; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+IqQuGKfVTT93P0XcefOle75AuguAFhVRpoxwH+tLuY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHxVzfReXnnvh7loBbNqpVj6ktFIXWifBFCD G2/VQlf++aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh8QAKCRCPgPtYfRL+ ThlAB/9730LxScHBJwwcOaR1jnm0uFBe6jxULaX7ZbEgOyn/u9++XUE3Kq/3dvGXEbegv7B704l UJzLJijb25mmBJzw8sz4w7vOI0PxMMj1aObKN6qRytSxxbg1iRI+RneL4DizlfEwttwd5V6mGLt gcCzAFisvlIvUBwuDMKnQAFikWn/Q84BIYwfOux51WOmGrTCDvvt1D55UM7+yMJb04CzkdNBZRP dbbAVXKgwKIKJk2nIBrlJkNlHzauIjQgDz+oEhzqonCap4KTAo+PyHrKr45NRbIVY3O2djbDrqZ 2lN0XzR3JCwtl5W5pXzoc/1GTSIf1QU732PNOVBFlKOtaUuF 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/xilinx/xilinx_dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 0a3b2e22f23d..0c363a1ed853 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -3245,7 +3245,7 @@ static int xilinx_dma_probe(struct platform_device *pdev) * * Return: Always '0' */ -static int xilinx_dma_remove(struct platform_device *pdev) +static void xilinx_dma_remove(struct platform_device *pdev) { struct xilinx_dma_device *xdev = platform_get_drvdata(pdev); int i; @@ -3259,8 +3259,6 @@ static int xilinx_dma_remove(struct platform_device *pdev) xilinx_dma_chan_remove(xdev->chan[i]); xdma_disable_allclks(xdev); - - return 0; } static struct platform_driver xilinx_vdma_driver = { @@ -3269,7 +3267,7 @@ static struct platform_driver xilinx_vdma_driver = { .of_match_table = xilinx_dma_of_ids, }, .probe = xilinx_dma_probe, - .remove = xilinx_dma_remove, + .remove_new = xilinx_dma_remove, }; module_platform_driver(xilinx_vdma_driver); From patchwork Tue Sep 19 13:32:06 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: 13391430 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE272CD5BC1 for ; Tue, 19 Sep 2023 13:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232430AbjISNcu (ORCPT ); Tue, 19 Sep 2023 09:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232440AbjISNck (ORCPT ); Tue, 19 Sep 2023 09:32:40 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C9D912D for ; Tue, 19 Sep 2023 06:32:33 -0700 (PDT) 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 1qiaq1-0005SL-RU; Tue, 19 Sep 2023 15:32:26 +0200 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 1qiaq0-007T6I-6E; Tue, 19 Sep 2023 15:32:24 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiapz-0030hD-Qw; Tue, 19 Sep 2023 15:32:23 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Laurent Pinchart , Michal Simek , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 58/59] dma: xilinx: xilinx_dpdma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:32:06 +0200 Message-Id: <20230919133207.1400430-59-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1986; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=c4kegV9qxUF1PDqprDCRO/VbUQcrfl6M/Z8lCReUL7I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHyVz8Rx9BG+CCgcvfyzqztCe61jHTikg9eh lbpljsPTUWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh8gAKCRCPgPtYfRL+ TnafCACrI9YH6r/AuPON8rRnqVJZH8+XPR34NjvNNIAahWw7aQq0GSglVpNPKH8hlTrL9/gupFt XD/htbZ9aPqdKDE+8iQc07BLGkjA2M/1wbSSFRpfOdNU3rKoERlWa/9NH2YF9B3j7AGuGUk/qUF 4CWK5s1OtX6W+KdpWmVyD+3M5t6dznqg73tzJS70bDF0Tt7aBMukhEcQROL0yU0ppdDREYUwdpi 1z41v2a84E0eMiGt6m1EvkNTQachMQE9a2W4K7QHl1rpR7j96WFILtxBuBERGK3jt/qc5VSa7iN nbWHh4G3Pp8SktyK3XALmtoK8jGH2NpOYtrauYefXjdEz3wX 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/xilinx/xilinx_dpdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c index 84dc5240a807..69587d85a7cd 100644 --- a/drivers/dma/xilinx/xilinx_dpdma.c +++ b/drivers/dma/xilinx/xilinx_dpdma.c @@ -1736,7 +1736,7 @@ static int xilinx_dpdma_probe(struct platform_device *pdev) return ret; } -static int xilinx_dpdma_remove(struct platform_device *pdev) +static void xilinx_dpdma_remove(struct platform_device *pdev) { struct xilinx_dpdma_device *xdev = platform_get_drvdata(pdev); unsigned int i; @@ -1751,8 +1751,6 @@ static int xilinx_dpdma_remove(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(xdev->chan); i++) xilinx_dpdma_chan_remove(xdev->chan[i]); - - return 0; } static const struct of_device_id xilinx_dpdma_of_match[] = { @@ -1763,7 +1761,7 @@ MODULE_DEVICE_TABLE(of, xilinx_dpdma_of_match); static struct platform_driver xilinx_dpdma_driver = { .probe = xilinx_dpdma_probe, - .remove = xilinx_dpdma_remove, + .remove_new = xilinx_dpdma_remove, .driver = { .name = "xilinx-zynqmp-dpdma", .of_match_table = xilinx_dpdma_of_match, From patchwork Tue Sep 19 13:32:07 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: 13391437 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E546CCD5BC1 for ; Tue, 19 Sep 2023 13:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232392AbjISNcy (ORCPT ); Tue, 19 Sep 2023 09:32:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232449AbjISNcp (ORCPT ); Tue, 19 Sep 2023 09:32:45 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50846F9 for ; Tue, 19 Sep 2023 06:32:37 -0700 (PDT) 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 1qiaq1-0005Sq-ST; Tue, 19 Sep 2023 15:32:26 +0200 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 1qiaq0-007T6M-FQ; Tue, 19 Sep 2023 15:32:24 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiaq0-0030hI-4f; Tue, 19 Sep 2023 15:32:24 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vinod Koul Cc: Michal Simek , Peter Ujfalusi , Rob Herring , Harini Katakam , Swati Agarwal , Tudor Ambarus , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 59/59] dma: xilinx: zynqmp_dma: Convert to platform remove callback returning void Date: Tue, 19 Sep 2023 15:32:07 +0200 Message-Id: <20230919133207.1400430-60-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1910; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Nkd1uX8OdauqmU7BWC20E9W8adt9LLIa97MLrpM+RXs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCaHz2kgctu0Ux21FU0Jysj13QozCbofBgY3u3 CWtRm/P+ZCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQmh8wAKCRCPgPtYfRL+ Ton6B/9unXoW2Qv/126YYkvRu91nSPoX30s5BNwh50cM8TCrmO2EjgFiOcG5gzUVM1a/X4l+ofl wy6cEUxBK7sBey+2nfpig+ds1NuMM36P2qrEAtHd/dmCqK47SkO77296oxJBBzycGhJrmwywV/i riMj6ORpNF1e7KsiJzFPZn5eqJNzDcy7hAtTuCwdkcZknAgGLNI+IvNyqKfouEqlaSX9QaQUDfv 5EsIdYobF2Nd/xWx7RZYii4qZn+sbbbPyLvWQ5XktfCw5MoYHtLYB+v0ygEs4EGmamR0Ic/zJbh HaZlBzXntmHR2RKVlVhHfbtoHloBkBTgDDKmgLZru9YP6NQB 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: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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() is 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 --- drivers/dma/xilinx/zynqmp_dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c index bd8c3cc2eaab..f31631bef961 100644 --- a/drivers/dma/xilinx/zynqmp_dma.c +++ b/drivers/dma/xilinx/zynqmp_dma.c @@ -1147,7 +1147,7 @@ static int zynqmp_dma_probe(struct platform_device *pdev) * * Return: Always '0' */ -static int zynqmp_dma_remove(struct platform_device *pdev) +static void zynqmp_dma_remove(struct platform_device *pdev) { struct zynqmp_dma_device *zdev = platform_get_drvdata(pdev); @@ -1158,8 +1158,6 @@ static int zynqmp_dma_remove(struct platform_device *pdev) pm_runtime_disable(zdev->dev); if (!pm_runtime_enabled(zdev->dev)) zynqmp_dma_runtime_suspend(zdev->dev); - - return 0; } static const struct of_device_id zynqmp_dma_of_match[] = { @@ -1175,7 +1173,7 @@ static struct platform_driver zynqmp_dma_driver = { .pm = &zynqmp_dma_dev_pm_ops, }, .probe = zynqmp_dma_probe, - .remove = zynqmp_dma_remove, + .remove_new = zynqmp_dma_remove, }; module_platform_driver(zynqmp_dma_driver);