From patchwork Fri Mar 3 17:19: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: 13159081 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 B5E0CC64EC4 for ; Fri, 3 Mar 2023 17:20:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231320AbjCCRU6 (ORCPT ); Fri, 3 Mar 2023 12:20:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231482AbjCCRU4 (ORCPT ); Fri, 3 Mar 2023 12:20:56 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2E994391F for ; Fri, 3 Mar 2023 09:20:54 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95Q-0006Ow-U8; Fri, 03 Mar 2023 18:20:52 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Q-001bif-1z; Fri, 03 Mar 2023 18:20:52 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95P-001thw-7p; Fri, 03 Mar 2023 18:20:51 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 01/87] spi: ar934x: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:15 +0100 Message-Id: <20230303172041.2103336-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1697; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zGTvuvwAvgVY3METLBmYBauim/GskFk1C7CSseH4oo8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAisP5POw3l3dkQLi1+7Tu2XnOjq/m/iYv8545 NLT9NXHfL6JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrDwAKCRDB/BR4rcrs CZxBB/0TmXXdncuFJVWQgrsywJN0q8d1Az3Rw55h+TchWMQgzsaAZDDjqwbyLMmvXA5sb0UZVlp rkQriuFJ9WShxd2I/eU9EkgFGacqPHywYIl1TMnzprXTkghbMJPPmVKXi5ANGtNSsrb88kU+mpb 4pkN7yb62UtvohUmIX16XJ8ATzTLJN+TotaznMVkbT3loqUAnYmZeLAlp/2YoO4GBZJR8KMo3Gv /VnA+zEjS86yIC13r8WzyPScqzwR0FgBGpMljEyBNO8fh2KOLsC8ILod+Yg36qnsQ+iRTGh+CE2 SCkV6N2S/Jifytorem9DeHoxJ51e0MFiffzJ2oQkaj1RfHwB X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-ar934x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-ar934x.c b/drivers/spi/spi-ar934x.c index 4a6ecaa0a9c9..c71c8348eeaa 100644 --- a/drivers/spi/spi-ar934x.c +++ b/drivers/spi/spi-ar934x.c @@ -220,7 +220,7 @@ static int ar934x_spi_probe(struct platform_device *pdev) return ret; } -static int ar934x_spi_remove(struct platform_device *pdev) +static void ar934x_spi_remove(struct platform_device *pdev) { struct spi_controller *ctlr; struct ar934x_spi *sp; @@ -230,8 +230,6 @@ static int ar934x_spi_remove(struct platform_device *pdev) spi_unregister_controller(ctlr); clk_disable_unprepare(sp->clk); - - return 0; } static struct platform_driver ar934x_spi_driver = { @@ -240,7 +238,7 @@ static struct platform_driver ar934x_spi_driver = { .of_match_table = ar934x_spi_match, }, .probe = ar934x_spi_probe, - .remove = ar934x_spi_remove, + .remove_new = ar934x_spi_remove, }; module_platform_driver(ar934x_spi_driver); From patchwork Fri Mar 3 17:19: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: 13159082 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 83CA5C7EE32 for ; Fri, 3 Mar 2023 17:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231549AbjCCRU7 (ORCPT ); Fri, 3 Mar 2023 12:20:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231493AbjCCRU5 (ORCPT ); Fri, 3 Mar 2023 12:20:57 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E334C4392E for ; Fri, 3 Mar 2023 09:20:54 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95Q-0006Ox-U8; Fri, 03 Mar 2023 18:20:52 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Q-001bii-4W; Fri, 03 Mar 2023 18:20:52 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95P-001thz-Ey; Fri, 03 Mar 2023 18:20:51 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 02/87] spi: armada-3700: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:16 +0100 Message-Id: <20230303172041.2103336-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1672; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=F8KBtnscIvPxZNIoEeh1ijfeX88IfrcWkrcur9iyGwM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAisSiZpOXkhstileYltVBMFNx3J8qA1lT9IbJ cIQ5epjHrWJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrEgAKCRDB/BR4rcrs CTivB/9XkREUzuO3qMUpDTelbK54ZWPGWQZ7VT8KsTq+okC9O3qHKwn7r5y9XIjDacitQxFhly7 JrgzPQ02Ww94aibUy8DxOCinBHLhw0Wpe0AImpUZxwdjslyjtT8iLbShupELEHmlqI1Fe0KMMgc iKt/x+Jz8G7TX6GvzDk9uT59RSHfQfIeITyqrJP6cltnjn816odcF39dfclPBdhduFljzcPIgnH fjB/6YA7HSPh6IbzIYGuIUzyyJ0CBsghudiySJp/PzN06oGjKSm6YpDm/K3d9Tr8KiGPB8VR6NL qWeeTrCC1aSNqs4sXPTRbE7RKLBu19OUAlOBdxFAVZ+PnMQs X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-armada-3700.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-armada-3700.c b/drivers/spi/spi-armada-3700.c index 4d554b948d71..6a7e605f73bf 100644 --- a/drivers/spi/spi-armada-3700.c +++ b/drivers/spi/spi-armada-3700.c @@ -908,14 +908,12 @@ static int a3700_spi_probe(struct platform_device *pdev) return ret; } -static int a3700_spi_remove(struct platform_device *pdev) +static void a3700_spi_remove(struct platform_device *pdev) { struct spi_controller *host = platform_get_drvdata(pdev); struct a3700_spi *spi = spi_controller_get_devdata(host); clk_unprepare(spi->clk); - - return 0; } static struct platform_driver a3700_spi_driver = { @@ -924,7 +922,7 @@ static struct platform_driver a3700_spi_driver = { .of_match_table = of_match_ptr(a3700_spi_dt_ids), }, .probe = a3700_spi_probe, - .remove = a3700_spi_remove, + .remove_new = a3700_spi_remove, }; module_platform_driver(a3700_spi_driver); From patchwork Fri Mar 3 17:19: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: 13159164 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 6DA76C83005 for ; Fri, 3 Mar 2023 17:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231617AbjCCRVw (ORCPT ); Fri, 3 Mar 2023 12:21:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231491AbjCCRVb (ORCPT ); Fri, 3 Mar 2023 12:21:31 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98F4E559CD for ; Fri, 3 Mar 2023 09:21:19 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95V-0006P2-0S; Fri, 03 Mar 2023 18:20:57 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Q-001bio-Fa; Fri, 03 Mar 2023 18:20:52 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95P-001ti2-KO; Fri, 03 Mar 2023 18:20:51 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Chin-Ting Kuo , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Mark Brown , Joel Stanley Cc: Andrew Jeffery , linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 03/87] spi: aspeed-smc: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:17 +0100 Message-Id: <20230303172041.2103336-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1627; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=o5sJFUxoNT7gwytQoziVYIAoannDkz/5r4cZ/QJwJjk=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAisW7UH+01oobN1QWAUpph1uqBXyOJkpZ0nOy DUyy4zqZLmJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrFgAKCRDB/BR4rcrs CVMZB/9QkIFFT+vICGEx1YNlTkfjJVHM2QBt+NJNDA+HWzdkKDRW887iFtRGjsWRE9BbDDMkdP7 pUvFIYAZp+H13c8zm+6MujgtilCOebLnxM+rB1tZWKrsONWuAEJMo3QAofdSv/QnHWqaM6saL2L 5B54oAhsa13wvLhOso6pteb1zacagtz6GwAN+L2lgWDf/rCWobpodrdf8oq7WPjyB2GHOBED8xR 17oUoJcLxpNIPvs6raYkbYKRTFY2z7dgYJKGg1gapaqJvnZsC/VY056kJnhA10Fd07y+dj4cxFH DHibwpa3DL752UFe8mGEYBxFceANuh4Jzs2Jv6cjw3c6hWch X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Cédric Le Goater --- drivers/spi/spi-aspeed-smc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index 873ff2cf72c9..3f2548860317 100644 --- a/drivers/spi/spi-aspeed-smc.c +++ b/drivers/spi/spi-aspeed-smc.c @@ -787,13 +787,12 @@ static int aspeed_spi_probe(struct platform_device *pdev) return ret; } -static int aspeed_spi_remove(struct platform_device *pdev) +static void aspeed_spi_remove(struct platform_device *pdev) { struct aspeed_spi *aspi = platform_get_drvdata(pdev); aspeed_spi_enable(aspi, false); clk_disable_unprepare(aspi->clk); - return 0; } /* @@ -1201,7 +1200,7 @@ MODULE_DEVICE_TABLE(of, aspeed_spi_matches); static struct platform_driver aspeed_spi_driver = { .probe = aspeed_spi_probe, - .remove = aspeed_spi_remove, + .remove_new = aspeed_spi_remove, .driver = { .name = DEVICE_NAME, .of_match_table = aspeed_spi_matches, From patchwork Fri Mar 3 17:19: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: 13159138 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 BA93BC7EE37 for ; Fri, 3 Mar 2023 17:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231229AbjCCRVc (ORCPT ); Fri, 3 Mar 2023 12:21:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231628AbjCCRVP (ORCPT ); Fri, 3 Mar 2023 12:21:15 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3650D4391F for ; Fri, 3 Mar 2023 09:21:10 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95S-0006P1-CX; Fri, 03 Mar 2023 18:20:54 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Q-001bin-FD; Fri, 03 Mar 2023 18:20:52 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95P-001ti5-PX; Fri, 03 Mar 2023 18:20:51 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Radu Pirea , Mark Brown , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 04/87] spi: at91-usart: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:18 +0100 Message-Id: <20230303172041.2103336-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1771; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=SGTH7dP1xdrOjceXNC+FsmDr8gaZPzgN2ggj7NJLIyg=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAisac5mxvotOLoUtJia2rcQeOrDI9GGAI5NoY UDlaMgbpXKJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrGgAKCRDB/BR4rcrs CQDPCACACaDXYziUUldTQvFnJHv2N/lK3otYlI4b7uVeH2GqgV/m0PHCvdlJQhZ9WKesTK/AuG4 MnZrvMy0J5htNRY5CPDcvUQYJBUYzehhX+KARQuGbcd18BP+jEf2to5hVumB3/2b9uRmlH/pyrV vlswhRCeTfAMSq8+3WzvB543/Vb7VneX9+MigJlRQj6LsVOfJt05vQeNJg/uy08gGoWOrOBbruU VaXoMrPwOMIxwpQk1jU7nE5kRNnyEu+/l1tHV/7E/JzvWCe1KQlGnH/y03Kc4KVUgC1IK6so2UF /n9aL9IttItCRb9BH1BYS7ulY1fldb8VHBACB0DptV+6zS01 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Claudiu Beznea --- drivers/spi/spi-at91-usart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c index fab9d223e24a..4fb3653b5941 100644 --- a/drivers/spi/spi-at91-usart.c +++ b/drivers/spi/spi-at91-usart.c @@ -647,15 +647,13 @@ __maybe_unused static int at91_usart_spi_resume(struct device *dev) return spi_controller_resume(ctrl); } -static int at91_usart_spi_remove(struct platform_device *pdev) +static void at91_usart_spi_remove(struct platform_device *pdev) { struct spi_controller *ctlr = platform_get_drvdata(pdev); struct at91_usart_spi *aus = spi_controller_get_devdata(ctlr); at91_usart_spi_release_dma(ctlr); clk_disable_unprepare(aus->clk); - - return 0; } static const struct dev_pm_ops at91_usart_spi_pm_ops = { @@ -670,7 +668,7 @@ static struct platform_driver at91_usart_spi_driver = { .pm = &at91_usart_spi_pm_ops, }, .probe = at91_usart_spi_probe, - .remove = at91_usart_spi_remove, + .remove_new = at91_usart_spi_remove, }; module_platform_driver(at91_usart_spi_driver); From patchwork Fri Mar 3 17:19: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: 13159080 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 5D30AC7EE2D for ; Fri, 3 Mar 2023 17:20:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231519AbjCCRU5 (ORCPT ); Fri, 3 Mar 2023 12:20:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231320AbjCCRU4 (ORCPT ); Fri, 3 Mar 2023 12:20:56 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E358243937 for ; Fri, 3 Mar 2023 09:20:54 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95R-0006P5-8r; Fri, 03 Mar 2023 18:20:53 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Q-001biu-Li; Fri, 03 Mar 2023 18:20:52 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95P-001ti9-V8; Fri, 03 Mar 2023 18:20:51 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 05/87] spi: ath79: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:19 +0100 Message-Id: <20230303172041.2103336-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1748; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=XrvfGGtDEIh3ylCBBK+aJfWuAsikUFg8ITaaa06tIYQ=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAise0Iuiz9Hgoa+p21/E89rb2te73hpy0avem xdMbZE42PCJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrHgAKCRDB/BR4rcrs CXNtCACRuxch7TyEL9P50m7umDaQvEimDBgVvZhBEfxCgjT7op23hRObcACHN8Ewspzlpcidm8R O7/sOkr5YowT5bonj9sSRvQzB7Lq514Y7j7SzXcK7X0RIhXGstvdKINEhM78P5MzsaxsynbJsJ4 s+JBmv7auTd2pVts5TDQxE5HQwE4pWjIOfShjM9lJiQosmyNzp/S6M0StvjKZ4ZjyCPGcxkDkI9 ra3FTNY6uJe24i/dGwRfHlLVDI+I2IzaMWpJCASThqdLdTpN6QcNOIUzb80p2uXbKZXqaY3IkKn 8/tuqzeKPcGPAVh/nf5JS6QCxAENwodPGJ+ca7j4Np5sQr5y X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-ath79.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-ath79.c b/drivers/spi/spi-ath79.c index 795e88dbef1b..b4d25b3bee19 100644 --- a/drivers/spi/spi-ath79.c +++ b/drivers/spi/spi-ath79.c @@ -237,7 +237,7 @@ static int ath79_spi_probe(struct platform_device *pdev) return ret; } -static int ath79_spi_remove(struct platform_device *pdev) +static void ath79_spi_remove(struct platform_device *pdev) { struct ath79_spi *sp = platform_get_drvdata(pdev); @@ -245,8 +245,6 @@ static int ath79_spi_remove(struct platform_device *pdev) ath79_spi_disable(sp); clk_disable_unprepare(sp->clk); spi_controller_put(sp->bitbang.master); - - return 0; } static void ath79_spi_shutdown(struct platform_device *pdev) @@ -262,7 +260,7 @@ MODULE_DEVICE_TABLE(of, ath79_spi_of_match); static struct platform_driver ath79_spi_driver = { .probe = ath79_spi_probe, - .remove = ath79_spi_remove, + .remove_new = ath79_spi_remove, .shutdown = ath79_spi_shutdown, .driver = { .name = DRV_NAME, From patchwork Fri Mar 3 17:19: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: 13159140 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 9B005C7EE2F for ; Fri, 3 Mar 2023 17:21:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231230AbjCCRVd (ORCPT ); Fri, 3 Mar 2023 12:21:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231551AbjCCRVQ (ORCPT ); Fri, 3 Mar 2023 12:21:16 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93CCF47410 for ; Fri, 3 Mar 2023 09:21:10 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95R-0006PP-T8; Fri, 03 Mar 2023 18:20:53 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Q-001biy-TF; Fri, 03 Mar 2023 18:20:52 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Q-001tiC-4b; Fri, 03 Mar 2023 18:20:52 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Tudor Ambarus , Mark Brown , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 06/87] spi: atmel: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:20 +0100 Message-Id: <20230303172041.2103336-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1761; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=mCt2Un821gpj1y8NAm+IBr4EdSBQOSNVgBWpBSq5bZs=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAishGC2VZ7VOHqW4ZkNNX6g/mFQ+ZvzY0xMNx n122bI6SKuJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrIQAKCRDB/BR4rcrs CfGTB/4qeTRYO9EJB/+02GnInZTAUON0o38ogQMj7fAbI/gVee6C8YQSnuu5EDS44bQAMIZ/Kiy azJYPA6nDyao0BnD28HL6WOOuO8EOGIql/hYVlDvEAhPooUS0DxhLMBHcmtubxM4I9wBFNS5a+x zPeUxANNG4FpVtbrS7+IZtGehLGNvzBJjAPzzCgZyjKNAWR8qRAEz8EftzpGSiigVs43s096nGj XsUO+hKpkLRLbzamANE92pDTi+99WYZuRsw/pfQzQdZHh1NFBF9eXNSyn7o3r5/dkVWuSKENsPO pGN6G5dCM6ZZHWUhDMdsqquVAL5O/siXDKT8SB8MMKLu4UtV X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Claudiu Beznea --- drivers/spi/spi-atmel.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index 5c5678f065f3..73f80c8ac2ff 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1596,7 +1596,7 @@ static int atmel_spi_probe(struct platform_device *pdev) return ret; } -static int atmel_spi_remove(struct platform_device *pdev) +static void atmel_spi_remove(struct platform_device *pdev) { struct spi_controller *host = platform_get_drvdata(pdev); struct atmel_spi *as = spi_controller_get_devdata(host); @@ -1627,8 +1627,6 @@ static int atmel_spi_remove(struct platform_device *pdev) pm_runtime_put_noidle(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static int atmel_spi_runtime_suspend(struct device *dev) @@ -1712,7 +1710,7 @@ static struct platform_driver atmel_spi_driver = { .of_match_table = atmel_spi_dt_ids, }, .probe = atmel_spi_probe, - .remove = atmel_spi_remove, + .remove_new = atmel_spi_remove, }; module_platform_driver(atmel_spi_driver); From patchwork Fri Mar 3 17:19: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: 13159084 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 420DEC7EE2F for ; Fri, 3 Mar 2023 17:20:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231535AbjCCRU6 (ORCPT ); Fri, 3 Mar 2023 12:20:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231489AbjCCRU5 (ORCPT ); Fri, 3 Mar 2023 12:20:57 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60FE0457FE for ; Fri, 3 Mar 2023 09:20:55 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95R-0006PZ-OD; Fri, 03 Mar 2023 18:20:53 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95R-001bj5-4o; Fri, 03 Mar 2023 18:20:53 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Q-001tiH-Aa; Fri, 03 Mar 2023 18:20:52 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 07/87] spi: au1550: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:21 +0100 Message-Id: <20230303172041.2103336-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1630; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=M9WTVgHyXJxi29UUSOJbLcj9bE7oloZpTz5/WtjZTA8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAislOp95d2o8AuCVtHcoG9gPjo7JswA8WMKeY gCm3+sl2fKJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrJQAKCRDB/BR4rcrs CQsZB/4ym6xF+ARaZDqlPirJDMA/X4V/iB/SEPvSrDaMVoO9pJOsMQuf8denYl9fRNSaj1zmc+6 +kHiUL8jO+a30Co9DGWJJRM6qykbGN4gEnc1IsGqPPfoti1JGQATUR9j5Oh00iNESOSu92SzeRj 1bpOOcEKAUnxGK5ARYHBmDtAqQGnVXmPO2XmZ68jrjZHgOAmN5nH8PSl+iPR8AJMA+HqSh6sUs4 3zG/X2X59OThMQRU8PM+x6T3c8hH71YDIwy2GlN8bmZOhqoTSjKhqzPC7gChH97fpNtWDgLLOqg rh40rkbkzQlthjleM0dNRS0AbnCe5j54CbeTwA3FF7sa+6Kk X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-au1550.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-au1550.c b/drivers/spi/spi-au1550.c index e008761298da..8151bed8a117 100644 --- a/drivers/spi/spi-au1550.c +++ b/drivers/spi/spi-au1550.c @@ -923,7 +923,7 @@ static int au1550_spi_probe(struct platform_device *pdev) return err; } -static int au1550_spi_remove(struct platform_device *pdev) +static void au1550_spi_remove(struct platform_device *pdev) { struct au1550_spi *hw = platform_get_drvdata(pdev); @@ -942,7 +942,6 @@ static int au1550_spi_remove(struct platform_device *pdev) } spi_master_put(hw->master); - return 0; } /* work with hotplug and coldplug */ @@ -950,7 +949,7 @@ MODULE_ALIAS("platform:au1550-spi"); static struct platform_driver au1550_spi_drv = { .probe = au1550_spi_probe, - .remove = au1550_spi_remove, + .remove_new = au1550_spi_remove, .driver = { .name = "au1550-spi", }, From patchwork Fri Mar 3 17:19: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: 13159083 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 24705C7EE37 for ; Fri, 3 Mar 2023 17:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231489AbjCCRU7 (ORCPT ); Fri, 3 Mar 2023 12:20:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231508AbjCCRU5 (ORCPT ); Fri, 3 Mar 2023 12:20:57 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1E1A457C3 for ; Fri, 3 Mar 2023 09:20:55 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95S-0006Pg-7O; Fri, 03 Mar 2023 18:20:54 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95R-001bjA-Gk; Fri, 03 Mar 2023 18:20:53 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Q-001tiK-GP; Fri, 03 Mar 2023 18:20:52 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 08/87] spi: axi-spi-engine: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:22 +0100 Message-Id: <20230303172041.2103336-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1892; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oZbnymJ/6nceM3CjEirGLANrMdtFRic5hTpBsx/yk24=; b=owGbwMvMwMV48I9IxdpTbzgZT6slMaQwaWvaMbEoeJ55tWlRuvQBs/BO5cvBznzvNilydmdUP nzjcTi+k9GYhYGRi0FWTJGlrkhLbILEmv92JUu4YQaxMoFMYeDiFICJKEax/5VQ+Fo4JderTvTY E21GTx71hIis+W/LzDuaZposv6woe23rzU2q1/dbXUrIF4vfkuhy5ez20LIagYkaMye9XNTaZLV wx8cqix7vnr17mCNfq07fHr3eIfjPwfS8DXN3Xu7a99I1797eHDnDf3IWmy9mH+54L5tYYXFvqS R30UyDkNjnHgpW53mMQtUuxddHfuBewMTc4/vOvNo+aON004+vLSx2vJlzri0v2pVnZskUEfudX bbsHN7Gj+938zUGLPjxTpgvP8jLXKJuW+ipXZ9NYpUmJOXdfaFc4Hp+D8/zRx8uuabEqUyY4/pS 8quQz7N/Sg53xXoUGq371mWqHFt2sMfL+jUH4+dZ54L1AQ== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-axi-spi-engine.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c index 80c3e38f5c1b..c5a3a3189164 100644 --- a/drivers/spi/spi-axi-spi-engine.c +++ b/drivers/spi/spi-axi-spi-engine.c @@ -554,7 +554,7 @@ static int spi_engine_probe(struct platform_device *pdev) return ret; } -static int spi_engine_remove(struct platform_device *pdev) +static void spi_engine_remove(struct platform_device *pdev) { struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); struct spi_engine *spi_engine = spi_master_get_devdata(master); @@ -572,8 +572,6 @@ static int spi_engine_remove(struct platform_device *pdev) clk_disable_unprepare(spi_engine->ref_clk); clk_disable_unprepare(spi_engine->clk); - - return 0; } static const struct of_device_id spi_engine_match_table[] = { @@ -584,7 +582,7 @@ MODULE_DEVICE_TABLE(of, spi_engine_match_table); static struct platform_driver spi_engine_driver = { .probe = spi_engine_probe, - .remove = spi_engine_remove, + .remove_new = spi_engine_remove, .driver = { .name = "spi-engine", .of_match_table = spi_engine_match_table, From patchwork Fri Mar 3 17:19: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: 13159095 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 E709CC7EE2F for ; Fri, 3 Mar 2023 17:21:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231596AbjCCRVF (ORCPT ); Fri, 3 Mar 2023 12:21:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231555AbjCCRVA (ORCPT ); Fri, 3 Mar 2023 12:21:00 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBBA447410 for ; Fri, 3 Mar 2023 09:20:58 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95T-0006Pu-5Q; Fri, 03 Mar 2023 18:20:55 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95R-001bjH-ME; Fri, 03 Mar 2023 18:20:53 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Q-001tiP-MO; Fri, 03 Mar 2023 18:20:52 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Florian Fainelli , Ray Jui , Scott Branden Cc: Broadcom internal kernel review list , linux-spi@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 09/87] spi: bcm2835: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:23 +0100 Message-Id: <20230303172041.2103336-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2073; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IwMtpVogMLCOnqG7xyZOf1yVAVJAMlhznRPZfWS20qU=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAistaibZ8u12RA+5ZlvyXrNsVYAw21v6yE1O2 jwrIwgu80SJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrLQAKCRDB/BR4rcrs CZDcB/0R7//E1eL+cLL7rtUtyygZCxAKAITisyDBy+vtPSEyvOBfwK7oDv/H8mZHFgmWqG0vLQk dZ5N9Fzwj5hBR8yulTkZM9wd3sDX07lgXwpqQqqnslEMiAwLo59iNO6cJqqlfsbWoBe9jjqZVti Wu9SQzQ/Ame/Ei+EkUU9eHnDiOrZcNJhF4kUIpw5hhu206hAZ6kfBZg4SnmyEM5iyUndm7fffPX ROBctkqI5ZPBuvxhwCvZvGkgJU+pK4njWoJPMNhk+pZqG8iUHC06ZBQLG6LJVNjpiJ8fK8ygXkt j0kLPcAJZgdxg6+5EO3xqc1DTvvd0PPuUzHwtIl06MN6NVms X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli --- drivers/spi/spi-bcm2835.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 747e03228c48..be6050b513a9 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1398,7 +1398,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev) return err; } -static int bcm2835_spi_remove(struct platform_device *pdev) +static void bcm2835_spi_remove(struct platform_device *pdev) { struct spi_controller *ctlr = platform_get_drvdata(pdev); struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); @@ -1414,17 +1414,11 @@ static int bcm2835_spi_remove(struct platform_device *pdev) BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); clk_disable_unprepare(bs->clk); - - return 0; } static void bcm2835_spi_shutdown(struct platform_device *pdev) { - int ret; - - ret = bcm2835_spi_remove(pdev); - if (ret) - dev_err(&pdev->dev, "failed to shutdown\n"); + rbcm2835_spi_remove(pdev); } static const struct of_device_id bcm2835_spi_match[] = { @@ -1439,7 +1433,7 @@ static struct platform_driver bcm2835_spi_driver = { .of_match_table = bcm2835_spi_match, }, .probe = bcm2835_spi_probe, - .remove = bcm2835_spi_remove, + .remove_new = bcm2835_spi_remove, .shutdown = bcm2835_spi_shutdown, }; module_platform_driver(bcm2835_spi_driver); From patchwork Fri Mar 3 17:19: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: 13159091 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 6629FC7EE37 for ; Fri, 3 Mar 2023 17:21:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231590AbjCCRVD (ORCPT ); Fri, 3 Mar 2023 12:21:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231552AbjCCRU7 (ORCPT ); Fri, 3 Mar 2023 12:20:59 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C416746173 for ; Fri, 3 Mar 2023 09:20:58 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95T-0006Pn-5V; Fri, 03 Mar 2023 18:20:55 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95R-001bjE-IT; Fri, 03 Mar 2023 18:20:53 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Q-001tiT-SM; Fri, 03 Mar 2023 18:20:52 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Florian Fainelli , Ray Jui , Scott Branden Cc: Broadcom internal kernel review list , linux-spi@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 10/87] spi: bcm2835aux: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:24 +0100 Message-Id: <20230303172041.2103336-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1848; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=HxAnckGiKCzLyuvEabwpYpwqx3PhdazBpsbqGFgNiq8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiswmCk4qX4t3FwuHOS1qSI8PclnobVBljdiM JknUjs9fCuJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrMAAKCRDB/BR4rcrs CUSkB/98/B9X+QfXjlY0qOtyGGgOPExlSNt0EVtwMnImk3a6h9h0EMflCO2Y5nqTcm4lET7EYVY /9b8hlvUsPXYZSla09FZU9NXVmvo7AA0YJwONp+ecSp22u9oQB63YLbrjoMFSAQae5wdjB1c/PA X76wUZv+o4+uF5h9h/M1feDkU4nDz13Mih2jM0zObxijcxDBVlphllZr0eMJvnTDHdGIubvxkKG olcFSX/gTdRDIjAu8D6xNCzDKekQYsUbcluspKu2ZToVcKSUdO1hoOWSVpjBmizcW4A/8KWSDug GtkYjVchlBH0q0+qwrm6BXkm1eIgUw1pz/FeHK0ZvEfBh+jh X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli --- drivers/spi/spi-bcm2835aux.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c index e28521922330..7f2546fd900a 100644 --- a/drivers/spi/spi-bcm2835aux.c +++ b/drivers/spi/spi-bcm2835aux.c @@ -567,7 +567,7 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev) return err; } -static int bcm2835aux_spi_remove(struct platform_device *pdev) +static void bcm2835aux_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct bcm2835aux_spi *bs = spi_master_get_devdata(master); @@ -580,8 +580,6 @@ static int bcm2835aux_spi_remove(struct platform_device *pdev) /* disable the HW block by releasing the clock */ clk_disable_unprepare(bs->clk); - - return 0; } static const struct of_device_id bcm2835aux_spi_match[] = { @@ -596,7 +594,7 @@ static struct platform_driver bcm2835aux_spi_driver = { .of_match_table = bcm2835aux_spi_match, }, .probe = bcm2835aux_spi_probe, - .remove = bcm2835aux_spi_remove, + .remove_new = bcm2835aux_spi_remove, }; module_platform_driver(bcm2835aux_spi_driver); From patchwork Fri Mar 3 17:19: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: 13159094 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 8C477C7EE32 for ; Fri, 3 Mar 2023 17:21:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231593AbjCCRVE (ORCPT ); Fri, 3 Mar 2023 12:21:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231556AbjCCRVA (ORCPT ); Fri, 3 Mar 2023 12:21:00 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 102164616A for ; Fri, 3 Mar 2023 09:20:59 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95T-0006Pw-5J; Fri, 03 Mar 2023 18:20:55 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95R-001bjI-Mf; Fri, 03 Mar 2023 18:20:53 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95R-001tiX-2O; Fri, 03 Mar 2023 18:20:53 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: William Zhang , Kursad Oney , Jonas Gorski , Mark Brown Cc: Broadcom internal kernel review list , linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 11/87] spi: bcm63xx-hsspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:25 +0100 Message-Id: <20230303172041.2103336-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=cIYL4YkxlRDO+P3PHca9xkpZ06FkySRtZc1b+XklO4k=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAis0kmvv7vFLuqtgI0CtGzOw46olyY4yjEyW9 wiEnal/HxyJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrNAAKCRDB/BR4rcrs CSXKCACcxAB7MRzzcvm37+EpPG1FKU8oDgF2gNnA9PaLKr69uc2aQ8vfQlqAclI1jVzv2lj3sFx 0qRQjgU/pn0DFhldjQ1f0O3awGAwwrL10pe3gmJX+EmnKkKkKBzDlyT7xgmTt/4sCj5DnVOfuzq zBZw+3GLrmqn4MEQ8nOfqqZPEWTgSC4QR0d/BKCIG7wLtqL45N27wm0ZTUBtZZ42gcmz98p4Tl+ /h4ojGXHkaMHi5JUVqW0WtGCdAy0NBq67WP5OqbpbI6av6J7V1UlT4Qlp/r7uI8+qm5rMnDWWp+ 8sfAlE2Mq6ey90bnCpNoW9eR3oKnh5cAOFBqDg/iPs+IJOjy X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli --- drivers/spi/spi-bcm63xx-hsspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c index cd0a6478f5e7..f2708caa2f33 100644 --- a/drivers/spi/spi-bcm63xx-hsspi.c +++ b/drivers/spi/spi-bcm63xx-hsspi.c @@ -878,7 +878,7 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) } -static int bcm63xx_hsspi_remove(struct platform_device *pdev) +static void bcm63xx_hsspi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct bcm63xx_hsspi *bs = spi_master_get_devdata(master); @@ -888,8 +888,6 @@ static int bcm63xx_hsspi_remove(struct platform_device *pdev) clk_disable_unprepare(bs->pll_clk); clk_disable_unprepare(bs->clk); sysfs_remove_group(&pdev->dev.kobj, &bcm63xx_hsspi_group); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -946,7 +944,7 @@ static struct platform_driver bcm63xx_hsspi_driver = { .of_match_table = bcm63xx_hsspi_of_match, }, .probe = bcm63xx_hsspi_probe, - .remove = bcm63xx_hsspi_remove, + .remove_new = bcm63xx_hsspi_remove, }; module_platform_driver(bcm63xx_hsspi_driver); From patchwork Fri Mar 3 17:19: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: 13159085 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 D9733C7EE3A for ; Fri, 3 Mar 2023 17:21:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231493AbjCCRVA (ORCPT ); Fri, 3 Mar 2023 12:21:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231528AbjCCRU5 (ORCPT ); Fri, 3 Mar 2023 12:20:57 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 900BB4614F for ; Fri, 3 Mar 2023 09:20:56 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95S-0006QB-NZ; Fri, 03 Mar 2023 18:20:54 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95R-001bjQ-W9; Fri, 03 Mar 2023 18:20:54 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95R-001tib-A0; Fri, 03 Mar 2023 18:20:53 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/87] spi: bcm63xx: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:26 +0100 Message-Id: <20230303172041.2103336-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1728; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=d52b3LSW7HCKrESofrSR0j6eZDk0yiEsbFZkIOL5pco=; b=owGbwMvMwMV48I9IxdpTbzgZT6slMaQwaVsIbbrJeDZMet4f1VZXHsZ9+t+Ua68dvbX105P6M j3GibGynYzGLAyMXAyyYoosdUVaYhMk1vy3K1nCDTOIlQlkCgMXpwBMRP8fB0NH5R3d72wJDBFX Vl7ikEmvVnAI+ZBqGLVLL1hP8uJUkUkTbjmaad7Y0LnPt/DX7eueC2N+Cx/8vldZqTuM31HXss1 rioDhhM61DE6C0znLeEKaHpS52ba8/VP4T8x44ZMzXoskGU/uFhHxU3EyWeSuWc541tFb5G6Zcj HjgXX8b0w9NOMdFNeHLzKYoD9jgarrv09Ff95rsp0/qiX1WP7jRNuyrrvu5S9i9LcvWGh/MZB7m q5mncdOZ0em7z/tuGb9fHVvpZhXkdjjns9mi8wOO+3i3WciZtuscnrKtZn8RoLqnxyP6NneW3VN PaSo87SlIFffYlkfy1SfL036P8RZ3uq/ybi3I+fPVzN/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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-bcm63xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index 3686d78c44a6..0a78351bfd24 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -615,7 +615,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) return ret; } -static int bcm63xx_spi_remove(struct platform_device *pdev) +static void bcm63xx_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct bcm63xx_spi *bs = spi_master_get_devdata(master); @@ -625,8 +625,6 @@ static int bcm63xx_spi_remove(struct platform_device *pdev) /* HW shutdown */ clk_disable_unprepare(bs->clk); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -670,7 +668,7 @@ static struct platform_driver bcm63xx_spi_driver = { }, .id_table = bcm63xx_spi_dev_match, .probe = bcm63xx_spi_probe, - .remove = bcm63xx_spi_remove, + .remove_new = bcm63xx_spi_remove, }; module_platform_driver(bcm63xx_spi_driver); From patchwork Fri Mar 3 17:19: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: 13159125 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 97BA1C64EC4 for ; Fri, 3 Mar 2023 17:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231467AbjCCRVW (ORCPT ); Fri, 3 Mar 2023 12:21:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231610AbjCCRVL (ORCPT ); Fri, 3 Mar 2023 12:21:11 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9351D4DBC1 for ; Fri, 3 Mar 2023 09:21:07 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95T-0006S3-SE; Fri, 03 Mar 2023 18:20:55 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95S-001bjW-Bd; Fri, 03 Mar 2023 18:20:54 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95R-001tie-Ga; Fri, 03 Mar 2023 18:20:53 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: William Zhang , Kursad Oney , Jonas Gorski , Mark Brown , Anand Gore , Florian Fainelli , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Cc: Broadcom internal kernel review list , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 13/87] spi: bcmbca-hsspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:27 +0100 Message-Id: <20230303172041.2103336-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=dkFLbpKu3gdfD/IQ0PyTwhiBt9srbLQF17HVBoJMQoA=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAis8wnpaw7eSOBRHP85D5wFXY/XM5gtpMXElV DZ582MvTraJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrPAAKCRDB/BR4rcrs CeUtB/4ijuu7UDvtgyLrpDkL11JXbUMp0gkDj0DF38kb7Qq6KwJeRPbu9J1RdYt5OlNBbBS6C/P PqBiJpByMvvB6IQq7G64d7/QGDqeVn3O9cEShBTT1zJQtU7JkLzo+rZRIsgaK1rBLbyt4JCkkaA 0aj1aW+kOVYI7agdo7G3CxY5CkWP/Bz1cfy9XHwjQ6zwlepLT3KHWP2t0AKBcsu3guil+3oiM9w o3Y1EM2CHUu/oIdDmSxQG3sX1uA9evP6ccPmN7m7la6at8AAcFvZMf8cqWw9YpS4z6TGMhvRyR/ RWHpInfJt7NN7HNEDUNvoEVQ2vUVYUBfnj7nOJPclNjhnT/t X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli --- drivers/spi/spi-bcmbca-hsspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-bcmbca-hsspi.c b/drivers/spi/spi-bcmbca-hsspi.c index 3f9e6131ad86..c7a44832bc9c 100644 --- a/drivers/spi/spi-bcmbca-hsspi.c +++ b/drivers/spi/spi-bcmbca-hsspi.c @@ -576,7 +576,7 @@ static int bcmbca_hsspi_probe(struct platform_device *pdev) return ret; } -static int bcmbca_hsspi_remove(struct platform_device *pdev) +static void bcmbca_hsspi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct bcmbca_hsspi *bs = spi_master_get_devdata(master); @@ -586,8 +586,6 @@ static int bcmbca_hsspi_remove(struct platform_device *pdev) clk_disable_unprepare(bs->pll_clk); clk_disable_unprepare(bs->clk); sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -644,7 +642,7 @@ static struct platform_driver bcmbca_hsspi_driver = { .of_match_table = bcmbca_hsspi_of_match, }, .probe = bcmbca_hsspi_probe, - .remove = bcmbca_hsspi_remove, + .remove_new = bcmbca_hsspi_remove, }; module_platform_driver(bcmbca_hsspi_driver); From patchwork Fri Mar 3 17:19: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: 13159092 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 20D40C7EE2D for ; Fri, 3 Mar 2023 17:21:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231310AbjCCRVD (ORCPT ); Fri, 3 Mar 2023 12:21:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231437AbjCCRU7 (ORCPT ); Fri, 3 Mar 2023 12:20:59 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CCDF4614F for ; Fri, 3 Mar 2023 09:20:58 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95T-0006Sy-CC; Fri, 03 Mar 2023 18:20:55 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95S-001bjc-Je; Fri, 03 Mar 2023 18:20:54 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95R-001tij-N9; Fri, 03 Mar 2023 18:20:53 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Kamal Dasu , Mark Brown , Florian Fainelli Cc: Broadcom internal kernel review list , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 14/87] spi: brcmstb-qspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:28 +0100 Message-Id: <20230303172041.2103336-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1484; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iqNUrERgLHMTT8ivhCINBCII1+ximgOKlxKLMHyYQk0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAis/jrpEglBe3ArBD4/4cb6K5gKk5nT6sQist 9khe/hKCgCJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrPwAKCRDB/BR4rcrs CQaqB/9Ogx1gFXp1VnBdCu2xQu3RIKIg1xPCVC6Nw7EdvGN8KGpvSRs3YBm4R+Lt1SWvaFW8+1r aVvowovEvNzNZXeXXOjUFivAtJSvcCH3ZXbPvNPc2MxzOaiGfQ+u7o347N7tvPQji3Ym7lQ7+a9 pOkiETgLktw6pIxm65brPmpvZufA5gPjA+aymeCf4ou/Gzf1ski86ghUvN7eiCDgux5isBs7HT5 GRZke0tYZHYKVXy0/9WXc1LsCDXNumu23PFD3nPbGeBp6OkgtRJ0uV4lFT0kSJSOL78sR0ASB2s xM4a+tVRxgitT84pNjTSGhsDEjWwf7vvlcU/x1HSxYFUPBnr X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli --- drivers/spi/spi-brcmstb-qspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-brcmstb-qspi.c b/drivers/spi/spi-brcmstb-qspi.c index de362b35718f..e1b137419f5c 100644 --- a/drivers/spi/spi-brcmstb-qspi.c +++ b/drivers/spi/spi-brcmstb-qspi.c @@ -21,16 +21,14 @@ static int brcmstb_qspi_probe(struct platform_device *pdev) return bcm_qspi_probe(pdev, NULL); } -static int brcmstb_qspi_remove(struct platform_device *pdev) +static void brcmstb_qspi_remove(struct platform_device *pdev) { bcm_qspi_remove(pdev); - - return 0; } static struct platform_driver brcmstb_qspi_driver = { .probe = brcmstb_qspi_probe, - .remove = brcmstb_qspi_remove, + .remove_new = brcmstb_qspi_remove, .driver = { .name = "brcmstb_qspi", .pm = &bcm_qspi_pm_ops, From patchwork Fri Mar 3 17:19: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: 13159086 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 6D8E8C7EE39 for ; Fri, 3 Mar 2023 17:21:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231528AbjCCRVA (ORCPT ); Fri, 3 Mar 2023 12:21:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231531AbjCCRU6 (ORCPT ); Fri, 3 Mar 2023 12:20:58 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 828E443937 for ; Fri, 3 Mar 2023 09:20:57 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95T-0006Tn-S7; Fri, 03 Mar 2023 18:20:55 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95T-001bjl-1i; Fri, 03 Mar 2023 18:20:55 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95R-001tio-Tn; Fri, 03 Mar 2023 18:20:53 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 15/87] spi: cadence-quadspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:29 +0100 Message-Id: <20230303172041.2103336-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1701; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=TR8WisYWFs3XU5g3YNSGElNFC45fcZhaaPWGy9JEijo=; b=owGbwMvMwMV48I9IxdpTbzgZT6slMaQwaTszyB8P8Wmdp6StN/WTgUnW95S1e80d5b/bff0rJ TV30ifvTkZjFgZGLgZZMUWWuiItsQkSa/7blSzhhhnEygQ2hYtTACZSf4CDodfMW/yNS8iJC7aM +5fJVQd3NsiqPzmhdbhqudOvj/MXLmsXnf7/lF9/lvCvGRzSTmGx8Z7qE9aWGB/3XjX/4g4uRgX TwnsRyk0CeiqledLTnnNFL559chJT6n2xM5oOK8WYZfLO+spoCUewmuY8XHAqzqZWRflDi/12I4 5gtgsJJzp4Eq1jTF78n8P3b4O5SoHIJ5OWgKxjh7+KzvWcktfBkCm5+9CT7FWHOy3ffzC9XDz38 RUpBnMrHfuLIZtZfpRsXRy4KbtedMoJadmKlSeynbecenpH06y0r+vHPnum1Su7lq1dVNseeTpu 7zHfByfvLlhTdmTaDtWZJ88/uCCU5BAjxbzuyn+1CfWXAQ== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-cadence-quadspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index 64b6a460d739..c58c36fc2b36 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -1784,7 +1784,7 @@ static int cqspi_probe(struct platform_device *pdev) return ret; } -static int cqspi_remove(struct platform_device *pdev) +static void cqspi_remove(struct platform_device *pdev) { struct cqspi_st *cqspi = platform_get_drvdata(pdev); @@ -1798,8 +1798,6 @@ static int cqspi_remove(struct platform_device *pdev) pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1891,7 +1889,7 @@ MODULE_DEVICE_TABLE(of, cqspi_dt_ids); static struct platform_driver cqspi_platform_driver = { .probe = cqspi_probe, - .remove = cqspi_remove, + .remove_new = cqspi_remove, .driver = { .name = CQSPI_NAME, .pm = CQSPI_DEV_PM_OPS, From patchwork Fri Mar 3 17:19: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: 13159087 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 5DD30C64EC4 for ; Fri, 3 Mar 2023 17:21:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231567AbjCCRVB (ORCPT ); Fri, 3 Mar 2023 12:21:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231482AbjCCRU6 (ORCPT ); Fri, 3 Mar 2023 12:20:58 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B0204391F for ; Fri, 3 Mar 2023 09:20:57 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95T-0006TT-NM; Fri, 03 Mar 2023 18:20:55 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95S-001bjh-VK; Fri, 03 Mar 2023 18:20:54 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95S-001tis-48; Fri, 03 Mar 2023 18:20:54 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 16/87] spi: cadence: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:30 +0100 Message-Id: <20230303172041.2103336-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1849; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=lR7OfpjuDS7mGvl0HIqntcIllQ83+CE82PtB9P6xCJw=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAitHiWBnp+h824X/8iuCE9bGUncUzdLdMQHaW 0zbryTl3x6JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrRwAKCRDB/BR4rcrs CcH0CACQQw/qvWZAtX83dIQefSRXvaYT8SHGWal7mvGcRMwB6mVge6V+n1qSlXhzcgP/Uk2QfBR yCECvnfoEGx1Uk+RO1RkkFNqnzIfK+dFdywmdQHVL1jsSt8sh/6/d0XVzNSMI7BgEhZIGWexYGq 4AsJLERkBVYMCNHHQ5/kjNYUYF31UUpFryDUZsD0nKQCAmCwZ77omIkKgcvAsq+ueQc1b+Ljs+t kfQdDqULQAarDlAIVLMvkECIK8AxzFeLfzi6ZHuJHi+k+8nRhGD+Mm4rkYsZUzdSVf3YiVrhkGu yOmD1zNA/fTexMdvXqHK+yho80L6LfrOv8jNbgjkGugRoFF7 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-cadence.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c index 6a7f7df1e776..1ad86e5d2b2f 100644 --- a/drivers/spi/spi-cadence.c +++ b/drivers/spi/spi-cadence.c @@ -625,7 +625,7 @@ static int cdns_spi_probe(struct platform_device *pdev) * * Return: 0 on success and error value on error */ -static int cdns_spi_remove(struct platform_device *pdev) +static void cdns_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct cdns_spi *xspi = spi_master_get_devdata(master); @@ -638,8 +638,6 @@ static int cdns_spi_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); spi_unregister_master(master); - - return 0; } /** @@ -739,7 +737,7 @@ MODULE_DEVICE_TABLE(of, cdns_spi_of_match); /* cdns_spi_driver - This structure defines the SPI subsystem platform driver */ static struct platform_driver cdns_spi_driver = { .probe = cdns_spi_probe, - .remove = cdns_spi_remove, + .remove_new = cdns_spi_remove, .driver = { .name = CDNS_SPI_NAME, .of_match_table = cdns_spi_of_match, From patchwork Fri Mar 3 17:19: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: 13159089 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 59844C7EE32 for ; Fri, 3 Mar 2023 17:21:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230073AbjCCRVC (ORCPT ); Fri, 3 Mar 2023 12:21:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231545AbjCCRU6 (ORCPT ); Fri, 3 Mar 2023 12:20:58 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82AE9457FE for ; Fri, 3 Mar 2023 09:20:57 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95T-0006Tx-RA; Fri, 03 Mar 2023 18:20:55 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95T-001bjm-2c; Fri, 03 Mar 2023 18:20:55 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95S-001tiv-AN; Fri, 03 Mar 2023 18:20:54 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 17/87] spi: cavium-octeon: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:31 +0100 Message-Id: <20230303172041.2103336-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1759; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=WH4xobIbZg7Pc/Vcft7cCE88VD9qyGgTofFN6HhsKB0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAitK1mC8wIKGO6iTqc3kAqd9E5wrFuJyD6ps8 hqe+8TyOAmJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrSgAKCRDB/BR4rcrs CZ5kB/9afMKjAB7gAN6ytshLqMhCbZiipAOAElusrp9lLjWNV8Rh2TDb6Io29UD4hAHPccJ0SXX UycL04wXFZ7bM8sGhDViogFj22AMSfJxudCf+k3syE+ifB6n+42bUkgR4OtaakjLF4weqNLSWvP 0pDcC3TfWRhOZ491vu5Z9a12tYF20tQgSJ1fI5JyiR399SHxfPPB+vtUSjjHf8apINe12OqxhM5 Q/5KlPub5CF5hEWxG1q+LM9pK2Ry5wqo9VZ+mc5QkoxRFJDMLss5TgY5tJn72vZL/LlETbYanlo N5rOJvNDgDbuMK4i4qA+EkPfXhRRxAws1+ugNzgoh/2GZfgb X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-cavium-octeon.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-cavium-octeon.c b/drivers/spi/spi-cavium-octeon.c index 1a2de6ce9064..58060be33106 100644 --- a/drivers/spi/spi-cavium-octeon.c +++ b/drivers/spi/spi-cavium-octeon.c @@ -69,15 +69,13 @@ static int octeon_spi_probe(struct platform_device *pdev) return err; } -static int octeon_spi_remove(struct platform_device *pdev) +static void octeon_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct octeon_spi *p = spi_master_get_devdata(master); /* Clear the CSENA* and put everything in a known state. */ writeq(0, p->register_base + OCTEON_SPI_CFG(p)); - - return 0; } static const struct of_device_id octeon_spi_match[] = { @@ -92,7 +90,7 @@ static struct platform_driver octeon_spi_driver = { .of_match_table = octeon_spi_match, }, .probe = octeon_spi_probe, - .remove = octeon_spi_remove, + .remove_new = octeon_spi_remove, }; module_platform_driver(octeon_spi_driver); From patchwork Fri Mar 3 17:19: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: 13159088 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 C1409C7EE43 for ; Fri, 3 Mar 2023 17:21:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231580AbjCCRVB (ORCPT ); Fri, 3 Mar 2023 12:21:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230073AbjCCRU6 (ORCPT ); Fri, 3 Mar 2023 12:20:58 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDFB74616A for ; Fri, 3 Mar 2023 09:20:57 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95U-0006Uy-7O; Fri, 03 Mar 2023 18:20:56 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95T-001bjx-HC; Fri, 03 Mar 2023 18:20:55 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95S-001tiz-Gu; Fri, 03 Mar 2023 18:20:54 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 18/87] spi: coldfire-qspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:32 +0100 Message-Id: <20230303172041.2103336-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1760; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iMVUpsYO0UWfu5eoNoh+k0vZnRxkfMP25Slkk4CHu5k=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAitO8TYUMvabs5oJ2sWjPoHi8zoGeb4HEQelM TLXEgMa5PyJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrTgAKCRDB/BR4rcrs CWRvCACdrE/VqBk7gxoghdMSuaJTrR+srFV0+3WKq3izQ+2TCNEwdmMN26E/98myVD5DPPeZq7U vVqSp2j7xG7hhhHB6JhgjOLACdBci0U6VVBgwqvx8eNhimsG766/GTt+wKf4gy0HyONtfGfyMmp 26l/SFMEt3UQgSOe7oVWqUX8iaHjSbHhiukvMkavQ5j/FSMrK2bhmf4exQ+CCnh7VGEEAbK0YrB QpQ1iJ8nCdvLwJP7yYyOrgKobji9wZG/NnN5KPZghpOxXQljS0nM5yndqXiSYcNlZtXqIoeky2p 7KRJxKmNYRu029wQsYXT51Puc3HjPDwWVKScHPpmVejurXXD X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-coldfire-qspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index 263ce9047327..d98e74c6e4b2 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c @@ -434,7 +434,7 @@ static int mcfqspi_probe(struct platform_device *pdev) return status; } -static int mcfqspi_remove(struct platform_device *pdev) +static void mcfqspi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct mcfqspi *mcfqspi = spi_master_get_devdata(master); @@ -445,8 +445,6 @@ static int mcfqspi_remove(struct platform_device *pdev) mcfqspi_cs_teardown(mcfqspi); clk_disable_unprepare(mcfqspi->clk); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -509,7 +507,7 @@ static struct platform_driver mcfqspi_driver = { .driver.owner = THIS_MODULE, .driver.pm = &mcfqspi_pm, .probe = mcfqspi_probe, - .remove = mcfqspi_remove, + .remove_new = mcfqspi_remove, }; module_platform_driver(mcfqspi_driver); From patchwork Fri Mar 3 17:19: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: 13159093 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 11DFCC7EE39 for ; Fri, 3 Mar 2023 17:21:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231552AbjCCRVE (ORCPT ); Fri, 3 Mar 2023 12:21:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231508AbjCCRU7 (ORCPT ); Fri, 3 Mar 2023 12:20:59 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB1AA4391F for ; Fri, 3 Mar 2023 09:20:58 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95U-0006XL-Jz; Fri, 03 Mar 2023 18:20:56 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95U-001bkA-08; Fri, 03 Mar 2023 18:20:56 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95S-001tj3-NM; Fri, 03 Mar 2023 18:20:54 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 19/87] spi: davinci: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:33 +0100 Message-Id: <20230303172041.2103336-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=Qgv82uBfeGvii1PwmBy8aWWKTtE61twqezpOLMTbWEI=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAitRPMgTOsB1zd5aPEI5JUPjbpun2bJWTcQ0m eMf9gy/C46JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrUQAKCRDB/BR4rcrs CaXWB/9MK6WcDFAY78/Q2NVx27Ipz0MpEMk1cLY2oXn65ERtGWQHyXYaEkkzDppGv1ztehumj6g xSktF9e5LJrF36qEBEfs8nz6Axd997zOFw4DzHPd1B10ldzzji17LODYGfd5rkZXD/GM8DAHOGY ox0NmPb12mKSQgUTYXpkJjVVhtIj0ZHinU2dHGfGL42X8cmaUj9TYa05kXvDgivkY/6qVFLseGe BaRgXT+k86fKxwpELlEPnfQhBTvj6mMVLq+hHJklsHS2IbmxSt450kcEopgeBPtTRsu9U7yySmL w3HYo0QvwBZ5EoazNXQOQbfuXv4tVhjWq0aFac//tnay9cp8 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-davinci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index d112c2cac042..add1e198a439 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -1018,7 +1018,7 @@ static int davinci_spi_probe(struct platform_device *pdev) * It will also call spi_bitbang_stop to destroy the work queue which was * created by spi_bitbang_start. */ -static int davinci_spi_remove(struct platform_device *pdev) +static void davinci_spi_remove(struct platform_device *pdev) { struct davinci_spi *dspi; struct spi_master *master; @@ -1036,7 +1036,6 @@ static int davinci_spi_remove(struct platform_device *pdev) } spi_master_put(master); - return 0; } static struct platform_driver davinci_spi_driver = { @@ -1045,7 +1044,7 @@ static struct platform_driver davinci_spi_driver = { .of_match_table = of_match_ptr(davinci_spi_of_match), }, .probe = davinci_spi_probe, - .remove = davinci_spi_remove, + .remove_new = davinci_spi_remove, }; module_platform_driver(davinci_spi_driver); From patchwork Fri Mar 3 17:19: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: 13159090 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 A95D6C7EE2F for ; Fri, 3 Mar 2023 17:21:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231585AbjCCRVD (ORCPT ); Fri, 3 Mar 2023 12:21:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231310AbjCCRU7 (ORCPT ); Fri, 3 Mar 2023 12:20:59 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CFDE4392E for ; Fri, 3 Mar 2023 09:20:58 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95U-0006Vt-ES; Fri, 03 Mar 2023 18:20:56 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95T-001bk3-Qs; Fri, 03 Mar 2023 18:20:55 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95S-001tj6-U1; Fri, 03 Mar 2023 18:20:54 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 20/87] spi: dln2: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:34 +0100 Message-Id: <20230303172041.2103336-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1715; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=o4dbhtYbf6EvlKOld+Vr41XaPZ3K2kF/xDi+oYZovAs=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAitWIPPHrl8S2U7TND74sZA5PGMzmi+NmKz9d xjNzLxzfk6JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrVgAKCRDB/BR4rcrs CY39CACIG/dVGTNTjI33OG2Gu9pTHQgghOfCfUXn/HEsYnrtk4qi2uRsZZiexZzCPB0tU9Yt5QJ vATFufYCVgNvB7woEWc41LEFLk9VZHfRb0as3dQ+ugW1f875xPkRopLX0ZUTMxx/9NvBtXMSmvn zGtmqNozPxUovk3MJrWDIX99rBf+JKHs4R77xKDhWZV1Y7aGtLL2NjZO4SlGaI5r0iuXitg9kuO qPok8AQx0R6W8AgkT+w8/gZIJ+6hXufVI79vArQ062Grlw2BAoXYrBhAkjDrJF5mF3PH0IkO+ik MwLGBUiJlyUSEe5jdDDQkw9O+t+ECgRsdXl2w4LHA4b+5X8f X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-dln2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-dln2.c b/drivers/spi/spi-dln2.c index 0a1fb2bc9e54..821bfc6b0dd6 100644 --- a/drivers/spi/spi-dln2.c +++ b/drivers/spi/spi-dln2.c @@ -781,7 +781,7 @@ static int dln2_spi_probe(struct platform_device *pdev) return ret; } -static int dln2_spi_remove(struct platform_device *pdev) +static void dln2_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct dln2_spi *dln2 = spi_master_get_devdata(master); @@ -790,8 +790,6 @@ static int dln2_spi_remove(struct platform_device *pdev) if (dln2_spi_enable(dln2, false) < 0) dev_err(&pdev->dev, "Failed to disable SPI module\n"); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -873,7 +871,7 @@ static struct platform_driver spi_dln2_driver = { .pm = &dln2_spi_pm, }, .probe = dln2_spi_probe, - .remove = dln2_spi_remove, + .remove_new = dln2_spi_remove, }; module_platform_driver(spi_dln2_driver); From patchwork Fri Mar 3 17:19: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: 13159098 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 81271C7EE2D for ; Fri, 3 Mar 2023 17:21:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231531AbjCCRVG (ORCPT ); Fri, 3 Mar 2023 12:21:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231482AbjCCRVB (ORCPT ); Fri, 3 Mar 2023 12:21:01 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1F624743A for ; Fri, 3 Mar 2023 09:20:59 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95V-0006YC-4p; Fri, 03 Mar 2023 18:20:57 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95U-001bkG-7S; Fri, 03 Mar 2023 18:20:56 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95T-001tjA-49; Fri, 03 Mar 2023 18:20:55 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Serge Semin , Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 21/87] spi: dw-bt1: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:35 +0100 Message-Id: <20230303172041.2103336-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1749; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=f8XDAdS8N+Ob/WMdOU1gTk09nlxqgYFvHk5Y154sA1I=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAitaHFfKWnyxrTOrAGs5s+qvatmzxeIa9n1ef Qo2HocG8cKJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrWgAKCRDB/BR4rcrs CchEB/oD2OM8YxsvqTW43mVuTeUrh8cc02Z+zbyQgBCNymrvJSnWNY7ESzI4JSnwE7MCe4fgS5Q rsFycJ4j7Z1GPB2XYrlWqVwGGqIKaIHUywBsD8uBmF0UFgv2XN2/xscAVuBZtoj7/RNN3ShEk6v FIUNV/rEr/CK0t7lwJggRoS1L+Lnk72Mpb26UVurSwtgLMgK352v2XLw/UBVcZkn1/Dw3E4c4T+ QtfmZQ3mhlw0ew9ijh93aLK8SBejPH6+SlNpzKoA8gF2AF5hcjSLt3h+jKn4r9NhhZ6VCbFUjRR sE/JpfiSPeLhZKYarXdGlX/EmNlv4MpFSoHRAHTB7mONyj9k X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Serge Semin --- drivers/spi/spi-dw-bt1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-dw-bt1.c b/drivers/spi/spi-dw-bt1.c index 3fb89dee595e..5e1c01822967 100644 --- a/drivers/spi/spi-dw-bt1.c +++ b/drivers/spi/spi-dw-bt1.c @@ -308,7 +308,7 @@ static int dw_spi_bt1_probe(struct platform_device *pdev) return ret; } -static int dw_spi_bt1_remove(struct platform_device *pdev) +static void dw_spi_bt1_remove(struct platform_device *pdev) { struct dw_spi_bt1 *dwsbt1 = platform_get_drvdata(pdev); @@ -317,8 +317,6 @@ static int dw_spi_bt1_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); clk_disable_unprepare(dwsbt1->clk); - - return 0; } static const struct of_device_id dw_spi_bt1_of_match[] = { @@ -330,7 +328,7 @@ MODULE_DEVICE_TABLE(of, dw_spi_bt1_of_match); static struct platform_driver dw_spi_bt1_driver = { .probe = dw_spi_bt1_probe, - .remove = dw_spi_bt1_remove, + .remove_new = dw_spi_bt1_remove, .driver = { .name = "bt1-sys-ssi", .of_match_table = dw_spi_bt1_of_match, From patchwork Fri Mar 3 17:19: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: 13159096 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 8E065C64EC4 for ; Fri, 3 Mar 2023 17:21:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231485AbjCCRVF (ORCPT ); Fri, 3 Mar 2023 12:21:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231559AbjCCRVB (ORCPT ); Fri, 3 Mar 2023 12:21:01 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE17D47438 for ; Fri, 3 Mar 2023 09:20:59 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95V-0006Y4-4v; Fri, 03 Mar 2023 18:20:57 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95U-001bkE-5s; Fri, 03 Mar 2023 18:20:56 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95T-001tjF-Am; Fri, 03 Mar 2023 18:20:55 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Serge Semin , Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 22/87] spi: dw-mmio: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:36 +0100 Message-Id: <20230303172041.2103336-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1815; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=u7yioAjzjn0qL61N6s+g0jRCkgp/b3DGJas8MlRKTNo=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAitetPQdvqgeP+pMw1Z+2omcSK9TlFex+UWDQ SFLo0UgJBaJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrXgAKCRDB/BR4rcrs CRQmB/4ySFYloQihGvd3/sKezUvbGSnFr5icQFYjHdePFk07CH0NzmO8DNwcaS6GA907j+NWa+S I6qC1lMmPND5hnpy80wUe6CIff4YKwmdTP6GdkUd7h7xHWthgoF6n7cEIMWsU/5NDoMFzFvV4Nh LMvgh/mrgCzBlNkooNQL1IkEJMXu3YJtvZZKgzrMtV3iGoUIsxYPPh55s65RNiUNdRP60vLGiui MtE1D2gIFq4/XRpNDWPRdI8bQdR5Dm4gT4t63/Q3mWoiV7eQchM+XMllrtP3Jlhv0GojU53Bmwq 55Q/XJBm8bRZxDRv9sxUmFuD8ZyQ7LGJYbBGLzOX7FWX+Fxk X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Serge Semin --- drivers/spi/spi-dw-mmio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index 26c40ea6dd12..6ae124c30969 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c @@ -328,7 +328,7 @@ static int dw_spi_mmio_probe(struct platform_device *pdev) return ret; } -static int dw_spi_mmio_remove(struct platform_device *pdev) +static void dw_spi_mmio_remove(struct platform_device *pdev) { struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev); @@ -337,8 +337,6 @@ static int dw_spi_mmio_remove(struct platform_device *pdev) clk_disable_unprepare(dwsmmio->pclk); clk_disable_unprepare(dwsmmio->clk); reset_control_assert(dwsmmio->rstc); - - return 0; } static const struct of_device_id dw_spi_mmio_of_match[] = { @@ -366,7 +364,7 @@ MODULE_DEVICE_TABLE(acpi, dw_spi_mmio_acpi_match); static struct platform_driver dw_spi_mmio_driver = { .probe = dw_spi_mmio_probe, - .remove = dw_spi_mmio_remove, + .remove_new = dw_spi_mmio_remove, .driver = { .name = DRIVER_NAME, .of_match_table = dw_spi_mmio_of_match, From patchwork Fri Mar 3 17:19: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: 13159097 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 404BAC7EE37 for ; Fri, 3 Mar 2023 17:21:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231559AbjCCRVG (ORCPT ); Fri, 3 Mar 2023 12:21:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231531AbjCCRVB (ORCPT ); Fri, 3 Mar 2023 12:21:01 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C49AB4392E for ; Fri, 3 Mar 2023 09:20:59 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95V-0006YA-9U; Fri, 03 Mar 2023 18:20:57 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95U-001bkF-63; Fri, 03 Mar 2023 18:20:56 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95T-001tjI-HY; Fri, 03 Mar 2023 18:20:55 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 23/87] spi: ep93xx: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:37 +0100 Message-Id: <20230303172041.2103336-24-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1633; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=gGENnXa5K3SeofjaHQbQSrqdZm1uOjLI2C8msiWktNo=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAitiQbweGwzQqMjRWEAaWOj1g8PyWy4zqejRE AqjxoWtqyiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrYgAKCRDB/BR4rcrs CYt3CACfDQd2DoCChZezNmy+pSqDrqPdqEoHOACPty3dvuxn/0S0xRoLW5MfmS78Zl6IrzP1ffp 5afBlz88ye5GuvtMQpJWpJj943JmRv0hIYcuwM0ZDPMEGBFuB0LvAZQKkQLlL4rR6SWWzd5ktI+ o7OvOfj3gloCmn/K0pHvv8iftOMxHk4dB+D/c9PRSVWSOjjWF1Xdik08qZ67eA8R5l0wBmqMce6 vlGXBg9HYCJM9uVhW/Vy3pHHAtaWsIbY89XWTdPK+LAyd6+BfbjGWBZyyZNL28hlZ3wA/DCP3Bx yGbuiHjFK8b5f2AKHRBBm1nGmzJrBsTxBzUeQ9Z9/HjW0z9s X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-ep93xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c index 5896a7b2fade..1615fd22f9a2 100644 --- a/drivers/spi/spi-ep93xx.c +++ b/drivers/spi/spi-ep93xx.c @@ -745,14 +745,12 @@ static int ep93xx_spi_probe(struct platform_device *pdev) return error; } -static int ep93xx_spi_remove(struct platform_device *pdev) +static void ep93xx_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct ep93xx_spi *espi = spi_master_get_devdata(master); ep93xx_spi_release_dma(espi); - - return 0; } static struct platform_driver ep93xx_spi_driver = { @@ -760,7 +758,7 @@ static struct platform_driver ep93xx_spi_driver = { .name = "ep93xx-spi", }, .probe = ep93xx_spi_probe, - .remove = ep93xx_spi_remove, + .remove_new = ep93xx_spi_remove, }; module_platform_driver(ep93xx_spi_driver); From patchwork Fri Mar 3 17:19: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: 13159099 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 00188C7EE39 for ; Fri, 3 Mar 2023 17:21:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231482AbjCCRVH (ORCPT ); Fri, 3 Mar 2023 12:21:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231572AbjCCRVB (ORCPT ); Fri, 3 Mar 2023 12:21:01 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57BCF4616A for ; Fri, 3 Mar 2023 09:21:00 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95V-0006YW-AV; Fri, 03 Mar 2023 18:20:57 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95U-001bkP-CM; Fri, 03 Mar 2023 18:20:56 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95T-001tjM-N3; Fri, 03 Mar 2023 18:20:55 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vladimir Oltean , Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 24/87] spi: fsl-dspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:38 +0100 Message-Id: <20230303172041.2103336-25-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1730; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=UdbM5NBlOoMM3H1z1Gp+Qt0caUqPfzSKBz4qOy7uAD8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAitm79N5SnoFWRqVhSMwJ1weLxRlZuLNRabM9 R6z2R3loASJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrZgAKCRDB/BR4rcrs CRfiB/4wSbjsv1c0ct7VB5qYZduUO0JWQ1xW4V9jdZQ4yXNPvp3Qc8YhqCAt82/ADPJroYS7ZIg pDhmjPDfjbVlLCRTm3bsfyrJiAvCveXWlgLM1uq/dS2y0UUk1YM77ueckZaATYvsMORjnpHxKG/ TmVNvdaHJjYhMkQqtec8SQI3WPxUGdxa4jqcbyeP7PG+wN8rL3PAHyrp8O1GJeHG5MIRLzgpF3Z 9tDDgv+9+GUzDEvRuUBKUD6CVmTwpr7v6/dT5/Rsfa427cxREGbcI7fY47ckQDygV+22nyfDx+E vbtIDVH4M5YJLU4rGhQ/QvWOq+yfy4VHGFEfliOiVouFSt32 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-fsl-dspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index e419642eb10e..49df00f52ea4 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -1425,7 +1425,7 @@ static int dspi_probe(struct platform_device *pdev) return ret; } -static int dspi_remove(struct platform_device *pdev) +static void dspi_remove(struct platform_device *pdev) { struct fsl_dspi *dspi = platform_get_drvdata(pdev); @@ -1444,8 +1444,6 @@ static int dspi_remove(struct platform_device *pdev) if (dspi->irq) free_irq(dspi->irq, dspi); clk_disable_unprepare(dspi->clk); - - return 0; } static void dspi_shutdown(struct platform_device *pdev) @@ -1459,7 +1457,7 @@ static struct platform_driver fsl_dspi_driver = { .driver.owner = THIS_MODULE, .driver.pm = &dspi_pm, .probe = dspi_probe, - .remove = dspi_remove, + .remove_new = dspi_remove, .shutdown = dspi_shutdown, }; module_platform_driver(fsl_dspi_driver); From patchwork Fri Mar 3 17:19: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: 13159101 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 73943C7EE2F for ; Fri, 3 Mar 2023 17:21:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230383AbjCCRVI (ORCPT ); Fri, 3 Mar 2023 12:21:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231570AbjCCRVB (ORCPT ); Fri, 3 Mar 2023 12:21:01 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 322404614F for ; Fri, 3 Mar 2023 09:21:00 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95V-0006a2-QO; Fri, 03 Mar 2023 18:20:57 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95U-001bkU-IM; Fri, 03 Mar 2023 18:20:56 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95T-001tjP-SS; Fri, 03 Mar 2023 18:20:55 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 25/87] spi: fsl-espi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:39 +0100 Message-Id: <20230303172041.2103336-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1519; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=fRRmTcKO5fDRcWLdl9DEjguSkmENu0zaEHzJcgRgX9A=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAitrmP39+VbD92KP1siZYtP+ORxiYuIPu8HXZ lQcC5wRoKyJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrawAKCRDB/BR4rcrs CcF/B/4kORa4550x65Aec5dCdU66oTrFsDuhvHVE0PbZvVu6Qdjivtk5ZUTQ0XHUzAuTakt1Kgc oW7hhh35o1pxJq356eOE9tEKDSnOiKw0rIA2Y3q1LXfm5c7boEIoBF1U6bI0YidhKIgLI4lpK9q biD6EvkKuaSTP04rvKZ0S8Gm0mub4XIs2f97OTx6pSjE+i+xrwCQUvaGyDCjd8coO10ZAzMnepX eJRgvwVgPBASuo13v18Y1w1GstVLS+16xlZdYcWeoAt9cuFHcWAiHfVEmjTDkJ5Itp2r5XM0lej 97/7Gnr+f1eNch0IWep1Mg6zrRN3Z6JBhA8DNuXC+nAr/BTZ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-fsl-espi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index f7066bef7b06..42a3ed79e7dc 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -783,11 +783,9 @@ static int of_fsl_espi_probe(struct platform_device *ofdev) return fsl_espi_probe(dev, &mem, irq, num_cs); } -static int of_fsl_espi_remove(struct platform_device *dev) +static void of_fsl_espi_remove(struct platform_device *dev) { pm_runtime_disable(&dev->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -837,7 +835,7 @@ static struct platform_driver fsl_espi_driver = { .pm = &espi_pm, }, .probe = of_fsl_espi_probe, - .remove = of_fsl_espi_remove, + .remove_new = of_fsl_espi_remove, }; module_platform_driver(fsl_espi_driver); From patchwork Fri Mar 3 17:19: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: 13159100 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 F03AFC7EE32 for ; Fri, 3 Mar 2023 17:21:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231599AbjCCRVI (ORCPT ); Fri, 3 Mar 2023 12:21:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230383AbjCCRVB (ORCPT ); Fri, 3 Mar 2023 12:21:01 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD8E947412 for ; Fri, 3 Mar 2023 09:20:59 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95V-0006bq-Qi; Fri, 03 Mar 2023 18:20:57 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95U-001bkZ-S7; Fri, 03 Mar 2023 18:20:56 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95U-001tjT-1Z; Fri, 03 Mar 2023 18:20:56 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 26/87] spi: fsl-lpspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:40 +0100 Message-Id: <20230303172041.2103336-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1750; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=wC7ikng/GClphiubIDcXxHns/PSHF9AfuaU+zgrgOVM=; b=owGbwMvMwMV48I9IxdpTbzgZT6slMaQwaee7N8zuzXA9wCHmKGSuuc1T5Qe7e/WzZXnH5nnlG XRd38rfyWjMwsDIxSArpshSV6QlNkFizX+7kiXcMINYmUCmMHBxCsBEwi+w/7Pwuvv6vFF/qLns Bp65BclLsraWafs+/2we/lnP79AFj/xJnFXByVn96VZ5ZVENq5RlY6ce81vE5tivvv2+Y/6n7fW bf6/ekWdlXbrgy0y7HebRpqIl+ubHot8bPXJZLbDBK/d04PupbdGmIg9Uz2swz1B9IJRu8iLjFq eH9F/By58Z5sXdiJu129f0pCW3X/bCrO+WNvY7Zpl8ckl0XHqnt2BOhdiaEO11Mr5mepM31/9d1 HE4d/k7209ljNWli+oWTMwNiL/L2W0WLi1Qdvn9hSfbm5a/PWzWcU3l6Jv+U2XCyfUqr1btyuAK 4znKoypYxFrndWfq1tmfF5yflygv99iB7f08x7n9aZOqAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-fsl-lpspi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index 34488de55587..b9e8b7b241a4 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -937,7 +937,7 @@ static int fsl_lpspi_probe(struct platform_device *pdev) return ret; } -static int fsl_lpspi_remove(struct platform_device *pdev) +static void fsl_lpspi_remove(struct platform_device *pdev) { struct spi_controller *controller = platform_get_drvdata(pdev); struct fsl_lpspi_data *fsl_lpspi = @@ -946,7 +946,6 @@ static int fsl_lpspi_remove(struct platform_device *pdev) fsl_lpspi_dma_exit(controller); pm_runtime_disable(fsl_lpspi->dev); - return 0; } static int __maybe_unused fsl_lpspi_suspend(struct device *dev) @@ -983,7 +982,7 @@ static struct platform_driver fsl_lpspi_driver = { .pm = &fsl_lpspi_pm_ops, }, .probe = fsl_lpspi_probe, - .remove = fsl_lpspi_remove, + .remove_new = fsl_lpspi_remove, }; module_platform_driver(fsl_lpspi_driver); From patchwork Fri Mar 3 17:19: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: 13159104 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 6AE20C7EE3A for ; Fri, 3 Mar 2023 17:21:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231586AbjCCRVK (ORCPT ); Fri, 3 Mar 2023 12:21:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231545AbjCCRVD (ORCPT ); Fri, 3 Mar 2023 12:21:03 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03DCC46173 for ; Fri, 3 Mar 2023 09:21:02 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95W-0006bz-Ab; Fri, 03 Mar 2023 18:20:58 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95U-001bka-T0; Fri, 03 Mar 2023 18:20:56 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95U-001tjX-6x; Fri, 03 Mar 2023 18:20:56 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Han Xu , Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 27/87] spi: fsl-qspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:41 +0100 Message-Id: <20230303172041.2103336-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1675; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OG7KVl7jCwglTWEq5HL0TJfrcL8BZmrhw8RGNA1CvI0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAitzuadlcNOKvf/T7FbEWEzrqkfIZg7ZZO9dS Ypw3LILqxWJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrcwAKCRDB/BR4rcrs CSviCACgBE2atzbCSv1FqgP/kfc454d4Q1F6VvGakY3yTispAc5yaXAwRNFwOdLDTlLA3ZfLj9D RQ9Lwn8wK8rRzuhLzYbddaKgLGuyvU9agpi+loRmgvqIA/YmPFO2dJwtuKZ6f5lUHY4sln0Eskg NWvKfTRZBA3sqakiZaVO076gbFJ017gNVk/TnQCtfJXii2kg00QIquygrLCBBcCtq4QHjgffSpP QXX2cBRqhwVRQWx4IdL9FsWPOowQFuoqdrE3kv676g1MVXhfFa8iv8eXhKfW2ebzC3i/1zTZ3Ag zBprCRIO3GeHqVDR8a4/vBcRpe8kFfqZ9HMq5wdiXdeYplyo X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-fsl-qspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c index 85cc71ba624a..bacc54836959 100644 --- a/drivers/spi/spi-fsl-qspi.c +++ b/drivers/spi/spi-fsl-qspi.c @@ -948,7 +948,7 @@ static int fsl_qspi_probe(struct platform_device *pdev) return ret; } -static int fsl_qspi_remove(struct platform_device *pdev) +static void fsl_qspi_remove(struct platform_device *pdev) { struct fsl_qspi *q = platform_get_drvdata(pdev); @@ -959,8 +959,6 @@ static int fsl_qspi_remove(struct platform_device *pdev) fsl_qspi_clk_disable_unprep(q); mutex_destroy(&q->lock); - - return 0; } static int fsl_qspi_suspend(struct device *dev) @@ -1000,7 +998,7 @@ static struct platform_driver fsl_qspi_driver = { .pm = &fsl_qspi_pm_ops, }, .probe = fsl_qspi_probe, - .remove = fsl_qspi_remove, + .remove_new = fsl_qspi_remove, }; module_platform_driver(fsl_qspi_driver); From patchwork Fri Mar 3 17:19: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: 13159102 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 E8440C7EE2D for ; Fri, 3 Mar 2023 17:21:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231579AbjCCRVJ (ORCPT ); Fri, 3 Mar 2023 12:21:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231574AbjCCRVB (ORCPT ); Fri, 3 Mar 2023 12:21:01 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C51674391F for ; Fri, 3 Mar 2023 09:21:00 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95W-0006eZ-5r; Fri, 03 Mar 2023 18:20:58 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95V-001bkk-9M; Fri, 03 Mar 2023 18:20:57 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95U-001tjc-FZ; Fri, 03 Mar 2023 18:20:56 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 28/87] spi: fsl-spi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:42 +0100 Message-Id: <20230303172041.2103336-29-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2364; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hmg5lldFXNC6gC/mhQPTWRJjVxrUUUWHibI0hK4cTZY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAit3ftOpPkrS42lmZ4wrLP8iYfsJV2VtzxRx9 Cf20SyoS0GJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrdwAKCRDB/BR4rcrs CbQyB/982UNcsBCJiVUExsW+Vh+lIpG4nBEasT3AvTy+Fbpj8pkN9S0gaBAkJRah0KmI7NpA/Ai /k7ymY1/9y8stcZ0YYb+4b//sTh7TR30oJyOLm/NTkmu67AXLbjxaApft4ucUee2zseWcLpAmHF DLqNwkKmL+nd6G5lFauTKlyc+fe09I4vcHL/qsI+lK/uB0cUie83hfbGc5516a3/w4xtWHRTEdf 2SBt95MXPl3ad/mO2Q2hVTNCrnu/BnyvUB0b+WcEUcZ0jN+54KpU7gLCjjWGylXWoDHh/7elOWW qymONnZRarL3Pvg31SFNAdrau0rGzbsfW4ktJvZdWUSL7Q+V X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-fsl-spi.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index 93152144fd2e..725d043488a1 100644 --- a/drivers/spi/spi-fsl-spi.c +++ b/drivers/spi/spi-fsl-spi.c @@ -716,13 +716,12 @@ static int of_fsl_spi_probe(struct platform_device *ofdev) return ret; } -static int of_fsl_spi_remove(struct platform_device *ofdev) +static void of_fsl_spi_remove(struct platform_device *ofdev) { struct spi_master *master = platform_get_drvdata(ofdev); struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master); fsl_spi_cpm_free(mpc8xxx_spi); - return 0; } static struct platform_driver of_fsl_spi_driver = { @@ -731,7 +730,7 @@ static struct platform_driver of_fsl_spi_driver = { .of_match_table = of_fsl_spi_match, }, .probe = of_fsl_spi_probe, - .remove = of_fsl_spi_remove, + .remove_new = of_fsl_spi_remove, }; #ifdef CONFIG_MPC832x_RDB @@ -763,20 +762,18 @@ static int plat_mpc8xxx_spi_probe(struct platform_device *pdev) return PTR_ERR_OR_ZERO(master); } -static int plat_mpc8xxx_spi_remove(struct platform_device *pdev) +static void plat_mpc8xxx_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master); fsl_spi_cpm_free(mpc8xxx_spi); - - return 0; } MODULE_ALIAS("platform:mpc8xxx_spi"); static struct platform_driver mpc8xxx_spi_driver = { .probe = plat_mpc8xxx_spi_probe, - .remove = plat_mpc8xxx_spi_remove, + .remove_new = plat_mpc8xxx_spi_remove, .driver = { .name = "mpc8xxx_spi", }, From patchwork Fri Mar 3 17:19: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: 13159133 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 C6C5AC7EE2F for ; Fri, 3 Mar 2023 17:21:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231577AbjCCRV2 (ORCPT ); Fri, 3 Mar 2023 12:21:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231591AbjCCRVM (ORCPT ); Fri, 3 Mar 2023 12:21:12 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 886F54ECD0 for ; Fri, 3 Mar 2023 09:21:08 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95W-0006fI-Pv; Fri, 03 Mar 2023 18:20:58 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95V-001bko-D8; Fri, 03 Mar 2023 18:20:57 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95U-001tjh-ML; Fri, 03 Mar 2023 18:20:56 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Mark Brown Cc: Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 29/87] spi: geni-qcom: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:43 +0100 Message-Id: <20230303172041.2103336-30-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1787; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=A2X7hN/80wQC7iYHSvRuoRASSzqEeUFH0zUM6Xe526w=; b=owGbwMvMwMV48I9IxdpTbzgZT6slMaQwaVdb3jrsxdC3pbJP67APxx4X6Uc5MacemFlayjw49 vj7NL3KTkZjFgZGLgZZMUWWuiItsQkSa/7blSzhhhnEygQyhYGLUwAmstCA/X9M/sszCh2bbSNL +zzVt01MzuVyXHmnc2PnWeZKyz29BlM1in4XfJj6WuVKn+ySdW7s3d8Lv65Yype2NuJJSKbsNqd NqjX8fHwqK86lnZXIfxP3rPL/na7qiCvH0rxCk9ma1l5/ndwWIrH3YvjnhYpxNceu9FWoW1cylr fw8xu+0JLW/zdjd8E7yWWG4Z3td3tPRpfsbFHLjTi7t/DD1Gi+fWL/GxM9TyXvr8qQ/OEr8u1Cd fDBXxO/bzxessuhe6qnTOgH5as3ym2zGR6Haidauj53ZikKv+S08mhH/dbkxdZmzTHXq4JVGSWW za3gXMWvcKA6aYXYo4lZId+evjsc3Tid2637bsqCygf6AA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-geni-qcom.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index babb039bcb43..f80635532b4d 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -1114,7 +1114,7 @@ static int spi_geni_probe(struct platform_device *pdev) return ret; } -static int spi_geni_remove(struct platform_device *pdev) +static void spi_geni_remove(struct platform_device *pdev) { struct spi_master *spi = platform_get_drvdata(pdev); struct spi_geni_master *mas = spi_master_get_devdata(spi); @@ -1126,7 +1126,6 @@ static int spi_geni_remove(struct platform_device *pdev) free_irq(mas->irq, spi); pm_runtime_disable(&pdev->dev); - return 0; } static int __maybe_unused spi_geni_runtime_suspend(struct device *dev) @@ -1208,7 +1207,7 @@ MODULE_DEVICE_TABLE(of, spi_geni_dt_match); static struct platform_driver spi_geni_driver = { .probe = spi_geni_probe, - .remove = spi_geni_remove, + .remove_new = spi_geni_remove, .driver = { .name = "geni_spi", .pm = &spi_geni_pm_ops, From patchwork Fri Mar 3 17:19: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: 13159149 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 30EFCC7EE32 for ; Fri, 3 Mar 2023 17:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231131AbjCCRVk (ORCPT ); Fri, 3 Mar 2023 12:21:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231572AbjCCRVT (ORCPT ); Fri, 3 Mar 2023 12:21:19 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C12C474F5 for ; Fri, 3 Mar 2023 09:21:13 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95X-0006gc-6e; Fri, 03 Mar 2023 18:20:59 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95V-001bku-Nl; Fri, 03 Mar 2023 18:20:57 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95U-001tjl-SZ; Fri, 03 Mar 2023 18:20:56 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jay Fang , Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 30/87] spi: hisi-kunpeng: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:44 +0100 Message-Id: <20230303172041.2103336-31-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1766; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=KNX/IRngtnGhX5uSo2EN1XcTXmXFtbfNvNnbw9DX7jE=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAit/5rOFFU7JX62qJD50eeUSTROCXgdkETyqF qq2k5kp++eJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrfwAKCRDB/BR4rcrs CWfOB/9J9NH0G/wF2GHx18v7SlJUUkTtUkiZTNI11MlFAKeKiYodM/Qh+nOqQlLGZLVM3HXfk9E qOwAjcL3Y7y2kcf+HB6jLunTaNHEb4CCfRKT9S8oD8glBc2F42wmZEQ5OymFQNtdgOMBpoGIy4k ZkXKn+Wx34WIosL8rfKXo3xSSkRlFUjLqXryXknK187fDMYXBZTtaqpHLbvfFIv90iS1DOY40dm ANGOmB8PmXAc2voDsbH+UXbY9Pb/I0EFud0LeS73u6rH+FoNwDeWMlNoftI31SGd5eqyl8SO8A4 f1jhS0VdjRt7HPhOo0TnJ6kaH8HKKrBQqUysIVCSTb79/W/2 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-hisi-kunpeng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c index 525cc0143a30..524eadbef87b 100644 --- a/drivers/spi/spi-hisi-kunpeng.c +++ b/drivers/spi/spi-hisi-kunpeng.c @@ -523,15 +523,13 @@ static int hisi_spi_probe(struct platform_device *pdev) return 0; } -static int hisi_spi_remove(struct platform_device *pdev) +static void hisi_spi_remove(struct platform_device *pdev) { struct spi_controller *master = platform_get_drvdata(pdev); struct hisi_spi *hs = spi_controller_get_devdata(master); debugfs_remove_recursive(hs->debugfs); spi_unregister_controller(master); - - return 0; } static const struct acpi_device_id hisi_spi_acpi_match[] = { @@ -542,7 +540,7 @@ MODULE_DEVICE_TABLE(acpi, hisi_spi_acpi_match); static struct platform_driver hisi_spi_driver = { .probe = hisi_spi_probe, - .remove = hisi_spi_remove, + .remove_new = hisi_spi_remove, .driver = { .name = "hisi-kunpeng-spi", .acpi_match_table = hisi_spi_acpi_match, From patchwork Fri Mar 3 17:19: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: 13159103 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 8770AC64EC4 for ; Fri, 3 Mar 2023 17:21:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231605AbjCCRVJ (ORCPT ); Fri, 3 Mar 2023 12:21:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231584AbjCCRVC (ORCPT ); Fri, 3 Mar 2023 12:21:02 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C45E47410 for ; Fri, 3 Mar 2023 09:21:01 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95W-0006hL-Ol; Fri, 03 Mar 2023 18:20:58 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95V-001bky-RM; Fri, 03 Mar 2023 18:20:57 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95V-001tjq-1o; Fri, 03 Mar 2023 18:20:57 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 31/87] spi: img-spfi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:45 +0100 Message-Id: <20230303172041.2103336-32-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1745; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=SxJm9ul9Dlv7OcCIMuhj4g7Bi6zyIfrM+CmeaZ8tkng=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiuC+nxqkqN6xLknJ+Uz57W43S+gb45dHxf0N Yh5o3+6MYGJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrggAKCRDB/BR4rcrs CXTeB/4j+AeXKViPXRgkb2CdefjK/B7ZkiUSVyaf8wXUpo7l2APRDlF6ySng9u9JP12Nbn9bIyu bwDOsAairkt2179KUg4Yw9BEVY1Ocayrk+8CGDcFQAwEYREmZTvI+J9/npOEE4xX1stIMu68zGI mlriLIGIxGjbtYjH9nQpdSRPichKjD7X6IIysYEHjilCjNAVjMU0qmqX6v+I2dBWx+5HndqHOwE RljxnRdwcnixkAV0c7GNxu0jTGsfFbrBLklkVKC6hkUHj/WEWrLBTfSybeXPO7iyJdbQMLLyE9p RjMh7QLx6cHX9NstUi5lzfCbRadk7Sf8fnvribWimKvE2Fii X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-img-spfi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c index 257046f843ff..c64e4fd3fdf0 100644 --- a/drivers/spi/spi-img-spfi.c +++ b/drivers/spi/spi-img-spfi.c @@ -665,7 +665,7 @@ static int img_spfi_probe(struct platform_device *pdev) return ret; } -static int img_spfi_remove(struct platform_device *pdev) +static void img_spfi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct img_spfi *spfi = spi_master_get_devdata(master); @@ -680,8 +680,6 @@ static int img_spfi_remove(struct platform_device *pdev) clk_disable_unprepare(spfi->spfi_clk); clk_disable_unprepare(spfi->sys_clk); } - - return 0; } #ifdef CONFIG_PM @@ -758,7 +756,7 @@ static struct platform_driver img_spfi_driver = { .of_match_table = of_match_ptr(img_spfi_of_match), }, .probe = img_spfi_probe, - .remove = img_spfi_remove, + .remove_new = img_spfi_remove, }; module_platform_driver(img_spfi_driver); From patchwork Fri Mar 3 17:19: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: 13159109 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 5F7D5C7EE39 for ; Fri, 3 Mar 2023 17:21:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231592AbjCCRVN (ORCPT ); Fri, 3 Mar 2023 12:21:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231508AbjCCRVE (ORCPT ); Fri, 3 Mar 2023 12:21:04 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 883A847412 for ; Fri, 3 Mar 2023 09:21:03 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95X-0006hU-5M; Fri, 03 Mar 2023 18:20:59 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95V-001bkz-Tm; Fri, 03 Mar 2023 18:20:57 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95V-001tjt-8z; Fri, 03 Mar 2023 18:20:57 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Kamal Dasu , Mark Brown , Ray Jui , Scott Branden Cc: Broadcom internal kernel review list , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 32/87] spi: iproc-qspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:46 +0100 Message-Id: <20230303172041.2103336-33-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1584; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ZtW21SET9WsT59Aprw5i2BQREGTbWN96YwW71PZaF08=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiuGxM/Q0c5wC5Jf5X7tRvDMyuKpBzufX12SW RU1pE0g6HuJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrhgAKCRDB/BR4rcrs CbL0B/4hpD7C9CO3lDlqSS/P8qHwH/TTV0WyASEF7QN94aUK90aPcFA7O/j/nInvxxuhVO8FaN6 kWSSt7N27Kjzm/CLYsDSIQOsVIs8a43xb/e2BmWIUhCaYE/qftgrX+atWgu4elGMP6s9kCQ2OqD l8Ho0Df8OzB+w5EVOpe+OVs0XAEOtOOHjh+ianDjx05O2iVfw3dG/53bXPc89oRU3qYHPubCjuE Iljo8gld/71tP5ohH04eKuL9cjqRBbpYjPtEDvdDEtL9naqJJsK0ljiS99bSG4LAg9juC3BjGwJ 0rk2ySl5tMSGAbPC+uFnGT+otSolANHiDgvw04FrPGPw5Pom X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli --- drivers/spi/spi-iproc-qspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-iproc-qspi.c b/drivers/spi/spi-iproc-qspi.c index 91cf8eb7213c..5980a0dbbccb 100644 --- a/drivers/spi/spi-iproc-qspi.c +++ b/drivers/spi/spi-iproc-qspi.c @@ -127,11 +127,9 @@ static int bcm_iproc_probe(struct platform_device *pdev) return bcm_qspi_probe(pdev, soc_intc); } -static int bcm_iproc_remove(struct platform_device *pdev) +static void bcm_iproc_remove(struct platform_device *pdev) { bcm_qspi_remove(pdev); - - return 0; } static const struct of_device_id bcm_iproc_of_match[] = { @@ -143,7 +141,7 @@ MODULE_DEVICE_TABLE(of, bcm_iproc_of_match); static struct platform_driver bcm_iproc_driver = { .probe = bcm_iproc_probe, - .remove = bcm_iproc_remove, + .remove_new = bcm_iproc_remove, .driver = { .name = "bcm_iproc", .pm = &bcm_qspi_pm_ops, From patchwork Fri Mar 3 17:19: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: 13159105 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 13C3DC7EE39 for ; Fri, 3 Mar 2023 17:21:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231574AbjCCRVK (ORCPT ); Fri, 3 Mar 2023 12:21:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231586AbjCCRVD (ORCPT ); Fri, 3 Mar 2023 12:21:03 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32CE647412 for ; Fri, 3 Mar 2023 09:21:02 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95X-0006jM-T6; Fri, 03 Mar 2023 18:20:59 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95W-001blB-FR; Fri, 03 Mar 2023 18:20:58 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95V-001tjx-Fg; Fri, 03 Mar 2023 18:20:57 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 33/87] spi: lantiq-ssc: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:47 +0100 Message-Id: <20230303172041.2103336-34-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=tPRupWNCOhkJMNvWgyjIqRGon80u4y/NxLD0/Cu25H0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiuKxz7XvUO35afuFXm08crM5tkto4f/VtOLa LEapz+UEIWJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrigAKCRDB/BR4rcrs CZTIB/99xBGcmhZNK1bOSiOXCVH+4papQ+UqTaLkVu3PilDtSYzroBTrJ1GepIW0mXO4XKx1Sok 4cLIGP0nGB3GvlBLubUBWevzUngv6Alv6FCZUgvu37URBz0NtivZPnB3baf+AtqVij3BB8Rcncz G9/OXu0nkLMEbbs/uOKW22kwqpYS0yXBsZEkY8ln9kRNZQzLahOU3wSdGvCbeFQiXAWeWVUhYr9 KVXHLt6UeHRgHsUAwAzG3CaH3cCmZo9sIXxnfOnLCgkIvnwPkf7534Uwi5iqsY8d/R4deualw3c 0zlOaZeLg1oPLbuP+X8qEaUAR86WlJTgL2BgKOVseoEVgvjr X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-lantiq-ssc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-lantiq-ssc.c b/drivers/spi/spi-lantiq-ssc.c index aae26f62ea87..76cf2a66f874 100644 --- a/drivers/spi/spi-lantiq-ssc.c +++ b/drivers/spi/spi-lantiq-ssc.c @@ -1017,7 +1017,7 @@ static int lantiq_ssc_probe(struct platform_device *pdev) return err; } -static int lantiq_ssc_remove(struct platform_device *pdev) +static void lantiq_ssc_remove(struct platform_device *pdev) { struct lantiq_ssc_spi *spi = platform_get_drvdata(pdev); @@ -1030,13 +1030,11 @@ static int lantiq_ssc_remove(struct platform_device *pdev) destroy_workqueue(spi->wq); clk_disable_unprepare(spi->spi_clk); clk_put(spi->fpi_clk); - - return 0; } static struct platform_driver lantiq_ssc_driver = { .probe = lantiq_ssc_probe, - .remove = lantiq_ssc_remove, + .remove_new = lantiq_ssc_remove, .driver = { .name = "spi-lantiq-ssc", .of_match_table = lantiq_ssc_match, From patchwork Fri Mar 3 17:19: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: 13159111 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 E904AC7EE2D for ; Fri, 3 Mar 2023 17:21:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231625AbjCCRVO (ORCPT ); Fri, 3 Mar 2023 12:21:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231556AbjCCRVF (ORCPT ); Fri, 3 Mar 2023 12:21:05 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E8CE4391F for ; Fri, 3 Mar 2023 09:21:04 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95X-0006jK-SB; Fri, 03 Mar 2023 18:20:59 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95W-001blA-Ey; Fri, 03 Mar 2023 18:20:58 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95V-001tk1-Nq; Fri, 03 Mar 2023 18:20:57 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Neil Armstrong , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 34/87] spi: meson-spicc: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:48 +0100 Message-Id: <20230303172041.2103336-35-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1809; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=wIKxT+p09a0fMoGZJNJn4gwEKy4eROv6P/ZQUF4MM+k=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiuOf9Ck8KGreXQk8ppcZGL96mgVOkKETYFH2 8xtL7oh4z6JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrjgAKCRDB/BR4rcrs CWQSB/9bLoPdSsOw65mZJnhNRlSUBlLizDd9TirYEdQHZfdFcOVvkknt9iZgPuk/FYZjWFuI6ms buMjzYfy0p+hYrUr51QImPSpCKWC6PYboFaZ/x4TVWAVKNrd3S/rxkOiZb22E7gjEn3uMXnopPu M8a56KZABV97BXO2hjYLtE1DHJytSPEqK5lRN3coI5A848+uSZBmw/0NkYk9ZjP+orcm66ArLW9 RRNN/vU6rH7z+ek080wVoJkLBln5u1eFo6sH4qUAsbdBljEuT4cMU63VLi35k4a3bYPe2aXacNp 2/lSrSXiuJ6m9PB5n4L4wkobMS4nAlJt/0UIz5czGmGXXzS+ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Martin Blumenstingl --- drivers/spi/spi-meson-spicc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c index d47f2623a60f..b9f812837cd6 100644 --- a/drivers/spi/spi-meson-spicc.c +++ b/drivers/spi/spi-meson-spicc.c @@ -910,7 +910,7 @@ static int meson_spicc_probe(struct platform_device *pdev) return ret; } -static int meson_spicc_remove(struct platform_device *pdev) +static void meson_spicc_remove(struct platform_device *pdev) { struct meson_spicc_device *spicc = platform_get_drvdata(pdev); @@ -921,8 +921,6 @@ static int meson_spicc_remove(struct platform_device *pdev) clk_disable_unprepare(spicc->pclk); spi_master_put(spicc->master); - - return 0; } static const struct meson_spicc_data meson_spicc_gx_data = { @@ -967,7 +965,7 @@ MODULE_DEVICE_TABLE(of, meson_spicc_of_match); static struct platform_driver meson_spicc_driver = { .probe = meson_spicc_probe, - .remove = meson_spicc_remove, + .remove_new = meson_spicc_remove, .driver = { .name = "meson-spicc", .of_match_table = of_match_ptr(meson_spicc_of_match), From patchwork Fri Mar 3 17:19: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: 13159110 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 2E995C7EE2F for ; Fri, 3 Mar 2023 17:21:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231624AbjCCRVO (ORCPT ); Fri, 3 Mar 2023 12:21:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbjCCRVF (ORCPT ); Fri, 3 Mar 2023 12:21:05 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2510F46173 for ; Fri, 3 Mar 2023 09:21:04 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95X-0006jk-PT; Fri, 03 Mar 2023 18:20:59 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95W-001blH-KZ; Fri, 03 Mar 2023 18:20:58 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95V-001tk5-UR; Fri, 03 Mar 2023 18:20:57 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Neil Armstrong , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 35/87] spi: meson-spifc: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:49 +0100 Message-Id: <20230303172041.2103336-36-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=V5nExC369g9w2BPhMLN/ksgUEQ4NdUM7PLbWh6nlt/U=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiuTxhgFrMMlWot5x24gJMir9kRj+snNI1jGR Z+3CRX7itaJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrkwAKCRDB/BR4rcrs CZl0CACI68St2Bf6RIQ770thnASVOLSkjCSsiGDyaF+/7W/w6EbUczZMf3H2nkSuc8ZGECJaO25 fub+Tq8nvXK4i0fJyAkyJ+CfOfvMxSeFKwHw12QQN2O2yxWm95foQXpMlmSFOD87rb8IENFIMcM aQQoVWrlBs5Ot8I+jfZhZBc+jUkY8IcpHzYcOKAvKkA7s3wKXbPsrLIZsLSzra9CMtvfPmMkrJg JNf/mdx+GeL9mx1VUeLScIs2DRDOiLPuLvCbzlV5Iq4QMuoh/ajurf+r2+s0glY3Kxq4TZugzX+ GpFDcSgWwD4LSL7iqc9IEdpIhao0l0FDhXGHF5Z0y/CazkRN X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Martin Blumenstingl --- drivers/spi/spi-meson-spifc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-meson-spifc.c b/drivers/spi/spi-meson-spifc.c index c8ed7815c4ba..06626f406f68 100644 --- a/drivers/spi/spi-meson-spifc.c +++ b/drivers/spi/spi-meson-spifc.c @@ -355,7 +355,7 @@ static int meson_spifc_probe(struct platform_device *pdev) return ret; } -static int meson_spifc_remove(struct platform_device *pdev) +static void meson_spifc_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct meson_spifc *spifc = spi_master_get_devdata(master); @@ -363,8 +363,6 @@ static int meson_spifc_remove(struct platform_device *pdev) pm_runtime_get_sync(&pdev->dev); clk_disable_unprepare(spifc->clk); pm_runtime_disable(&pdev->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -442,7 +440,7 @@ MODULE_DEVICE_TABLE(of, meson_spifc_dt_match); static struct platform_driver meson_spifc_driver = { .probe = meson_spifc_probe, - .remove = meson_spifc_remove, + .remove_new = meson_spifc_remove, .driver = { .name = "meson-spifc", .of_match_table = of_match_ptr(meson_spifc_dt_match), From patchwork Fri Mar 3 17:19: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: 13159153 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 808EEC7EE2F for ; Fri, 3 Mar 2023 17:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231203AbjCCRVp (ORCPT ); Fri, 3 Mar 2023 12:21:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231640AbjCCRVY (ORCPT ); Fri, 3 Mar 2023 12:21:24 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6658E55052 for ; Fri, 3 Mar 2023 09:21:15 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95Y-0006k5-3C; Fri, 03 Mar 2023 18:21:00 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95W-001blL-Rk; Fri, 03 Mar 2023 18:20:58 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95W-001tkA-7P; Fri, 03 Mar 2023 18:20:58 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Conor Dooley , Daire McNamara , Mark Brown Cc: linux-riscv@lists.infradead.org, linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 36/87] spi: microchip-core-qspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:50 +0100 Message-Id: <20230303172041.2103336-37-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1914; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=TY+4UnhTgaVXz3hOuActUGQoANtfkS0l1nNGk0gJEE4=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiuWWzzNvhL2p7GMZaF5CaagYkEwpwxU5ZAJv ONODTm9de+JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrlgAKCRDB/BR4rcrs CYIQB/9ZrF0OG1yobv/duGrJtJqEaqcvRH6h2W6ISjaBxqT2z6MdZq+mywmfKTesM+LpCb0tg8C NgbOUjgsUMuvMj9G5jIwjG3SOYoEcseSydEU3St9QlwTgH1eAnZRw7/d4lB1miyVtQzZpo81Quj n6trGlwoFy293KtBqzGRQTKbLZT/4uAHPXixtIHuBetEk2jvbqrOIeGISl32FvF9jj+m5xkaaeN EXaU0posOFawGEOb8za3eywN7qCndw1z6AbiKMm5MO6lWgwhDM4SsryyhL2gCvQFNG1SV2ILgVA VGG/9NnzSjxI53hd7edsfGcU9UJxilGsU2aj2OgVxbYTNZ/2 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Conor Dooley --- drivers/spi/spi-microchip-core-qspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-microchip-core-qspi.c b/drivers/spi/spi-microchip-core-qspi.c index 19a6a46829f6..4f76ddf97b10 100644 --- a/drivers/spi/spi-microchip-core-qspi.c +++ b/drivers/spi/spi-microchip-core-qspi.c @@ -566,7 +566,7 @@ static int mchp_coreqspi_probe(struct platform_device *pdev) return ret; } -static int mchp_coreqspi_remove(struct platform_device *pdev) +static void mchp_coreqspi_remove(struct platform_device *pdev) { struct mchp_coreqspi *qspi = platform_get_drvdata(pdev); u32 control = readl_relaxed(qspi->regs + REG_CONTROL); @@ -575,8 +575,6 @@ static int mchp_coreqspi_remove(struct platform_device *pdev) control &= ~CONTROL_ENABLE; writel_relaxed(control, qspi->regs + REG_CONTROL); clk_disable_unprepare(qspi->clk); - - return 0; } static const struct of_device_id mchp_coreqspi_of_match[] = { @@ -591,7 +589,7 @@ static struct platform_driver mchp_coreqspi_driver = { .name = "microchip,coreqspi", .of_match_table = mchp_coreqspi_of_match, }, - .remove = mchp_coreqspi_remove, + .remove_new = mchp_coreqspi_remove, }; module_platform_driver(mchp_coreqspi_driver); From patchwork Fri Mar 3 17:19: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: 13159159 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 919EFC64EC4 for ; Fri, 3 Mar 2023 17:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231665AbjCCRVp (ORCPT ); Fri, 3 Mar 2023 12:21:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231641AbjCCRVZ (ORCPT ); Fri, 3 Mar 2023 12:21:25 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E90F55079 for ; Fri, 3 Mar 2023 09:21:15 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95Y-0006l0-G4; Fri, 03 Mar 2023 18:21:00 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95X-001blT-8T; Fri, 03 Mar 2023 18:20:59 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95W-001tkD-G8; Fri, 03 Mar 2023 18:20:58 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Conor Dooley , Daire McNamara , Mark Brown Cc: linux-riscv@lists.infradead.org, linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 37/87] spi: microchip-core: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:51 +0100 Message-Id: <20230303172041.2103336-38-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1907; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=2q5THNKlK4gsquv2lzy7ofOnkVJIgOoYwNhePyYNVus=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiuayFi3bYDqqf9iXAc1czAWs59j6npeXLTFz RlGLZ5ws1CJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrmgAKCRDB/BR4rcrs CSK+B/9Wtf/e7biFxUeF+iCjsLA5hkPiJXTXRuRmrpfFBbNugB6pMsNUDLkp3d1Sg835DWSD5L9 Mlw05kpKgDD0Rg3AE9aR7+47N0DM0Xwj+cyb47fUI6YO32iJ4V+436Zvaoh0NrBRd+o5K3Psb8G O9lseeQbr8uNPwQw8kDyFpZXn1xgchISi7VKdwBx1YxoPdZnPHP8y/WIRZSKUQf5Vu6/mK6ycDi M5NmqTu8S6vW3tztURb7lw2DX41tY5kxsVNwyaf5jL841rlkIRr/y4NhCkVjHKjt4KGGelwNTQt CGjsNJGbdD1fJe2DPrJ50HMxewndgT1IdKBbpedyXu+Pyh2G X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Conor Dooley --- drivers/spi/spi-microchip-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c index aeaa1da88f39..e6cf6ff08061 100644 --- a/drivers/spi/spi-microchip-core.c +++ b/drivers/spi/spi-microchip-core.c @@ -566,7 +566,7 @@ static int mchp_corespi_probe(struct platform_device *pdev) return 0; } -static int mchp_corespi_remove(struct platform_device *pdev) +static void mchp_corespi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct mchp_corespi *spi = spi_master_get_devdata(master); @@ -574,8 +574,6 @@ static int mchp_corespi_remove(struct platform_device *pdev) mchp_corespi_disable_ints(spi); clk_disable_unprepare(spi->clk); mchp_corespi_disable(spi); - - return 0; } #define MICROCHIP_SPI_PM_OPS (NULL) @@ -599,7 +597,7 @@ static struct platform_driver mchp_corespi_driver = { .pm = MICROCHIP_SPI_PM_OPS, .of_match_table = of_match_ptr(mchp_corespi_dt_ids), }, - .remove = mchp_corespi_remove, + .remove_new = mchp_corespi_remove, }; module_platform_driver(mchp_corespi_driver); MODULE_DESCRIPTION("Microchip coreSPI SPI controller driver"); From patchwork Fri Mar 3 17:19: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: 13159106 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 74231C7EE2D for ; Fri, 3 Mar 2023 17:21:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231545AbjCCRVL (ORCPT ); Fri, 3 Mar 2023 12:21:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231437AbjCCRVD (ORCPT ); Fri, 3 Mar 2023 12:21:03 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BECC14391F for ; Fri, 3 Mar 2023 09:21:02 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95Y-0006l2-FM; Fri, 03 Mar 2023 18:21:00 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95X-001blU-8p; Fri, 03 Mar 2023 18:20:59 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95W-001tkI-MW; Fri, 03 Mar 2023 18:20:58 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 38/87] spi: mpc512x-psc: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:52 +0100 Message-Id: <20230303172041.2103336-39-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2503; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=CM32ybsWUiRdSZv3IwCqJC/iklKREoEKB33cRr5ugrM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiueRAiy6t3rrBSUQo8ojWIJ/i/EnmFLCzzL7 ++GynEXnuiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrngAKCRDB/BR4rcrs CccpCACRMZqa+ixfQEYGTd8Iphc8hg0o4tRyDicIjiQBgmNeRPPCKQdiCVEC9xRcF8MeiusYaeB +UVOrvs1hH+fn8fKdrf5vTruLBTCUtfDy31MGZVdRf9de5JeyMr0LjhWuIAjJNZnycTPlacbf67 KrDh65NaWsPgOJjsgTZjgN/1xrJnvOJHS5ZJmn1O+4QoOliSEjwsCf1uir/tiDmhrTxKcHbmSXT IUdQmyvUZEOMw+9fw5wXny8zf1RYnkGqymlYqTco8e+nLUaFccS8qjwAVCtsFoKGZwFALmmHSIQ skJjhq5wkFDVCarWaGSxN+1iXyXhti1Ml/+oEMjCAGwqBDbU X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Fold mpc512x_psc_spi_do_remove() into its only caller and then 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/spi/spi-mpc512x-psc.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index 03630359ce70..f5bea6df0690 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c @@ -561,17 +561,6 @@ static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr, return ret; } -static int mpc512x_psc_spi_do_remove(struct device *dev) -{ - struct spi_master *master = dev_get_drvdata(dev); - struct mpc512x_psc_spi *mps = spi_master_get_devdata(master); - - clk_disable_unprepare(mps->clk_mclk); - clk_disable_unprepare(mps->clk_ipg); - - return 0; -} - static int mpc512x_psc_spi_of_probe(struct platform_device *op) { const u32 *regaddr_p; @@ -588,9 +577,14 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *op) irq_of_parse_and_map(op->dev.of_node, 0)); } -static int mpc512x_psc_spi_of_remove(struct platform_device *op) +static void mpc512x_psc_spi_of_remove(struct platform_device *op) { - return mpc512x_psc_spi_do_remove(&op->dev); + struct device *dev = &op->dev; + struct spi_master *master = dev_get_drvdata(dev); + struct mpc512x_psc_spi *mps = spi_master_get_devdata(master); + + clk_disable_unprepare(mps->clk_mclk); + clk_disable_unprepare(mps->clk_ipg); } static const struct of_device_id mpc512x_psc_spi_of_match[] = { @@ -603,7 +597,7 @@ MODULE_DEVICE_TABLE(of, mpc512x_psc_spi_of_match); static struct platform_driver mpc512x_psc_spi_of_driver = { .probe = mpc512x_psc_spi_of_probe, - .remove = mpc512x_psc_spi_of_remove, + .remove_new = mpc512x_psc_spi_of_remove, .driver = { .name = "mpc512x-psc-spi", .of_match_table = mpc512x_psc_spi_of_match, From patchwork Fri Mar 3 17:19: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: 13159107 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 1A03CC7EE2F for ; Fri, 3 Mar 2023 17:21:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231615AbjCCRVM (ORCPT ); Fri, 3 Mar 2023 12:21:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231591AbjCCRVE (ORCPT ); Fri, 3 Mar 2023 12:21:04 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27BE24743D for ; Fri, 3 Mar 2023 09:21:03 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95Y-0006mJ-S9; Fri, 03 Mar 2023 18:21:00 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95X-001blc-K8; Fri, 03 Mar 2023 18:20:59 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95W-001tkM-UX; Fri, 03 Mar 2023 18:20:58 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 39/87] spi: mpc52xx-psc: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:53 +0100 Message-Id: <20230303172041.2103336-40-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1952; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=vbDmrCobXARpzkUXnku1nm8yvmM0ylr4+tKHEkgp5yA=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiuiNj1+giZuo6pUG6qaAyi/nlCrmuD3ugEGW 7CTZFjWK3WJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrogAKCRDB/BR4rcrs CRX9B/9J6CQ4Jg8uWkkCGf+YQUZdmfQlt0JXRA3mZMjtkrrFbIWL93XSTm1toDda6ceSKrHATiD qLzlW6CeaE6O/L15u4mJLbzskSKm9idRRLJY5oruYoQtjBJ50y41TM5jxvJ7XZxRdtTTWeDF0Qq dIT1BkJ1w/U5kRVLTr5BXw5UI/T7S+qvj1FjItq8RV/U9rdl6COqSfw20XVedTyj4H6o2KLjFVG bc1VhCahhYk6N6Z3OnX1sv39CxCuTrLgyh7Gyuikb8K7NpA1V2e8Dv71X6WG7CWHHoSq99yiYyx qc1LR9xBZMtuizSiyvZzaxpFBgprEmCF8XvtHgpV9xhC19UO X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-mpc52xx-psc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c index 609311231e64..4a2b1b56cc92 100644 --- a/drivers/spi/spi-mpc52xx-psc.c +++ b/drivers/spi/spi-mpc52xx-psc.c @@ -418,7 +418,7 @@ static int mpc52xx_psc_spi_of_probe(struct platform_device *op) irq_of_parse_and_map(op->dev.of_node, 0), id); } -static int mpc52xx_psc_spi_of_remove(struct platform_device *op) +static void mpc52xx_psc_spi_of_remove(struct platform_device *op) { struct spi_master *master = spi_master_get(platform_get_drvdata(op)); struct mpc52xx_psc_spi *mps = spi_master_get_devdata(master); @@ -428,8 +428,6 @@ static int mpc52xx_psc_spi_of_remove(struct platform_device *op) if (mps->psc) iounmap(mps->psc); spi_master_put(master); - - return 0; } static const struct of_device_id mpc52xx_psc_spi_of_match[] = { @@ -442,7 +440,7 @@ MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match); static struct platform_driver mpc52xx_psc_spi_of_driver = { .probe = mpc52xx_psc_spi_of_probe, - .remove = mpc52xx_psc_spi_of_remove, + .remove_new = mpc52xx_psc_spi_of_remove, .driver = { .name = "mpc52xx-psc-spi", .of_match_table = mpc52xx_psc_spi_of_match, From patchwork Fri Mar 3 17:19: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: 13159108 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 B4A5BC7EE37 for ; Fri, 3 Mar 2023 17:21:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231620AbjCCRVM (ORCPT ); Fri, 3 Mar 2023 12:21:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231592AbjCCRVE (ORCPT ); Fri, 3 Mar 2023 12:21:04 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33C0947410 for ; Fri, 3 Mar 2023 09:21:03 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95Y-0006n0-Ti; Fri, 03 Mar 2023 18:21:00 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95X-001blg-QV; Fri, 03 Mar 2023 18:20:59 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95X-001tkQ-46; Fri, 03 Mar 2023 18:20:59 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 40/87] spi: mpc52xx: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:54 +0100 Message-Id: <20230303172041.2103336-41-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=D+ZjbD9Sk5/Kt5HJcU5/T4TMs5D4pelyPRUs4knQdJo=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiumKff9PRZqa3zl2uU+D66aSxqGcTqNSI4+d qvdNtXIp/iJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrpgAKCRDB/BR4rcrs CUBVB/kB7z1bWsMT+hmYbm56Y6iSswBBkNkKIvbmoYfYjV1TrWaRO08QyhC8miXxQp5ggXrbcJO s7CkK/yh7NEJUwugSdmnV734HB+BCsabf6xozokULLH6LrDo4Lpxm4S2tG6EgnfOAA2GIC5PxIP U+HrRMHzwA/KXYbQixob6KOz99YUg+K+kRHoxqDMHNJ0cfDAMrSsl253iKi28VskaqHaHiL2D76 u6aBg/i9tnP3I6nbiqROQXD+3Q/kYAgOu11Gq/UJpXLpL1ffihC5k6zOqwe95LCRevOsseKPNhh iqmpXkM/B+4Qefxv3f1p9e7lf64m5G6ILxlCvDzA35UftcBC X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-mpc52xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-mpc52xx.c b/drivers/spi/spi-mpc52xx.c index 7b64e64c65cf..b652fb196622 100644 --- a/drivers/spi/spi-mpc52xx.c +++ b/drivers/spi/spi-mpc52xx.c @@ -513,7 +513,7 @@ static int mpc52xx_spi_probe(struct platform_device *op) return rc; } -static int mpc52xx_spi_remove(struct platform_device *op) +static void mpc52xx_spi_remove(struct platform_device *op) { struct spi_master *master = spi_master_get(platform_get_drvdata(op)); struct mpc52xx_spi *ms = spi_master_get_devdata(master); @@ -529,8 +529,6 @@ static int mpc52xx_spi_remove(struct platform_device *op) spi_unregister_master(master); iounmap(ms->regs); spi_master_put(master); - - return 0; } static const struct of_device_id mpc52xx_spi_match[] = { @@ -545,6 +543,6 @@ static struct platform_driver mpc52xx_spi_of_driver = { .of_match_table = mpc52xx_spi_match, }, .probe = mpc52xx_spi_probe, - .remove = mpc52xx_spi_remove, + .remove_new = mpc52xx_spi_remove, }; module_platform_driver(mpc52xx_spi_of_driver); From patchwork Fri Mar 3 17:19: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: 13159116 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 15627C7EE37 for ; Fri, 3 Mar 2023 17:21:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230244AbjCCRVR (ORCPT ); Fri, 3 Mar 2023 12:21:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231131AbjCCRVG (ORCPT ); Fri, 3 Mar 2023 12:21:06 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46B804A1F2 for ; Fri, 3 Mar 2023 09:21:05 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95Z-0006nq-Qi; Fri, 03 Mar 2023 18:21:01 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Y-001blt-Cq; Fri, 03 Mar 2023 18:21:00 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95X-001tkT-AM; Fri, 03 Mar 2023 18:20:59 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 41/87] spi: mtk-nor: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:55 +0100 Message-Id: <20230303172041.2103336-42-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=YZYhH+wuvs1yYmUmSGIJe1W+P1/Fri/WOjTpGI34ElM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiupKQNMjbnswBSeJd1I84BeHV7rB5Noc5m68 GhA8k0H+FeJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrqQAKCRDB/BR4rcrs CVADCACfRpSzUpZqrmQMl4KXCaHZDRHLfm5L68s6StP6Shr8+PneTyv+iNboi5iZz6YPbwlOhCv 7lWzDA7TKrjYPJ6wvc6FbKeVQQKEdPfo8IZugHaQUke3R2bYHMqe7Y5SBRDJk83IVTLEsi5nETM pxgxf8fdLKzej5Ub7RHLyOKCgV2c1T4OooUmkM+ly7bJjgPymsAQ0zZvypKt3y2aMItdwdcLuOH DIJDp8UZ3CsczLSEI/ZEVJLrtas66ATKg9iS+HIltUZ1QTgQPBWjRuW52v/4FoJ/1XVEe6ms60l 1H/9Ar9goKS+RKkQMAqg5sIfZJh9xSoRWlRz4GaSySt5CvKG X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-mtk-nor.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c index aad92a58c4b8..baa7a5353987 100644 --- a/drivers/spi/spi-mtk-nor.c +++ b/drivers/spi/spi-mtk-nor.c @@ -934,7 +934,7 @@ static int mtk_nor_probe(struct platform_device *pdev) return ret; } -static int mtk_nor_remove(struct platform_device *pdev) +static void mtk_nor_remove(struct platform_device *pdev) { struct spi_controller *ctlr = dev_get_drvdata(&pdev->dev); struct mtk_nor *sp = spi_controller_get_devdata(ctlr); @@ -944,8 +944,6 @@ static int mtk_nor_remove(struct platform_device *pdev) pm_runtime_dont_use_autosuspend(&pdev->dev); mtk_nor_disable_clk(sp); - - return 0; } static int __maybe_unused mtk_nor_runtime_suspend(struct device *dev) @@ -999,7 +997,7 @@ static struct platform_driver mtk_nor_driver = { .pm = &mtk_nor_pm_ops, }, .probe = mtk_nor_probe, - .remove = mtk_nor_remove, + .remove_new = mtk_nor_remove, }; module_platform_driver(mtk_nor_driver); From patchwork Fri Mar 3 17:19: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: 13159117 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 BBB2EC64EC4 for ; Fri, 3 Mar 2023 17:21:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231565AbjCCRVS (ORCPT ); Fri, 3 Mar 2023 12:21:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbjCCRVH (ORCPT ); Fri, 3 Mar 2023 12:21:07 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56A9748E1A for ; Fri, 3 Mar 2023 09:21:05 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95Z-0006nb-Qj; Fri, 03 Mar 2023 18:21:01 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Y-001blp-9d; Fri, 03 Mar 2023 18:21:00 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95X-001tkY-HF; Fri, 03 Mar 2023 18:20:59 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 42/87] spi: mtk-snfi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:56 +0100 Message-Id: <20230303172041.2103336-43-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1673; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=9HCn3Ajliympt2j/eU2WMSCODvoPrwHImFJwAQQQGEs=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiutIIF62FsinJ91ws4cCd2Axf2iGC0uQTKGA tz+Ro4YmpWJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrrQAKCRDB/BR4rcrs CR5DB/0V3dZa5NSV2GdMJ4CQbiDuthvzPmYj5YbDHCJ+5AZQ3Ed0ksIbS+YZSctXub/tnUOPdxs oarTsboXFESau7Q/7FvtwLK24EZmCzL9Rq9nfk9e5NltsN6bUg7y8pnzc6iREDh70GZ4ZvlnH4J gQCLHkMkuPH7R2TJevI/1lCS8GEkQ5vRfLYB5ffjCwqTNZOVDV40S8rrS7f+eQsPaI51fkWtHhz Tw7G/XWlwWY63oUmu2E9g+sLh0aAvqC4zpVbAYSv3+4ZTTeQ0i++r6Q2J5LOyKoR9Mxi3+UgmeG 8C4Kn8OG31oj4tN+dj5t5g3ylcdro0STjz3yDe36P4DFdoqh X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-mtk-snfi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-mtk-snfi.c b/drivers/spi/spi-mtk-snfi.c index f3f95eb37365..bed8317cd205 100644 --- a/drivers/spi/spi-mtk-snfi.c +++ b/drivers/spi/spi-mtk-snfi.c @@ -1506,7 +1506,7 @@ static int mtk_snand_probe(struct platform_device *pdev) return ret; } -static int mtk_snand_remove(struct platform_device *pdev) +static void mtk_snand_remove(struct platform_device *pdev) { struct spi_controller *ctlr = platform_get_drvdata(pdev); struct mtk_snand *ms = spi_controller_get_devdata(ctlr); @@ -1515,12 +1515,11 @@ static int mtk_snand_remove(struct platform_device *pdev) mtk_snand_disable_clk(ms); mtk_ecc_release(ms->ecc); kfree(ms->buf); - return 0; } static struct platform_driver mtk_snand_driver = { .probe = mtk_snand_probe, - .remove = mtk_snand_remove, + .remove_new = mtk_snand_remove, .driver = { .name = "mtk-snand", .of_match_table = mtk_snand_ids, From patchwork Fri Mar 3 17:19: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: 13159112 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 7BCAEC64EC4 for ; Fri, 3 Mar 2023 17:21:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231202AbjCCRVP (ORCPT ); Fri, 3 Mar 2023 12:21:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231598AbjCCRVF (ORCPT ); Fri, 3 Mar 2023 12:21:05 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80C9148E2C for ; Fri, 3 Mar 2023 09:21:04 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95a-0006oP-1V; Fri, 03 Mar 2023 18:21:02 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Y-001bm3-TL; Fri, 03 Mar 2023 18:21:00 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95X-001tkc-Ns; Fri, 03 Mar 2023 18:20:59 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 43/87] spi: mxic: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:57 +0100 Message-Id: <20230303172041.2103336-44-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=BrYpHOANXgmrf9KvumHfTiP45DbB6R9VmqxglJLOJ3g=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiuxoGQl0f8CjwIBVTzTp/UnMO8fQU4eTHx2X 1roLzwbOJSJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrsQAKCRDB/BR4rcrs CRF9B/9uOV+FThMMkGWElvHb3Ml+gXrNy9DHicg8ulEDZLIyhpoRtPO3UCJZ+B6fYprx9mEAkwR 4kqjtb5+nliof1VgbjA9GOOaSY9cuxPoPFIiznQ42F3dKWDdL+O17Lq9RmnkeBpe8la1h7IxSs8 ljm+5alnaqWE88WrO49G2+Zd13fqgqO9ECeKcQ6IhkAzFaXh7Z06JkJlqZvH5WQ/Kb1Ui0YTO8A VJegdiAG8cx0GxlkaNUetRzr8cH4aH7o0GN8pWj1mFIZG0mM8xgL/D4RYOjbX1jUzkNpONh1jlm PiUiSdEc5cM/Q5jJLSiVTvxRfe+kp9v4x01aUz2pEnLX21xl X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-mxic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-mxic.c b/drivers/spi/spi-mxic.c index a3dba17390eb..10727ea53043 100644 --- a/drivers/spi/spi-mxic.c +++ b/drivers/spi/spi-mxic.c @@ -818,7 +818,7 @@ static int mxic_spi_probe(struct platform_device *pdev) return ret; } -static int mxic_spi_remove(struct platform_device *pdev) +static void mxic_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct mxic_spi *mxic = spi_master_get_devdata(master); @@ -826,8 +826,6 @@ static int mxic_spi_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); mxic_spi_mem_ecc_remove(mxic); spi_unregister_master(master); - - return 0; } static const struct of_device_id mxic_spi_of_ids[] = { @@ -838,7 +836,7 @@ MODULE_DEVICE_TABLE(of, mxic_spi_of_ids); static struct platform_driver mxic_spi_driver = { .probe = mxic_spi_probe, - .remove = mxic_spi_remove, + .remove_new = mxic_spi_remove, .driver = { .name = "mxic-spi", .of_match_table = mxic_spi_of_ids, From patchwork Fri Mar 3 17:19: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: 13159143 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 27BD9C7EE39 for ; Fri, 3 Mar 2023 17:21:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231555AbjCCRVg (ORCPT ); Fri, 3 Mar 2023 12:21:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231556AbjCCRVR (ORCPT ); Fri, 3 Mar 2023 12:21:17 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DFD347412 for ; Fri, 3 Mar 2023 09:21:12 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95Z-0006o0-Jz; Fri, 03 Mar 2023 18:21:01 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Y-001bly-JU; Fri, 03 Mar 2023 18:21:00 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95X-001tkg-UV; Fri, 03 Mar 2023 18:20:59 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Shawn Guo , Sascha Hauer Cc: Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 44/87] spi: mxs: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:58 +0100 Message-Id: <20230303172041.2103336-45-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1568; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=5OPK9fmthHTWqfIh12hEoolqfY6MlpVwy7kXcL/POCU=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiu11quOf7eXJTfR/iOUu809q+N8kgnEUu/bV 7c9UFIOtD2JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrtQAKCRDB/BR4rcrs CR6aCACbtMJQRrXu9ya5MCMowHiH6qzE1JGXX8bF1QW913zDr3QG45KsbBIZeObRBJXcetPyL4k xsyH08KolXxEj3/ZezqUGg1oSkjjq4xztdcl9sy72WWI7w3lWWZ1EeQdLofwoYK78QeMgHgbmY0 Sx74yuOhiMST1Dv6HKuo5vRbkj/Tr7lJIc12P4OpwWMp9ecOCfbWWA8rMCR7F43KKmUXfH6IfX7 3lmSRVsmy3/ynJ7pX+vRqQ3siUxtX4jSdfK+JH4OSMNlDtlPusWWWQ0lJzXLnc1QTDQSxwSI3Qp GYgZOk5S6hOgK4CfP7rDUfzGMbIjj3T8+hdBp2x9nkHlBZyv X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-mxs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c index 55178579f3c6..10fb31a5e409 100644 --- a/drivers/spi/spi-mxs.c +++ b/drivers/spi/spi-mxs.c @@ -638,7 +638,7 @@ static int mxs_spi_probe(struct platform_device *pdev) return ret; } -static int mxs_spi_remove(struct platform_device *pdev) +static void mxs_spi_remove(struct platform_device *pdev) { struct spi_master *master; struct mxs_spi *spi; @@ -653,13 +653,11 @@ static int mxs_spi_remove(struct platform_device *pdev) mxs_spi_runtime_suspend(&pdev->dev); dma_release_channel(ssp->dmach); - - return 0; } static struct platform_driver mxs_spi_driver = { .probe = mxs_spi_probe, - .remove = mxs_spi_remove, + .remove_new = mxs_spi_remove, .driver = { .name = DRIVER_NAME, .of_match_table = mxs_spi_dt_ids, From patchwork Fri Mar 3 17:19: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: 13159162 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 563FCC8300C for ; Fri, 3 Mar 2023 17:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231699AbjCCRVv (ORCPT ); Fri, 3 Mar 2023 12:21:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231618AbjCCRV1 (ORCPT ); Fri, 3 Mar 2023 12:21:27 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AE3D5551E for ; Fri, 3 Mar 2023 09:21:17 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95a-0006oS-5S; Fri, 03 Mar 2023 18:21:02 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Y-001bmA-Vw; Fri, 03 Mar 2023 18:21:00 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Y-001tkj-3i; Fri, 03 Mar 2023 18:21:00 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Avi Fishman , Tomer Maimon , Tali Perry , Mark Brown Cc: Patrick Venture , Nancy Yuen , Benjamin Fair , openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 45/87] spi: npcm-fiu: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:19:59 +0100 Message-Id: <20230303172041.2103336-46-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1576; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iYf4/+pZQ85wQgzIBSPxY+nvo82E2hPm8r7TI+SLMq4=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiu69mOQSWOjd8Q2SD7YDWapcUO/5xhwRCk8r ninGpNE9+iJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrugAKCRDB/BR4rcrs CfBYB/9S2zgGAe66UUwbkD8SgXVlFFJ+PaLCH0+gD9EEhPrnCSZ4OlDfxA5iGIv7CHljn/nXdVv P9OFfhI6UTA+TEkCCE+4tLgvmDcz05hUo05SiStc6HE5cuWJ9g2ZXdIHmHJU8wImbskKJ58DoXw EdTQXMF0amkvp0ofKfyhUFY2LwT/ufqiARcp4B/5/qkgB7FwMYUD21j4Dw/oBbeh6CMYn+Paj50 6QU/3UPsXDlMKpWTRyeLbh111rgkx/sAJkaXSFYlQCF6bzX1pm9SWE0zB34hvye76t0GndbJp3f ylgGyf1SD5g4ae8xukBpuBSweObbYvoZun5TyfLh9XGmwLlF X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-npcm-fiu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-npcm-fiu.c b/drivers/spi/spi-npcm-fiu.c index 559d3a5b4062..8d7698d167ef 100644 --- a/drivers/spi/spi-npcm-fiu.c +++ b/drivers/spi/spi-npcm-fiu.c @@ -762,12 +762,11 @@ static int npcm_fiu_probe(struct platform_device *pdev) return ret; } -static int npcm_fiu_remove(struct platform_device *pdev) +static void npcm_fiu_remove(struct platform_device *pdev) { struct npcm_fiu_spi *fiu = platform_get_drvdata(pdev); clk_disable_unprepare(fiu->clk); - return 0; } MODULE_DEVICE_TABLE(of, npcm_fiu_dt_ids); @@ -779,7 +778,7 @@ static struct platform_driver npcm_fiu_driver = { .of_match_table = npcm_fiu_dt_ids, }, .probe = npcm_fiu_probe, - .remove = npcm_fiu_remove, + .remove_new = npcm_fiu_remove, }; module_platform_driver(npcm_fiu_driver); From patchwork Fri Mar 3 17:20: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: 13159150 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 7AE46C7EE43 for ; Fri, 3 Mar 2023 17:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231572AbjCCRVn (ORCPT ); Fri, 3 Mar 2023 12:21:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230381AbjCCRVY (ORCPT ); Fri, 3 Mar 2023 12:21:24 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB27C521DD for ; Fri, 3 Mar 2023 09:21:14 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95a-0006oQ-5u; Fri, 03 Mar 2023 18:21:02 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Y-001bm5-UQ; Fri, 03 Mar 2023 18:21:00 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Y-001tkm-8t; Fri, 03 Mar 2023 18:21:00 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Avi Fishman , Tomer Maimon , Tali Perry , Mark Brown Cc: Patrick Venture , Nancy Yuen , Benjamin Fair , openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 46/87] spi: npcm-pspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:00 +0100 Message-Id: <20230303172041.2103336-47-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1686; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=EKybXEEf2bYsLXDaIL5zgOsRVqQSPR8/936qBvkZb6U=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiu9f/FL6O73qT5I00JECgp0g7p7K6aWqxwFp JZSjr7Gtr6JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrvQAKCRDB/BR4rcrs CVClB/0dgEYGWbY9R1ZBcQR9+9oF2NmJqIJt7GP4Br0Q4qEIPaAl46XiZGno6CZib8ZknyOWCn3 0umQlC6AxXoGrGABh2ODdhP594W5Q3j7dYwMZJU1IP59nx8KrGnm+aWfdxyEwVus1p3ePrRPLMp pu72TgCNGEUoHYB/3qCVJ+V9t15Q9vaPeDMYZXcKf8Dkxanw94+8ljU2ZQg2PZ3UOhG7fb3AaYZ TqxJxjTZdh/QPZp6UQlTktnW/e5wWPZ48vvHE6byk9UcoOlkEMMCo5N3H0yEc/SQlfLAcP9FC2t 94J/hX7qJ3QJdD6wQHNnqXaJNvGErf+qcSvxFAszhpfsKDcB X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-npcm-pspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-npcm-pspi.c b/drivers/spi/spi-npcm-pspi.c index 7f2e4d1b0d43..64585c2a25c5 100644 --- a/drivers/spi/spi-npcm-pspi.c +++ b/drivers/spi/spi-npcm-pspi.c @@ -430,15 +430,13 @@ static int npcm_pspi_probe(struct platform_device *pdev) return ret; } -static int npcm_pspi_remove(struct platform_device *pdev) +static void npcm_pspi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct npcm_pspi *priv = spi_master_get_devdata(master); npcm_pspi_reset_hw(priv); clk_disable_unprepare(priv->clk); - - return 0; } static const struct of_device_id npcm_pspi_match[] = { @@ -454,7 +452,7 @@ static struct platform_driver npcm_pspi_driver = { .of_match_table = npcm_pspi_match, }, .probe = npcm_pspi_probe, - .remove = npcm_pspi_remove, + .remove_new = npcm_pspi_remove, }; module_platform_driver(npcm_pspi_driver); From patchwork Fri Mar 3 17:20: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: 13159123 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 C6382C7EE37 for ; Fri, 3 Mar 2023 17:21:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231225AbjCCRVV (ORCPT ); Fri, 3 Mar 2023 12:21:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231609AbjCCRVK (ORCPT ); Fri, 3 Mar 2023 12:21:10 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6C2E498B3 for ; Fri, 3 Mar 2023 09:21:06 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95a-0006oZ-3W; Fri, 03 Mar 2023 18:21:02 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Z-001bmF-2j; Fri, 03 Mar 2023 18:21:01 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Y-001tkq-GO; Fri, 03 Mar 2023 18:21:00 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Han Xu , Haibo Chen , Mark Brown Cc: Yogesh Gaur , linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 47/87] spi: nxp-fspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:01 +0100 Message-Id: <20230303172041.2103336-48-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1663; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=NpV3p/EIIg9B+9ncrHvdgT00bitwoVQbC+z1NJ8HbYg=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivB9Slb2dFzN7GstOv6NmQZ6iw8Ntlkcu0Z2 HtF6j7LxwuJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrwQAKCRDB/BR4rcrs CXR8B/9/BqC3Qzm1/RYEYNqk2rbP4DzsN+GQTSb4FKjw8eoVoYmwBD9GzOCUhOD0QvyX2b92eKK ivN3/SKfciPvFnYNm1kq3z7xgt/BMpbn2g2EgVrM49gfahbi4C33nkeM8HYCBSFGYSKm7DQh83G pbivnwaBts/NOw1FWRT4HrWQPx6GisuNvxojDzaQFfd2qXKP73QMaBkBcR4E1b2y62C3RautGnp zJDNohrx2n3ns0SeHOWCvr9B1oO7f1loqrWTG+8OI1ap/gyDNLYRNTeKmkNNfZC1m+EVwt98OEd YuK8RnabQ2hg4Tq+HLwmiwqeRkUcdb5888KBfPzkAHwlYZ5D X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-nxp-fspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c index 1c1991a26c15..71be1ec3fbde 100644 --- a/drivers/spi/spi-nxp-fspi.c +++ b/drivers/spi/spi-nxp-fspi.c @@ -1195,7 +1195,7 @@ static int nxp_fspi_probe(struct platform_device *pdev) return ret; } -static int nxp_fspi_remove(struct platform_device *pdev) +static void nxp_fspi_remove(struct platform_device *pdev) { struct nxp_fspi *f = platform_get_drvdata(pdev); @@ -1208,8 +1208,6 @@ static int nxp_fspi_remove(struct platform_device *pdev) if (f->ahb_addr) iounmap(f->ahb_addr); - - return 0; } static int nxp_fspi_suspend(struct device *dev) @@ -1257,7 +1255,7 @@ static struct platform_driver nxp_fspi_driver = { .pm = &nxp_fspi_pm_ops, }, .probe = nxp_fspi_probe, - .remove = nxp_fspi_remove, + .remove_new = nxp_fspi_remove, }; module_platform_driver(nxp_fspi_driver); From patchwork Fri Mar 3 17:20: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: 13159113 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 EEAB5C7EE32 for ; Fri, 3 Mar 2023 17:21:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231363AbjCCRVQ (ORCPT ); Fri, 3 Mar 2023 12:21:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231555AbjCCRVF (ORCPT ); Fri, 3 Mar 2023 12:21:05 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99CD6474FF for ; Fri, 3 Mar 2023 09:21:04 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95a-0006op-Bb; Fri, 03 Mar 2023 18:21:02 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Z-001bmK-DF; Fri, 03 Mar 2023 18:21:01 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Y-001tku-Ln; Fri, 03 Mar 2023 18:21:00 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 48/87] spi: oc-tiny: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:02 +0100 Message-Id: <20230303172041.2103336-49-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1608; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=V7Rr0zmWNSIXuku8Ci0hf+TbY1OYIV9shURn2FEGei4=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivFNRDzpW4VeH3MJ6bEcHEulLOPHsPHoP5i6 PsFSX9z2AWJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrxQAKCRDB/BR4rcrs CWEiB/sH5Xri5G1knxpL57loBvCQK0aZiPD1JOQ1X+aPtucQFscmg94Rs1IP5i7uS78fQGv2bXq rz/WVGJrtxK/3dbHMFR3B2LMQdHGdEICzAWElqp8h1se19xz9hvylx32nAcijygBoeD2zVBUWWG FHwnxl/kNZJnJvfYB5ROkjdMTBWXZqvIYcZv8aGg3KW4fWWfaWCGqoBTeGdrXwQPVx59RdY3k/q Ho2Ai51ih0CAvQyCsTIhN5/OXxB1+t7xToIk8JsjCc7LLc9+qyqgjaHhN7dfMAdjiyC0/rs44Gm bGQoxaqrf5SH4N7mSXILxm8u4Dn9m65OXHX+GWF8W+G42xR4 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-oc-tiny.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-oc-tiny.c b/drivers/spi/spi-oc-tiny.c index 38c14c4e4e21..3af499838e84 100644 --- a/drivers/spi/spi-oc-tiny.c +++ b/drivers/spi/spi-oc-tiny.c @@ -271,14 +271,13 @@ static int tiny_spi_probe(struct platform_device *pdev) return err; } -static int tiny_spi_remove(struct platform_device *pdev) +static void tiny_spi_remove(struct platform_device *pdev) { struct tiny_spi *hw = platform_get_drvdata(pdev); struct spi_master *master = hw->bitbang.master; spi_bitbang_stop(&hw->bitbang); spi_master_put(master); - return 0; } #ifdef CONFIG_OF @@ -291,7 +290,7 @@ MODULE_DEVICE_TABLE(of, tiny_spi_match); static struct platform_driver tiny_spi_driver = { .probe = tiny_spi_probe, - .remove = tiny_spi_remove, + .remove_new = tiny_spi_remove, .driver = { .name = DRV_NAME, .pm = NULL, From patchwork Fri Mar 3 17:20: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: 13159115 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 AFBB2C7EE39 for ; Fri, 3 Mar 2023 17:21:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231536AbjCCRVR (ORCPT ); Fri, 3 Mar 2023 12:21:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230244AbjCCRVG (ORCPT ); Fri, 3 Mar 2023 12:21:06 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F533498B3 for ; Fri, 3 Mar 2023 09:21:05 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95a-0006pB-Sg; Fri, 03 Mar 2023 18:21:02 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Z-001bmO-Io; Fri, 03 Mar 2023 18:21:01 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Y-001tky-Rq; Fri, 03 Mar 2023 18:21:00 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 49/87] spi: omap-uwire: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:03 +0100 Message-Id: <20230303172041.2103336-50-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1641; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7mXdQlIjTyhOln6o3gHRFWbfrhv+Ta6Kbs5lck0Esug=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivJVrGdmDFv+0yA38KP1bqRg3keZuYFLBSr2 XtY13mwkDWJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIryQAKCRDB/BR4rcrs CcH1B/wIILG+SiPX1+W/ZthW7evzduFkSDLchLHZIRBi4bITFPV/Jz89DAA8+ajAKb8ifZdzBj8 aEfJpEn7IkLQNJUVt/iRDJOuneRW9JPmg9299ir69sXx8XWEOSYa2AjIBXSdq3bdzPv3WmMHgo4 MWthRwi+3qW06bauoZeRGc0zv81V4PCXi0wX4qlhAwLK+RZU+7ifYf8/nEjVuLx6WBs9aeiGPki kwgRU5tVwNeZ05867YiQ67mXohEc9z1XuzyacuQXWUM6wv2XMSDDeNaAooENCJIFZ90xDQMNeCo bZ0dq7g82LTb/hvjLHkj5DbnaWuRhsk42DHbIKVurYYwqHO6 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-omap-uwire.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c index 20c87163d612..6da77de19e2b 100644 --- a/drivers/spi/spi-omap-uwire.c +++ b/drivers/spi/spi-omap-uwire.c @@ -505,7 +505,7 @@ static int uwire_probe(struct platform_device *pdev) return status; } -static int uwire_remove(struct platform_device *pdev) +static void uwire_remove(struct platform_device *pdev) { struct uwire_spi *uwire = platform_get_drvdata(pdev); @@ -513,7 +513,6 @@ static int uwire_remove(struct platform_device *pdev) spi_bitbang_stop(&uwire->bitbang); uwire_off(uwire); - return 0; } /* work with hotplug and coldplug */ @@ -524,7 +523,7 @@ static struct platform_driver uwire_driver = { .name = "omap_uwire", }, .probe = uwire_probe, - .remove = uwire_remove, + .remove_new = uwire_remove, // suspend ... unuse ck // resume ... use ck }; From patchwork Fri Mar 3 17:20: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: 13159114 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 6511DC7EE2F for ; Fri, 3 Mar 2023 17:21:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231487AbjCCRVQ (ORCPT ); Fri, 3 Mar 2023 12:21:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231597AbjCCRVF (ORCPT ); Fri, 3 Mar 2023 12:21:05 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E32074743D for ; Fri, 3 Mar 2023 09:21:04 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95b-0006pf-1B; Fri, 03 Mar 2023 18:21:03 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95Z-001bmT-OP; Fri, 03 Mar 2023 18:21:01 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Z-001tl3-1m; Fri, 03 Mar 2023 18:21:01 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 50/87] spi: omap2-mcspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:04 +0100 Message-Id: <20230303172041.2103336-51-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=8yDMBKowUDVEcc54Gu/rkxGcSRFrN+F4zio8ALMP16M=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivNcMUmqddMY5cgFBCovSgMjfZrJUVnyvzBY itu3sd08SqJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIrzQAKCRDB/BR4rcrs Cf3yB/0byV8irS+LJm4X5HGA6mcmsht+nPd6jsdqaI/vEzpFOG9Qtjtb1TTlt5AK7YGj7cNNZNw sbczbOUBek+X+VvkEOThKg2sQi6pTNlV/0piG0zjiIc2U8ES5iiy56lXV/raVynWFqrq1ZCVb9X pUnzCb0FO52bGggYBaGod0VUYg9KfcWSiD1ZOM/OSwJkKoOCrSaGpXuJgBDTv/FFq5UOrG+386A gzPl2Fw+Zw+2oSr46pJuJO6cP8NfBxKpC1Y1j186d3Lv/fWRDIg44RYHFo/1BPt4BEjbMWgJiKz sZJPCngYS6AfoQCQis1Iqfl7uWJAp9F46vIpM9vROerPVaQe X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-omap2-mcspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 6ba9b0d7710b..ce3cdd540420 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -1546,7 +1546,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev) return status; } -static int omap2_mcspi_remove(struct platform_device *pdev) +static void omap2_mcspi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct omap2_mcspi *mcspi = spi_master_get_devdata(master); @@ -1556,8 +1556,6 @@ static int omap2_mcspi_remove(struct platform_device *pdev) pm_runtime_dont_use_autosuspend(mcspi->dev); pm_runtime_put_sync(mcspi->dev); pm_runtime_disable(&pdev->dev); - - return 0; } /* work with hotplug and coldplug */ @@ -1610,7 +1608,7 @@ static struct platform_driver omap2_mcspi_driver = { .of_match_table = omap_mcspi_of_match, }, .probe = omap2_mcspi_probe, - .remove = omap2_mcspi_remove, + .remove_new = omap2_mcspi_remove, }; module_platform_driver(omap2_mcspi_driver); From patchwork Fri Mar 3 17:20: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: 13159119 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 BC1CDC7EE2F for ; Fri, 3 Mar 2023 17:21:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231558AbjCCRVS (ORCPT ); Fri, 3 Mar 2023 12:21:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231570AbjCCRVJ (ORCPT ); Fri, 3 Mar 2023 12:21:09 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC3234C6C3 for ; Fri, 3 Mar 2023 09:21:05 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95b-0006s9-Cm; Fri, 03 Mar 2023 18:21:03 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95a-001bme-6k; Fri, 03 Mar 2023 18:21:02 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Z-001tl8-7U; Fri, 03 Mar 2023 18:21:01 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 51/87] spi: orion: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:05 +0100 Message-Id: <20230303172041.2103336-52-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1740; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zy3UPni8T2BVS1LUElt8lUytcrWtvbpeM8NJ9+w2M7c=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivQjExPpFgkJAxam3gGMgeo0t0es/IXswZZ5 Y6nWQRJSHeJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr0AAKCRDB/BR4rcrs CVtRCACTbc6t1f7/y8DayP7hdP2SqXStSvDTZJwwP/NEuLJmtORs95p+6O8lrZG6pxezMxbCUiX wZZoiNU7L+qPlrFDeKCI4ni1+hm0Pev94KUpdXX3Ooup2cLV7HJUkMOHbsQECEWuBSIn3nzSPlT 1t4s/Q1nelMZLX1Bax0bMWri3YSwAOv61ON1IiUmvCoEuHRmeZNuhNRdEIf7rYnwpgPybFwQPSq 9T5Z2p/MSi9qxu/lkO56k/xZi2wjdr9yRHh3ewP7gYBNLitPlJn6Ea20JivjVJpD84e37ovejTh FUDk564VSXAgami6msY7Gx++6T49ddO+JreHBHbl/VDQrcAu X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-orion.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c index 565cd4c48d7b..e79d1fe0bca4 100644 --- a/drivers/spi/spi-orion.c +++ b/drivers/spi/spi-orion.c @@ -805,7 +805,7 @@ static int orion_spi_probe(struct platform_device *pdev) } -static int orion_spi_remove(struct platform_device *pdev) +static void orion_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct orion_spi *spi = spi_master_get_devdata(master); @@ -816,8 +816,6 @@ static int orion_spi_remove(struct platform_device *pdev) spi_unregister_master(master); pm_runtime_disable(&pdev->dev); - - return 0; } MODULE_ALIAS("platform:" DRIVER_NAME); @@ -857,7 +855,7 @@ static struct platform_driver orion_spi_driver = { .of_match_table = of_match_ptr(orion_spi_of_match_table), }, .probe = orion_spi_probe, - .remove = orion_spi_remove, + .remove_new = orion_spi_remove, }; module_platform_driver(orion_spi_driver); From patchwork Fri Mar 3 17:20: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: 13159118 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 321F3C7EE3A for ; Fri, 3 Mar 2023 17:21:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231594AbjCCRVS (ORCPT ); Fri, 3 Mar 2023 12:21:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231572AbjCCRVI (ORCPT ); Fri, 3 Mar 2023 12:21:08 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9763846173 for ; Fri, 3 Mar 2023 09:21:05 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95b-0006rm-9R; Fri, 03 Mar 2023 18:21:03 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95a-001bma-3C; Fri, 03 Mar 2023 18:21:02 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Z-001tlB-Cx; Fri, 03 Mar 2023 18:21:01 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 52/87] spi: pic32-sqi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:06 +0100 Message-Id: <20230303172041.2103336-53-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1749; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=kt6lObHRr7O11H1ahCC6k0545Cxjn+UpDk72ocJ5aTA=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivUBCdfL22h7H4XId1sT0gJwRd8f8oAfAlXZ Cka0hR5OHuJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr1AAKCRDB/BR4rcrs Cc+iB/9eeSIH0jQzLatR3qPbkKwblTlnTwPFbF0nxDJKzeACgf/sIPaN3g6V8h93RB0zRkG4ntu Yfb6dPju9jBXpuYVyf5PyVjYoZlyK3vBQHpFMgS0qxR2s/rPywSwRJd21ouvGtUWDLmTdZMCi0R pyBsFRCydiKO0EnMmfRHeHNEngt6zKazMkMExVJr399I1EWBUose2w6FY61ZyKgWqq+6Ayy+SAD i1uqbZR1SeMxNF7cfcpxNj77WsddPa/hClfPH9lUo1EPQKayksY1e+UsU+nqRjfNDab5tcrrpBy rxnIr+iPTh6e8fOixrJ+u7Z0CQakgP4s5U1HmLqPXSwNwHfk X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-pic32-sqi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-pic32-sqi.c b/drivers/spi/spi-pic32-sqi.c index 86ad17597f5f..4c8493f34fca 100644 --- a/drivers/spi/spi-pic32-sqi.c +++ b/drivers/spi/spi-pic32-sqi.c @@ -678,7 +678,7 @@ static int pic32_sqi_probe(struct platform_device *pdev) return ret; } -static int pic32_sqi_remove(struct platform_device *pdev) +static void pic32_sqi_remove(struct platform_device *pdev) { struct pic32_sqi *sqi = platform_get_drvdata(pdev); @@ -689,8 +689,6 @@ static int pic32_sqi_remove(struct platform_device *pdev) /* disable clk */ clk_disable_unprepare(sqi->base_clk); clk_disable_unprepare(sqi->sys_clk); - - return 0; } static const struct of_device_id pic32_sqi_of_ids[] = { @@ -705,7 +703,7 @@ static struct platform_driver pic32_sqi_driver = { .of_match_table = of_match_ptr(pic32_sqi_of_ids), }, .probe = pic32_sqi_probe, - .remove = pic32_sqi_remove, + .remove_new = pic32_sqi_remove, }; module_platform_driver(pic32_sqi_driver); From patchwork Fri Mar 3 17:20: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: 13159121 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 8578FC7EE32 for ; Fri, 3 Mar 2023 17:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231631AbjCCRVT (ORCPT ); Fri, 3 Mar 2023 12:21:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231584AbjCCRVK (ORCPT ); Fri, 3 Mar 2023 12:21:10 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65D024743D for ; Fri, 3 Mar 2023 09:21:06 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95c-0006w8-2e; Fri, 03 Mar 2023 18:21:04 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95b-001bn1-4o; Fri, 03 Mar 2023 18:21:03 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Z-001tlF-Jk; Fri, 03 Mar 2023 18:21:01 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 53/87] spi: pic32: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:07 +0100 Message-Id: <20230303172041.2103336-54-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=iawdZ8l5378XXZ2QCMwyt7xRXDh4jbNyBKRHxAx4rxQ=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivY6ZK3URSN7ZOl2fSu03q/bgZrpCqfEppXk X/TlWMD8LuJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr2AAKCRDB/BR4rcrs CeIBB/9be+OrYgJSfJwvqspSbuzaQR1q72iY0aczPTh/1o8fxFXOyN6TgqqG2f5Io10+j6QKKMb 2hK8onDOAIpW0AdYmSlIFguoFri/FJ3aBxN3j0vpfNglKE5UqSsHB5w17hU0EERwg5eGH9IjtLX vk8S7u81ZnD+yZIsHQIyIU52IKvHeiXs/z0feJEaYM1Wosykg3x8jJxAVgHzURZGOGrxlyqu9v7 mTz7e3HIoYr16h5h3vXHql+zY8ognDcLqsUN6M3nfqvJTGadWXNWqmgCqpB70JFMzxq2wQPPTa+ hBYXAxrkF0sgRWcT2UEcdzRZafhbO4oTap/TaJtCtl07hqef X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-pic32.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-pic32.c b/drivers/spi/spi-pic32.c index 7e5c09a7d489..5a64ad0c94fe 100644 --- a/drivers/spi/spi-pic32.c +++ b/drivers/spi/spi-pic32.c @@ -844,7 +844,7 @@ static int pic32_spi_probe(struct platform_device *pdev) return ret; } -static int pic32_spi_remove(struct platform_device *pdev) +static void pic32_spi_remove(struct platform_device *pdev) { struct pic32_spi *pic32s; @@ -852,8 +852,6 @@ static int pic32_spi_remove(struct platform_device *pdev) pic32_spi_disable(pic32s); clk_disable_unprepare(pic32s->clk); pic32_spi_dma_unprep(pic32s); - - return 0; } static const struct of_device_id pic32_spi_of_match[] = { @@ -868,7 +866,7 @@ static struct platform_driver pic32_spi_driver = { .of_match_table = of_match_ptr(pic32_spi_of_match), }, .probe = pic32_spi_probe, - .remove = pic32_spi_remove, + .remove_new = pic32_spi_remove, }; module_platform_driver(pic32_spi_driver); From patchwork Fri Mar 3 17:20:08 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: 13159120 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 337F0C7EE2D for ; Fri, 3 Mar 2023 17:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231629AbjCCRVT (ORCPT ); Fri, 3 Mar 2023 12:21:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231601AbjCCRVJ (ORCPT ); Fri, 3 Mar 2023 12:21:09 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B4A14391F for ; Fri, 3 Mar 2023 09:21:06 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95b-0006tp-LR; Fri, 03 Mar 2023 18:21:03 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95a-001bmn-Jd; Fri, 03 Mar 2023 18:21:02 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Z-001tlJ-Pv; Fri, 03 Mar 2023 18:21:01 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 54/87] spi: ppc4xx: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:08 +0100 Message-Id: <20230303172041.2103336-55-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=tC2otOylt51PYMHjIuRFgHI9ye83HjbKhT0Og66FB4I=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivcYOoi30HPYjfIfti2fTkcG88B37Xg2QdXY KUG7lNuOZiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr3AAKCRDB/BR4rcrs CSZmB/9mS2tiYS8Z/MrC7P2xPdLwsIZHZF4fOwHc91B4VX6HWW3Sv9XO2ZF5iA+mmEdsChN0q9p FTkXAzeRZj3WqVnDxQ5LBbIZ3ePIpk71NiVYQlDZcaMdK0T2o21KzxHgPTjlqGrUos79lkFVVkX 3U5o03m81dFZ0ihBL+RM5ZEOiZ3duT6LoCZoxk0lPGfrC/4/Jc/Xc7xbu/ESxGkDW5PBSNzypoG DgnBFubVjBHkBxcEso6LctbJ/kEyIgT0ycOBaa12OfUwk0f+9AWOXMFY9MpHjVPTWE39XNMmAR5 mb5H7AsF80phdxCz3Je6HJYFeVbFWZIUyrDsmJpFS6KnF6OZ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-ppc4xx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-ppc4xx.c b/drivers/spi/spi-ppc4xx.c index d65f047b6c82..d725e915025d 100644 --- a/drivers/spi/spi-ppc4xx.c +++ b/drivers/spi/spi-ppc4xx.c @@ -464,7 +464,7 @@ static int spi_ppc4xx_of_probe(struct platform_device *op) return ret; } -static int spi_ppc4xx_of_remove(struct platform_device *op) +static void spi_ppc4xx_of_remove(struct platform_device *op) { struct spi_master *master = platform_get_drvdata(op); struct ppc4xx_spi *hw = spi_master_get_devdata(master); @@ -474,7 +474,6 @@ static int spi_ppc4xx_of_remove(struct platform_device *op) free_irq(hw->irqnum, hw); iounmap(hw->regs); spi_master_put(master); - return 0; } static const struct of_device_id spi_ppc4xx_of_match[] = { @@ -486,7 +485,7 @@ MODULE_DEVICE_TABLE(of, spi_ppc4xx_of_match); static struct platform_driver spi_ppc4xx_of_driver = { .probe = spi_ppc4xx_of_probe, - .remove = spi_ppc4xx_of_remove, + .remove_new = spi_ppc4xx_of_remove, .driver = { .name = DRIVER_NAME, .of_match_table = spi_ppc4xx_of_match, From patchwork Fri Mar 3 17:20: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: 13159166 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 5769CC7EE2D for ; Fri, 3 Mar 2023 17:22:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231598AbjCCRWR (ORCPT ); Fri, 3 Mar 2023 12:22:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231157AbjCCRVo (ORCPT ); Fri, 3 Mar 2023 12:21:44 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C111F4D62F for ; Fri, 3 Mar 2023 09:21:22 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95d-0006zL-5A; Fri, 03 Mar 2023 18:21:05 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95b-001bnH-TU; Fri, 03 Mar 2023 18:21:03 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95Z-001tlN-Vr; Fri, 03 Mar 2023 18:21:01 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 55/87] spi: pxa2xx: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:09 +0100 Message-Id: <20230303172041.2103336-56-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1726; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cfAQbVsukiD70ufHL0JB6MzHRyk5ItfVack94AX7bTk=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivg4TDFtLosRPByFAO/KazfGn0zLVxPpaHB7 bg36KK9VoyJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr4AAKCRDB/BR4rcrs CeXsB/0VxEWZ9Pr2d+qnSUKYlUR5LKANES5SkJGd0NKt2Ebag7Gcdgk7wq2oHUXTPtMcwaBhdnq +3vNVkslPZnW1qCFCxlJNfkhkWjp5mIGykcFP6zx+V9cJ2/sIbm9oYOEfAnXptzqb5vCvy0m+4V R4ZeK0zqNPYHTX3OtHzZspjNQKbLci1dgo0nP2SLqSp2WnSUnAHz9R7/hEdrg45KJbFKjkEwAMV 7YI5zacCo5vmPZz5vGpDhe+wI2mFzyv8NF+1+BXJEXgml8dshC57HOjg4nQd2gww4VRWAwAwmcV eEyLgYICHIjgUkBupg4jjzfyy6+yrwFbkna7yY/KHymZqz55 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-pxa2xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 32cc82a89ec1..a75ba2993f3c 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1659,7 +1659,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) return status; } -static int pxa2xx_spi_remove(struct platform_device *pdev) +static void pxa2xx_spi_remove(struct platform_device *pdev) { struct driver_data *drv_data = platform_get_drvdata(pdev); struct ssp_device *ssp = drv_data->ssp; @@ -1684,8 +1684,6 @@ static int pxa2xx_spi_remove(struct platform_device *pdev) /* Release SSP */ pxa_ssp_free(ssp); - - return 0; } static int pxa2xx_spi_suspend(struct device *dev) @@ -1770,7 +1768,7 @@ static struct platform_driver driver = { .of_match_table = of_match_ptr(pxa2xx_spi_of_match), }, .probe = pxa2xx_spi_probe, - .remove = pxa2xx_spi_remove, + .remove_new = pxa2xx_spi_remove, }; static int __init pxa2xx_spi_init(void) From patchwork Fri Mar 3 17:20: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: 13159165 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 7FE7CC87FDD for ; Fri, 3 Mar 2023 17:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231618AbjCCRVw (ORCPT ); Fri, 3 Mar 2023 12:21:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231617AbjCCRV2 (ORCPT ); Fri, 3 Mar 2023 12:21:28 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4E2C47412 for ; Fri, 3 Mar 2023 09:21:17 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95c-0006vJ-76; Fri, 03 Mar 2023 18:21:04 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95a-001bms-UT; Fri, 03 Mar 2023 18:21:02 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95a-001tlQ-5J; Fri, 03 Mar 2023 18:21:02 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Mark Brown Cc: Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 56/87] spi: qcom-qspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:10 +0100 Message-Id: <20230303172041.2103336-57-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1727; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Tx6CXfHNJmGBVRj2EM5iiah+Com8NfpAZ+iA7lFJ+OA=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivkcb28Ws1RIDp9MjLLK0kcZcBcweCkUoh1p K24RaH0vUmJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr5AAKCRDB/BR4rcrs CZSJB/9s7RuVt3jOP/bUujMaMlj88iAiFGahR5OHQq72pTyq0BrMOVRESLZtoT1vMlp3Z/v8ENI jgl2dJUWJdwgBs64VSPYQedV42SFNOKKVpDeMP6c2P3H5l04a4aj0JkSvZH1Qa/wrj6217YfO// RXtehrDRqbB1oKM+xrZ9oOYIbf5JUFjWR0Y2akcql6DPdfvCGjVMW3UDAcCPzZPKbkL3kNy5KAJ XIcgLRVMW4/If6dWWW8AtUBt4YerBbaOk3DFA/zlqQkAinl5BGcBh1vtAmW2JVFkUV4Mj10un+m eLyzIN6q/xFDN17O4TBz8uu5RoTGxyhNTdw0Az2X4O7IuHEU X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-qcom-qspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c index c334dfec4117..15c4e21cd562 100644 --- a/drivers/spi/spi-qcom-qspi.c +++ b/drivers/spi/spi-qcom-qspi.c @@ -552,7 +552,7 @@ static int qcom_qspi_probe(struct platform_device *pdev) return ret; } -static int qcom_qspi_remove(struct platform_device *pdev) +static void qcom_qspi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); @@ -560,8 +560,6 @@ static int qcom_qspi_remove(struct platform_device *pdev) spi_unregister_master(master); pm_runtime_disable(&pdev->dev); - - return 0; } static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev) @@ -655,7 +653,7 @@ static struct platform_driver qcom_qspi_driver = { .of_match_table = qcom_qspi_dt_match, }, .probe = qcom_qspi_probe, - .remove = qcom_qspi_remove, + .remove_new = qcom_qspi_remove, }; module_platform_driver(qcom_qspi_driver); From patchwork Fri Mar 3 17:20: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: 13159122 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 6E705C64EC4 for ; Fri, 3 Mar 2023 17:21:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231570AbjCCRVU (ORCPT ); Fri, 3 Mar 2023 12:21:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231600AbjCCRVK (ORCPT ); Fri, 3 Mar 2023 12:21:10 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE6874C6D7 for ; Fri, 3 Mar 2023 09:21:06 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95c-0006vh-Cb; Fri, 03 Mar 2023 18:21:04 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95b-001bmx-2U; Fri, 03 Mar 2023 18:21:03 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95a-001tlV-Dv; Fri, 03 Mar 2023 18:21:02 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 57/87] spi: rb4xx: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:11 +0100 Message-Id: <20230303172041.2103336-58-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1621; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=PGMqcmyqvitsezbuu3g7hhJrnsb5qdgRKQLpnUJC1EQ=; b=owGbwMvMwMV48I9IxdpTbzgZT6slMaQwaT8P21n4x3R/6GFjnQuVV1emrW39bjBfMVqmL5bZL kYzzuBlJ6MxCwMjF4OsmCJLXZGW2ASJNf/tSpZwwwxiZQKZwsDFKQATOR7F/lfKcMHnvWlBdR8d n1tWKhw6Vbm3UNyYrfPtTR+jOtdG9tT0giiH1So/f2envlRVsIjKsWc469zNkuS04U3AoZB/kxN cSj4VliztEDC/o2TXVOatdX3yFb4rUR/tvubls8tfbuJXnces55kQt/nhvRfXlodwZTO/YNt2gm Fmn2q51uM/LbVztm5+PNf8lZL2vKY1dmIO1o6FGns99BTWH92zwjfv2mpeKa+L2zPkns2qnDMn/ Ilz9OFJ77t27qqR9U66sOiEoi+nvMF9m1NBYltSzfhnKJYnzu5hXb+orle3c0uj/xHOj1ozMsKY niy6UH5YJSjS0O650Mnv5QF5XdaSP+6aNx/qPDPjzKt8AA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-rb4xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-rb4xx.c b/drivers/spi/spi-rb4xx.c index 9f97d18a05c1..e312b30b733b 100644 --- a/drivers/spi/spi-rb4xx.c +++ b/drivers/spi/spi-rb4xx.c @@ -181,13 +181,11 @@ static int rb4xx_spi_probe(struct platform_device *pdev) return 0; } -static int rb4xx_spi_remove(struct platform_device *pdev) +static void rb4xx_spi_remove(struct platform_device *pdev) { struct rb4xx_spi *rbspi = platform_get_drvdata(pdev); clk_disable_unprepare(rbspi->clk); - - return 0; } static const struct of_device_id rb4xx_spi_dt_match[] = { @@ -198,7 +196,7 @@ MODULE_DEVICE_TABLE(of, rb4xx_spi_dt_match); static struct platform_driver rb4xx_spi_drv = { .probe = rb4xx_spi_probe, - .remove = rb4xx_spi_remove, + .remove_new = rb4xx_spi_remove, .driver = { .name = "rb4xx-spi", .of_match_table = of_match_ptr(rb4xx_spi_dt_match), From patchwork Fri Mar 3 17:20: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: 13159124 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 61B70C7EE2D for ; Fri, 3 Mar 2023 17:21:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231308AbjCCRVV (ORCPT ); Fri, 3 Mar 2023 12:21:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231608AbjCCRVL (ORCPT ); Fri, 3 Mar 2023 12:21:11 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 875264D62F for ; Fri, 3 Mar 2023 09:21:07 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95c-0006yR-QV; Fri, 03 Mar 2023 18:21:04 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95b-001bn9-M5; Fri, 03 Mar 2023 18:21:03 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95a-001tlY-Jf; Fri, 03 Mar 2023 18:21:02 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Heiko Stuebner Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 58/87] spi: rockchip-sfc: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:12 +0100 Message-Id: <20230303172041.2103336-59-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=bX62lV2TXhh+Chr6nrCmzfML6Z1r56z5yaVi5PzLxgA=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivrj5tHxRTJlYZlxWo0q/BM24wM1jynBx/c5 uaQAIHVd/OJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr6wAKCRDB/BR4rcrs CZu3CACfuE1Q77oNhvmLE3bTfyqTKU1HGoOxSnsSfbLWeiTFpbR/XRDXh1thy8s0qRpJmxVySx/ N39A8idBKYGWHpgfkyIwXeTx4owGnrUL85wJTzzObScztrImSWymvOHuJHinVigWiXbXN0XFxmT UNa6A5Hs1oPk5pk5/XN8QGCagstBYSPCeP9pZ5nObujWvuAywQBSSPcIUbkNSGe91uH1f73VLeM Sdq7rwk1zLrioymoaIw1clRQnrgxnp2cL0/oFw+MvwQ/KGyujDWCfdgasdeD/TWgAtW+XND2sww Jt92SNe+wj4ovzmxSdVYpD6g2qMBLBWnZEkfpNcoHaf9xUUe X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-rockchip-sfc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c index bd87d3c92dd3..80e1ee110d31 100644 --- a/drivers/spi/spi-rockchip-sfc.c +++ b/drivers/spi/spi-rockchip-sfc.c @@ -656,7 +656,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev) return ret; } -static int rockchip_sfc_remove(struct platform_device *pdev) +static void rockchip_sfc_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct rockchip_sfc *sfc = platform_get_drvdata(pdev); @@ -665,8 +665,6 @@ static int rockchip_sfc_remove(struct platform_device *pdev) clk_disable_unprepare(sfc->clk); clk_disable_unprepare(sfc->hclk); - - return 0; } static const struct of_device_id rockchip_sfc_dt_ids[] = { @@ -681,7 +679,7 @@ static struct platform_driver rockchip_sfc_driver = { .of_match_table = rockchip_sfc_dt_ids, }, .probe = rockchip_sfc_probe, - .remove = rockchip_sfc_remove, + .remove_new = rockchip_sfc_remove, }; module_platform_driver(rockchip_sfc_driver); From patchwork Fri Mar 3 17:20: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: 13159126 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 13892C7EE32 for ; Fri, 3 Mar 2023 17:21:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231450AbjCCRVX (ORCPT ); Fri, 3 Mar 2023 12:21:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231611AbjCCRVL (ORCPT ); Fri, 3 Mar 2023 12:21:11 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A0E4D62C for ; Fri, 3 Mar 2023 09:21:07 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95c-0006yw-Mb; Fri, 03 Mar 2023 18:21:04 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95b-001bnE-QV; Fri, 03 Mar 2023 18:21:03 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95a-001tlc-QN; Fri, 03 Mar 2023 18:21:02 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Heiko Stuebner Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 59/87] spi: rockchip: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:13 +0100 Message-Id: <20230303172041.2103336-60-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=OmQ12uht8IWlDyauzXhSL2XViaI0ICmiBz/+eTBWyf4=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivwwXz9uomS2WWf/vdPN4WnOrhcDT0sutXWv xQEsEcj8FWJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr8AAKCRDB/BR4rcrs CchTB/9Cy3Sbh53UV3ob62jodXiRh/CIKWsQH9D12P9G+M+z5/BfO5xRodY6wK1kS2klGV6tbVG l9d1DMjddgR8KSpou08TP3nI/LOrdO5xNr/jO7jEscJ1smQT4PBTw3386tOg2F+t8Xl3Q3yiHlL ueO/4tjj7D0FYYpTn5qXoBT1L2NBmPvU7k0KHetB1715NmZCPoK7amCPDmBHoEpH3mIx5B7E8Fg IeMQDqHNZKZ8+JVegL/YYkXbUYr+qbh4VpYkchuck8ikPngQwnVCtH61xnwqj8ll/5G3lQXMmMu qpDC+qYlMtVAkmrf6AWfKnn5G9zawZtJOvHV3JnbrD+BEEOn X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-rockchip.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 79242dc5272d..8888a5ff7b2f 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -947,7 +947,7 @@ static int rockchip_spi_probe(struct platform_device *pdev) return ret; } -static int rockchip_spi_remove(struct platform_device *pdev) +static void rockchip_spi_remove(struct platform_device *pdev) { struct spi_controller *ctlr = spi_controller_get(platform_get_drvdata(pdev)); struct rockchip_spi *rs = spi_controller_get_devdata(ctlr); @@ -967,8 +967,6 @@ static int rockchip_spi_remove(struct platform_device *pdev) dma_release_channel(ctlr->dma_rx); spi_controller_put(ctlr); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1076,7 +1074,7 @@ static struct platform_driver rockchip_spi_driver = { .of_match_table = of_match_ptr(rockchip_spi_dt_match), }, .probe = rockchip_spi_probe, - .remove = rockchip_spi_remove, + .remove_new = rockchip_spi_remove, }; module_platform_driver(rockchip_spi_driver); From patchwork Fri Mar 3 17:20: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: 13159127 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 157CFC7EE2F for ; Fri, 3 Mar 2023 17:21:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231609AbjCCRVY (ORCPT ); Fri, 3 Mar 2023 12:21:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231612AbjCCRVL (ORCPT ); Fri, 3 Mar 2023 12:21:11 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91F4D4D63A for ; Fri, 3 Mar 2023 09:21:07 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95d-00070Q-B6; Fri, 03 Mar 2023 18:21:05 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95c-001bnO-Av; Fri, 03 Mar 2023 18:21:04 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95b-001tlf-09; Fri, 03 Mar 2023 18:21:03 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 60/87] spi: rpc-if: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:14 +0100 Message-Id: <20230303172041.2103336-61-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1737; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ryOzExRQWj9L477TOz8eRz1RrDZveIzDF4iFO85B0Aw=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiv0xdnQd6b1zTG6iT8lz0meojWH3aYAdylZ4 EnI6JL2rFeJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr9AAKCRDB/BR4rcrs CT1aB/9EYb3r/6cc8Vs7NqdpjjWAAIW2JuSfaJgQ+skDc19SNJnL+IXoeqFFaqidClwMImHr7iZ epLOu16frf1a+Dp122WRqhui7OAthpTclcHvVaxIraB161tKt/RcTZ0/LKnRzDlCXQ4N2ePpt97 4T46KuhWcj+g70keDI5UhDEn5mO4ahNw4oEhsLTx658qauC51er7m1D8qnJ616sgsR7skEf7dIS LfFvoLyBg5/I7OETEVWaPryeGSSfM6Lu4LKB2RHuYGng0QYYxtkHZHIBXVJFjbkuEtETQRIMhl4 MeaRwF9GVxNe0UK0JkLRBtp3QzBASnZdeTAGAoS6sl8dy9EC X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-rpc-if.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-rpc-if.c b/drivers/spi/spi-rpc-if.c index ec0904faf3a1..2f78124a1b59 100644 --- a/drivers/spi/spi-rpc-if.c +++ b/drivers/spi/spi-rpc-if.c @@ -173,15 +173,13 @@ static int rpcif_spi_probe(struct platform_device *pdev) return error; } -static int rpcif_spi_remove(struct platform_device *pdev) +static void rpcif_spi_remove(struct platform_device *pdev) { struct spi_controller *ctlr = platform_get_drvdata(pdev); struct rpcif *rpc = spi_controller_get_devdata(ctlr); spi_unregister_controller(ctlr); pm_runtime_disable(rpc->dev); - - return 0; } static int __maybe_unused rpcif_spi_suspend(struct device *dev) @@ -202,7 +200,7 @@ static SIMPLE_DEV_PM_OPS(rpcif_spi_pm_ops, rpcif_spi_suspend, rpcif_spi_resume); static struct platform_driver rpcif_spi_driver = { .probe = rpcif_spi_probe, - .remove = rpcif_spi_remove, + .remove_new = rpcif_spi_remove, .driver = { .name = "rpc-if-spi", #ifdef CONFIG_PM_SLEEP From patchwork Fri Mar 3 17:20: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: 13159131 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 263BCC7EE32 for ; Fri, 3 Mar 2023 17:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230387AbjCCRV0 (ORCPT ); Fri, 3 Mar 2023 12:21:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231437AbjCCRVL (ORCPT ); Fri, 3 Mar 2023 12:21:11 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 969884DBC6 for ; Fri, 3 Mar 2023 09:21:07 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95d-00070Y-Dq; Fri, 03 Mar 2023 18:21:05 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95c-001bnR-Df; Fri, 03 Mar 2023 18:21:04 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95b-001tlk-5k; Fri, 03 Mar 2023 18:21:03 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 61/87] spi: rspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:15 +0100 Message-Id: <20230303172041.2103336-62-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1631; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=QQA3DxPWlL3DaRiXjnUzCJPOLgqT0Lar+SVir3luNXw=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiv4hUvIRrKhk6qZv3vft1Jg3le4Bqs9EuJdw lH4p7tT0pWJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr+AAKCRDB/BR4rcrs CVzzCACDuX8Kz3YFGWWcsy8kbwDURMqyMkqkmnpyWCDLIWtK0CH8Jwc+EP24q9LAwLB7PSyA0VG znKf/DDi/HPkS9X2+5XIH27zz4GNGg2I8JfUoBrCGwSvd4GBBCSQZ5YGtO9aFjSgUSw2HlgxpeP wq0LloS6mu1YF/PD7tGOpOBkuAHT4S9ETE38mINFjLBcVkEzQb82OXJ671bLsk1zd9vt/hXaytG FulNvixF0KdCUeTD6SYIpVhrenJmFIEKhTuXXECbKMmt3EHjybDfe2TNxpwhlaTBIbFJ/xRqIMl 8cnZtIxUBefgs1wEnkQmLo5ffq7l9GC6E5T4hs/HBDxn8/tX X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-rspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 411b1307b7fd..f494c86bafea 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -1172,14 +1172,12 @@ static void rspi_release_dma(struct spi_controller *ctlr) dma_release_channel(ctlr->dma_rx); } -static int rspi_remove(struct platform_device *pdev) +static void rspi_remove(struct platform_device *pdev) { struct rspi_data *rspi = platform_get_drvdata(pdev); rspi_release_dma(rspi->ctlr); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct spi_ops rspi_ops = { @@ -1440,7 +1438,7 @@ static SIMPLE_DEV_PM_OPS(rspi_pm_ops, rspi_suspend, rspi_resume); static struct platform_driver rspi_driver = { .probe = rspi_probe, - .remove = rspi_remove, + .remove_new = rspi_remove, .id_table = spi_driver_ids, .driver = { .name = "renesas_spi", From patchwork Fri Mar 3 17:20: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: 13159148 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 58BE8C7EE39 for ; Fri, 3 Mar 2023 17:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231347AbjCCRVl (ORCPT ); Fri, 3 Mar 2023 12:21:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231601AbjCCRVT (ORCPT ); Fri, 3 Mar 2023 12:21:19 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BC7E4DE31 for ; Fri, 3 Mar 2023 09:21:13 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95d-00070f-P8; Fri, 03 Mar 2023 18:21:05 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95c-001bnZ-IR; Fri, 03 Mar 2023 18:21:04 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95b-001tlo-Fg; Fri, 03 Mar 2023 18:21:03 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski , Andi Shyti , Mark Brown Cc: Alim Akhtar , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 62/87] spi: s3c64xx: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:16 +0100 Message-Id: <20230303172041.2103336-63-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=tucUXDHezSL3KgDgyX7M+EMeQDm52S5dcccBPtuX9G8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiv8G7s4yrvtMZ2jtX0+0GrsGDwhg5kg2JsD7 EanMm1iNlyJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr/AAKCRDB/BR4rcrs CVFXB/9AS05Yfcdqg1mk7NDEhTtmbC1DI7frMVT1vbQHnhFluWOC1/G8GPjPWARX8kz+fC0Dypg Hfg/cBSuI7DZhPEGlkV/hozukhGKYpOZ1eBvkF7bM4uIK8sKMDjKHa02lQlcocWST9GesotY3xC mTsdonIZfnAh8aCZpnjh3lQ0Pj6nxzq1SHFR9J13S/rSbgpJzsvcYwT8VUOlltHHqvMoZa13zBY GGRU7pnEyTEXq/S0DAplMNUcu9HNfTbE/ex00TN8LQJv4+TOEcZK4la9wK6ofsCsXLV992fTSBQ rVpgonO2PlOZ7QyBXi1nydljWwywq3jsPepnbnB1rtMP8pYy X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-s3c64xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 71d324ec9a70..cc69f8ffdbdc 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1286,7 +1286,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) return ret; } -static int s3c64xx_spi_remove(struct platform_device *pdev) +static void s3c64xx_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); @@ -1309,8 +1309,6 @@ static int s3c64xx_spi_remove(struct platform_device *pdev) pm_runtime_put_noidle(&pdev->dev); pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1531,7 +1529,7 @@ static struct platform_driver s3c64xx_spi_driver = { .of_match_table = of_match_ptr(s3c64xx_spi_dt_match), }, .probe = s3c64xx_spi_probe, - .remove = s3c64xx_spi_remove, + .remove_new = s3c64xx_spi_remove, .id_table = s3c64xx_spi_driver_ids, }; MODULE_ALIAS("platform:s3c64xx-spi"); From patchwork Fri Mar 3 17:20: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: 13159132 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 A5348C7EE2D for ; Fri, 3 Mar 2023 17:21:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231646AbjCCRV1 (ORCPT ); Fri, 3 Mar 2023 12:21:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231617AbjCCRVM (ORCPT ); Fri, 3 Mar 2023 12:21:12 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC8754D60C for ; Fri, 3 Mar 2023 09:21:07 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95d-00070a-Lr; Fri, 03 Mar 2023 18:21:05 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95c-001bnS-Dp; Fri, 03 Mar 2023 18:21:04 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95b-001tlr-NS; Fri, 03 Mar 2023 18:21:03 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 63/87] spi: sh-hspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:17 +0100 Message-Id: <20230303172041.2103336-64-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1592; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=z8dNBplpaWkGXysJlx4mBquIkfylyak/PPsKy+Lwb9k=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiwALb+UJX0ATs3Fka22Dfw5T6QVvqhVekUn5 e2FMmiKWEqJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsAAAKCRDB/BR4rcrs CexuB/0eB2YiECFNw/vy5D7866KU4y+sf9PKtIvet/78E5UNaAXipAjf4W9W1hIo0QlhKRlf8Vf 1UOo8HKufy5ElfgslWW9GApclSpwTtvmAAZibDhxVf3tdF29camXHI9mbNKDjLLlBkfNNdcsOZR qFB8jq+rUGPvzygOyJrl5i5FScytIO8evMLXVT/3DazWMYoKClimKDx9W2NJIEW843nLNpS7bKO oUYMBp9Tmw0chJflNR9o11krJ604l6Dfljh8JloKLm6LUY8a+Bo+nEUaTIl3eRqS7p4HElHSqoG C++VbclYGn0gsI06eTJS0QzPs+e360a7TZg/UfuUuZTkGkFK X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-sh-hspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-sh-hspi.c b/drivers/spi/spi-sh-hspi.c index a62034e2a7cb..d6ffeae66ed3 100644 --- a/drivers/spi/spi-sh-hspi.c +++ b/drivers/spi/spi-sh-hspi.c @@ -276,15 +276,13 @@ static int hspi_probe(struct platform_device *pdev) return ret; } -static int hspi_remove(struct platform_device *pdev) +static void hspi_remove(struct platform_device *pdev) { struct hspi_priv *hspi = platform_get_drvdata(pdev); pm_runtime_disable(&pdev->dev); clk_put(hspi->clk); - - return 0; } static const struct of_device_id hspi_of_match[] = { @@ -295,7 +293,7 @@ MODULE_DEVICE_TABLE(of, hspi_of_match); static struct platform_driver hspi_driver = { .probe = hspi_probe, - .remove = hspi_remove, + .remove_new = hspi_remove, .driver = { .name = "sh-hspi", .of_match_table = hspi_of_match, From patchwork Fri Mar 3 17:20: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: 13159129 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 6F030C64EC4 for ; Fri, 3 Mar 2023 17:21:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231584AbjCCRVZ (ORCPT ); Fri, 3 Mar 2023 12:21:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbjCCRVL (ORCPT ); Fri, 3 Mar 2023 12:21:11 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B0F54DE31 for ; Fri, 3 Mar 2023 09:21:08 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95d-00070x-Ub; Fri, 03 Mar 2023 18:21:05 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95c-001bnd-Ny; Fri, 03 Mar 2023 18:21:04 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95b-001tlw-Vd; Fri, 03 Mar 2023 18:21:03 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 64/87] spi: sh-msiof: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:18 +0100 Message-Id: <20230303172041.2103336-65-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1695; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=2js/YpPbWT8ivnay+m0tgeU1uGaXIZ8mdL3b54JqH6Q=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiwEZCkTSUw1KIPl4N5mHE7f7poCLBj3NfIMI xu6/d09znCJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsBAAKCRDB/BR4rcrs CSqOB/9dxGg9QLYqqfxQosP2/wgG2WCcCP8+l//2DKVWB3GtE8b0J2wMYn4S5WYk1wkVj0wXsbP KiEqxEWGMm1CjK42KxArQ9iG8k8utLd22kNC+iE0PJRrJoK+eXx+D22j9oVHWRU5yq5kpoFdnmN CrTBk1Sv/ch9/M4KsDU1YLsNP3BG2KiOAQ5/hAzb0n7HxcjVu3q0rMXxWYTfae+CVCUJr5p+ac2 hfdbQJVAYBvmXCN1/b9gKXIQ+v80qeOugJ6TUD0nS/2CQBxKxM+SXX35SLU1ZgcpZzq29uzdP1g QYOUj+HASzFB5VberqFfEIDh50PsBGY2eSiXq6zAVj2UyeuQ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-sh-msiof.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c index 9bca3d076f05..d828a3b370b8 100644 --- a/drivers/spi/spi-sh-msiof.c +++ b/drivers/spi/spi-sh-msiof.c @@ -1375,13 +1375,12 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) return ret; } -static int sh_msiof_spi_remove(struct platform_device *pdev) +static void sh_msiof_spi_remove(struct platform_device *pdev) { struct sh_msiof_spi_priv *p = platform_get_drvdata(pdev); sh_msiof_release_dma(p); pm_runtime_disable(&pdev->dev); - return 0; } static const struct platform_device_id spi_driver_ids[] = { @@ -1414,7 +1413,7 @@ static SIMPLE_DEV_PM_OPS(sh_msiof_spi_pm_ops, sh_msiof_spi_suspend, static struct platform_driver sh_msiof_spi_drv = { .probe = sh_msiof_spi_probe, - .remove = sh_msiof_spi_remove, + .remove_new = sh_msiof_spi_remove, .id_table = spi_driver_ids, .driver = { .name = "spi_sh_msiof", From patchwork Fri Mar 3 17:20: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: 13159128 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 AD068C7EE39 for ; Fri, 3 Mar 2023 17:21:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231612AbjCCRVY (ORCPT ); Fri, 3 Mar 2023 12:21:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231613AbjCCRVL (ORCPT ); Fri, 3 Mar 2023 12:21:11 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE5D94DBDD for ; Fri, 3 Mar 2023 09:21:07 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95d-00071G-OX; Fri, 03 Mar 2023 18:21:05 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95c-001bnj-Tc; Fri, 03 Mar 2023 18:21:04 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95c-001tm0-7Y; Fri, 03 Mar 2023 18:21:04 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 65/87] spi: sh-sci: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:19 +0100 Message-Id: <20230303172041.2103336-66-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1584; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hl+QqjEe834gK9pecOsoaijTUTvz76aFIV6m/I0uauM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiwIm8wzZi4Xuv/Hhp7jwbzMvYn5A/Ik+1S1t TXWfCFXyyeJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsCAAKCRDB/BR4rcrs CSCKB/9ZeAHgXfGjCZrJlgI67gQmcjcc53ZOMyvCbG97d8K3vQTWbcrHdqisUAF0DxbBcCQLRXo epZe2j7rxlK0KUPzxY1QuoOblgqsS/4BN0eqq/G9yvODbG4NCXjlIm3TwsgV3VaSgvTDYq23pWC qrPAXbvHtljI6m9XkPt70Fx/c3wcV0WmvHmhrhn+aCAUKHn8LNtsN8txPT9xPzYEiLeWKnESpHn VOpHTwwM7in70wsbQpNWj2sLoyS+TeY7tdhV297oPiQixualFuQsdN1t9VQVYgDoMxQgPT7Orf/ jmfbB2oHZoXzXXEbr34kOY8toT9s/297JYks2m0/5E4prJqE X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-sh-sci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-sh-sci.c b/drivers/spi/spi-sh-sci.c index 8f30531e1418..0fdfec2de47a 100644 --- a/drivers/spi/spi-sh-sci.c +++ b/drivers/spi/spi-sh-sci.c @@ -171,7 +171,7 @@ static int sh_sci_spi_probe(struct platform_device *dev) return ret; } -static int sh_sci_spi_remove(struct platform_device *dev) +static void sh_sci_spi_remove(struct platform_device *dev) { struct sh_sci_spi *sp = platform_get_drvdata(dev); @@ -179,12 +179,11 @@ static int sh_sci_spi_remove(struct platform_device *dev) setbits(sp, PIN_INIT, 0); iounmap(sp->membase); spi_master_put(sp->bitbang.master); - return 0; } static struct platform_driver sh_sci_spi_drv = { .probe = sh_sci_spi_probe, - .remove = sh_sci_spi_remove, + .remove_new = sh_sci_spi_remove, .driver = { .name = "spi_sh_sci", }, From patchwork Fri Mar 3 17:20: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: 13159130 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 950C9C7EE43 for ; Fri, 3 Mar 2023 17:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231644AbjCCRV0 (ORCPT ); Fri, 3 Mar 2023 12:21:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231618AbjCCRVM (ORCPT ); Fri, 3 Mar 2023 12:21:12 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18D954DE3E for ; Fri, 3 Mar 2023 09:21:08 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95d-00071W-Un; Fri, 03 Mar 2023 18:21:05 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95d-001bnn-3Z; Fri, 03 Mar 2023 18:21:05 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95c-001tm3-D0; Fri, 03 Mar 2023 18:21:04 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 66/87] spi: sh: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:20 +0100 Message-Id: <20230303172041.2103336-67-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1571; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7oroaFd5EHRJUaqjBjhzjnnyD5fH0iV0ap8yQsUg5H0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiwMXNQLqrNzJse4lMsVo5r/0O7YarRF3bcWd xaxREKg5n2JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsDAAKCRDB/BR4rcrs CexQB/9OlWJvcTk+x8Z10C5tvmG1O7cYcXe23R6oKPadSSuebdzaoPCVqYe058vxqNVv0/lpO9W 53OhWr5D9cwamMLo0Uo+S8hHasOWJ++DpGdgSDMwORx8ZmSlEHVUocboufhlbarfRVxXaS5GC2M p41BBygkfWqwAcNOpsWE5zRlszE9i0dlLzXwrVgyz8QysNaebqrF8ZlpUN/OtXKRRHmiChwUnuF /3TAkg6wlQ38KMdsN72EXNA0aK4yUoQDDnok92/f9QORn2hC3h09ODVVZKvZJoHeREtx2T3yypz 9CvYWE9t9pwEGEe8c9AKfR/0iEwH0OMW1JjwG+QgxAVv5NMy X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-sh.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-sh.c b/drivers/spi/spi-sh.c index 3e72fad99adf..d358a2a9c3f5 100644 --- a/drivers/spi/spi-sh.c +++ b/drivers/spi/spi-sh.c @@ -377,14 +377,12 @@ static irqreturn_t spi_sh_irq(int irq, void *_ss) return IRQ_HANDLED; } -static int spi_sh_remove(struct platform_device *pdev) +static void spi_sh_remove(struct platform_device *pdev) { struct spi_sh_data *ss = platform_get_drvdata(pdev); spi_unregister_master(ss->master); free_irq(ss->irq, ss); - - return 0; } static int spi_sh_probe(struct platform_device *pdev) @@ -461,7 +459,7 @@ static int spi_sh_probe(struct platform_device *pdev) static struct platform_driver spi_sh_driver = { .probe = spi_sh_probe, - .remove = spi_sh_remove, + .remove_new = spi_sh_remove, .driver = { .name = "sh_spi", }, From patchwork Fri Mar 3 17:20: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: 13159135 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 611B5C7EE43 for ; Fri, 3 Mar 2023 17:21:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231591AbjCCRV3 (ORCPT ); Fri, 3 Mar 2023 12:21:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231622AbjCCRVN (ORCPT ); Fri, 3 Mar 2023 12:21:13 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 323044FA90 for ; Fri, 3 Mar 2023 09:21:09 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95e-00071m-D4; Fri, 03 Mar 2023 18:21:06 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95d-001bns-BD; Fri, 03 Mar 2023 18:21:05 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95c-001tm9-JU; Fri, 03 Mar 2023 18:21:04 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Palmer Dabbelt , Paul Walmsley Cc: linux-spi@vger.kernel.org, linux-riscv@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 67/87] spi: sifive: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:21 +0100 Message-Id: <20230303172041.2103336-68-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1848; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Tl7WkauIutM+b3al3H9SYheO/VLRXWleqG0ok9ZALEM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiwP6Nec85xqvkHvbxOkc/4mdy7srvBaTQekZ w0Q1BH74N+JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsDwAKCRDB/BR4rcrs CdjyCACLr+zFqnQpOA6JiQxM9YjKlvQVr0zzLOTl4aT/8OfjOzJgE99fhZXdxWktwMpl1qs4pLY 9eg8Ti2aLX+ZnB4ZXgHnvbSGiA9qMkRaCHVvLkU/nVeGIYe1GFEB+qcopMOl0oFbnNR3cnK05k6 LQ5Nnd/QHNLI7loh6Lb+67uo+48wzGYmvtn17jFVZbfPH53MECPjlf8cBFz0sNMR6ojTsyD43cu VK0y9iqxmu0D+PMKC9Q3YjRFRBu30VDEcSzg2zR69vLayDbyWaZPlyDAZ7+81BbEWlrkN3Hmtf0 9sA9nQk8NVTOz1bSvED4ILUiOnao/fJw0mQmr6RmaK84cZ4s X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Conor Dooley --- drivers/spi/spi-sifive.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-sifive.c b/drivers/spi/spi-sifive.c index e29e85cee88a..055de44e0d22 100644 --- a/drivers/spi/spi-sifive.c +++ b/drivers/spi/spi-sifive.c @@ -415,7 +415,7 @@ static int sifive_spi_probe(struct platform_device *pdev) return ret; } -static int sifive_spi_remove(struct platform_device *pdev) +static void sifive_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct sifive_spi *spi = spi_master_get_devdata(master); @@ -423,8 +423,6 @@ static int sifive_spi_remove(struct platform_device *pdev) /* Disable all the interrupts just in case */ sifive_spi_write(spi, SIFIVE_SPI_REG_IE, 0); clk_disable_unprepare(spi->clk); - - return 0; } static int sifive_spi_suspend(struct device *dev) @@ -473,7 +471,7 @@ MODULE_DEVICE_TABLE(of, sifive_spi_of_match); static struct platform_driver sifive_spi_driver = { .probe = sifive_spi_probe, - .remove = sifive_spi_remove, + .remove_new = sifive_spi_remove, .driver = { .name = SIFIVE_SPI_DRIVER_NAME, .pm = &sifive_spi_pm_ops, From patchwork Fri Mar 3 17:20: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: 13159136 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 CFDB8C7EE45 for ; Fri, 3 Mar 2023 17:21:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbjCCRVa (ORCPT ); Fri, 3 Mar 2023 12:21:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231607AbjCCRVN (ORCPT ); Fri, 3 Mar 2023 12:21:13 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F9EF515C1 for ; Fri, 3 Mar 2023 09:21:09 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95e-00072T-PP; Fri, 03 Mar 2023 18:21:06 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95d-001bnz-N2; Fri, 03 Mar 2023 18:21:05 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95c-001tmD-Q0; Fri, 03 Mar 2023 18:21:04 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 68/87] spi: slave-mt27xx: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:22 +0100 Message-Id: <20230303172041.2103336-69-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1552; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Ab4V5NZ+okWKX88AVYBLab3mtSDdyIcxQSnuSDgLtMc=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiwT3SuZ+Wa6QRrFub8PA8YPepqvMK8nLySg/ F6MJWnuZ1eJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsEwAKCRDB/BR4rcrs CWxhB/0QoEU2fib10Z3O5+cd2d4MMANVQKhB9U1xAcy0sCH2otwxcRCmtJfY3bICNK79r2QvLKM UPwWjN81Pgc/bvman9ENlcKIEDhXAxAnkdWU2xKyk+Gw0KBrOanaPxHQ/ORa1XuD1gvaSxcdtUN RGcpnEk9T70XagXceIfBK2W63eFeDRNANA/lNODnhuOXNqbkknB/k6oTKnoqGcXbqr5XBBsDNUu Q6eFp4vL1frpNANodvE6LiRQYfQVhmvaSadM83mFqfFiRhHZG2DxFit4dSIeCAPMqDj1+d5FJMA vYXHVo5UPbkRVQB4cTTnsEQkRimpfPFdCXgUegD6fKZyedAo X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-slave-mt27xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-slave-mt27xx.c b/drivers/spi/spi-slave-mt27xx.c index f199a6c4738a..4e4d426bfb43 100644 --- a/drivers/spi/spi-slave-mt27xx.c +++ b/drivers/spi/spi-slave-mt27xx.c @@ -474,11 +474,9 @@ static int mtk_spi_slave_probe(struct platform_device *pdev) return ret; } -static int mtk_spi_slave_remove(struct platform_device *pdev) +static void mtk_spi_slave_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -560,7 +558,7 @@ static struct platform_driver mtk_spi_slave_driver = { .of_match_table = mtk_spi_slave_of_match, }, .probe = mtk_spi_slave_probe, - .remove = mtk_spi_slave_remove, + .remove_new = mtk_spi_slave_remove, }; module_platform_driver(mtk_spi_slave_driver); From patchwork Fri Mar 3 17:20: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: 13159137 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 132AFC7EE2F for ; Fri, 3 Mar 2023 17:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231622AbjCCRVb (ORCPT ); Fri, 3 Mar 2023 12:21:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231508AbjCCRVN (ORCPT ); Fri, 3 Mar 2023 12:21:13 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 801EB4FA94 for ; Fri, 3 Mar 2023 09:21:09 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95f-00074K-IL; Fri, 03 Mar 2023 18:21:07 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95e-001boH-KG; Fri, 03 Mar 2023 18:21:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95c-001tmH-W9; Fri, 03 Mar 2023 18:21:05 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 69/87] spi: sn-f-ospi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:23 +0100 Message-Id: <20230303172041.2103336-70-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1596; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=2OAOspEyMBAN3IQdbiwsNq3UAfMsGFyCHXl9F2Hg1b8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiwXM7GHQ2667qY6doOAE3pj7/KrH9+aTph/g WrmdlB6/QaJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsFwAKCRDB/BR4rcrs CRijB/9YamlSQwgeFnWW8qEYBp2Vahgi8KQZuHsRDeB7+pmBiGmcgIqzsumCEJWchjI92YQQj/I JBC+H5CSfz34UiAEyUMsZXh9Dn2vSgL86m6ucPgZwCm4AvksXAWY5/4XufejumfS18E7ky0qR3E hI2aVSfKaeXqujbVw7ngVLED7/yQc+SODdHgHrogACJ6++Xm2qXKycrcTRKykhfUejkMkXi9Zi9 3W8jEIzps+lo6zzz8AXzz33kIbHlJ9a7cgLbAzV3Yhl9DBo6uLejMhAGucZjPeXPQYbcyBkum3D 0w3H9ageE0tsFdfXl/40N+p8fHbZ3KuzeTA7XNom+Dhdg02f X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-sn-f-ospi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-sn-f-ospi.c b/drivers/spi/spi-sn-f-ospi.c index 333b22dfd8db..644ae34f623b 100644 --- a/drivers/spi/spi-sn-f-ospi.c +++ b/drivers/spi/spi-sn-f-ospi.c @@ -670,15 +670,13 @@ static int f_ospi_probe(struct platform_device *pdev) return ret; } -static int f_ospi_remove(struct platform_device *pdev) +static void f_ospi_remove(struct platform_device *pdev) { struct f_ospi *ospi = platform_get_drvdata(pdev); clk_disable_unprepare(ospi->clk); mutex_destroy(&ospi->mlock); - - return 0; } static const struct of_device_id f_ospi_dt_ids[] = { @@ -693,7 +691,7 @@ static struct platform_driver f_ospi_driver = { .of_match_table = f_ospi_dt_ids, }, .probe = f_ospi_probe, - .remove = f_ospi_remove, + .remove_new = f_ospi_remove, }; module_platform_driver(f_ospi_driver); From patchwork Fri Mar 3 17:20: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: 13159156 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 A2233C7EE32 for ; Fri, 3 Mar 2023 17:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231684AbjCCRVr (ORCPT ); Fri, 3 Mar 2023 12:21:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231642AbjCCRVZ (ORCPT ); Fri, 3 Mar 2023 12:21:25 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A02E64391F for ; Fri, 3 Mar 2023 09:21:15 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95f-00074D-Gc; Fri, 03 Mar 2023 18:21:07 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95e-001boF-IJ; Fri, 03 Mar 2023 18:21:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95d-001tmL-6W; Fri, 03 Mar 2023 18:21:05 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Orson Zhai , Baolin Wang , Chunyan Zhang Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 70/87] spi: sprd-adi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:24 +0100 Message-Id: <20230303172041.2103336-71-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1651; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4ldR/AHUIY46eqUwLgqKT9Zwt81Hd4ncnUGHNSQTyec=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiwaS0SXEXlVtEpvr5Uzg5fJX/GXhUc1+cyu7 GgCt+SDpPOJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsGgAKCRDB/BR4rcrs CdZbB/49Hx+fXijNx15nNvTZTsOB+DSescBF4JVeCJ4RaxpsXgPW+FzctpUOW+8bGSdCfmarUqK jHG+ugSojgBjGS8CKGwGWSKIjrj1Gbi0qbqBWrO/MSPNE0KDTFZaEU+6lLrj/h/zUroYa8TZAso T/wYaMiY83p0FL4o7dvI33/pbzxNFhVKq2H/2VBPGkRPKjVKJCK4OrYnxX6BmGBwCu8DoTjHnOv Y8eVk8X6FbonWPJ+CCXS6GsqtfJFyzXaAo3bHklKhXUI1eqtmQcF/M5lMDDjHtWUCzoGfMETv7O KsLdg5ahd7w9q97XzOhWeWSbd/rod6TWW27IuBwcwdkVktKt X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-sprd-adi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index 1edbf44c05a7..3b158124d79f 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -608,13 +608,12 @@ static int sprd_adi_probe(struct platform_device *pdev) return ret; } -static int sprd_adi_remove(struct platform_device *pdev) +static void sprd_adi_remove(struct platform_device *pdev) { struct spi_controller *ctlr = dev_get_drvdata(&pdev->dev); struct sprd_adi *sadi = spi_controller_get_devdata(ctlr); unregister_restart_handler(&sadi->restart_handler); - return 0; } static struct sprd_adi_data sc9860_data = { @@ -660,7 +659,7 @@ static struct platform_driver sprd_adi_driver = { .of_match_table = sprd_adi_of_match, }, .probe = sprd_adi_probe, - .remove = sprd_adi_remove, + .remove_new = sprd_adi_remove, }; module_platform_driver(sprd_adi_driver); From patchwork Fri Mar 3 17:20: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: 13159134 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 D4411C7EE32 for ; Fri, 3 Mar 2023 17:21:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231658AbjCCRV3 (ORCPT ); Fri, 3 Mar 2023 12:21:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231623AbjCCRVN (ORCPT ); Fri, 3 Mar 2023 12:21:13 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3224B46173 for ; Fri, 3 Mar 2023 09:21:09 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95f-000744-CO; Fri, 03 Mar 2023 18:21:07 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95e-001boA-Ef; Fri, 03 Mar 2023 18:21:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95d-001tmP-Cv; Fri, 03 Mar 2023 18:21:05 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 71/87] spi: st-ssc4: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:25 +0100 Message-Id: <20230303172041.2103336-72-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1716; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ASXVMuHvpoG3uOSyy2xrFoZNj05mSbabdb6tkczgKjg=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiweFEgcfmwOEmVYq7q578JyMBYELyu3fsgK7 gm9aRGg346JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsHgAKCRDB/BR4rcrs CflFB/4zdDxYDh/aQ7/rG06nVddAQJU+AIavlU7XRMr2IgbDbJM56IA++y4KNKjeqGt7NJt6if7 R0LgyR3k7WpAokJ/z24HzDdIjCSJrLcmC5rop9GHw6bMngUCdjbO5+2BT9gjzgC7hv0qck99Jh6 dycKx6fGAeqDssaEgiqscZOHs96TpjWB0kLz+3QURplQZphd7DZJumEVI2eSv0iNCtj91x58LdZ q/UR4tMdNtdIRmuS0feCx3ICZtH/KeOuv2n7cXBVQCgSxeT3n/Bd8/IX6eHVXNZcDAyxgW1dPAO YWeRMJ4P5tDPq4PMD3xbSOuT08RmXMbPsjdJuyilZvvR9ye5 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-st-ssc4.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-st-ssc4.c b/drivers/spi/spi-st-ssc4.c index 843be803696b..9141f19c7f8e 100644 --- a/drivers/spi/spi-st-ssc4.c +++ b/drivers/spi/spi-st-ssc4.c @@ -366,7 +366,7 @@ static int spi_st_probe(struct platform_device *pdev) return ret; } -static int spi_st_remove(struct platform_device *pdev) +static void spi_st_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct spi_st *spi_st = spi_master_get_devdata(master); @@ -376,8 +376,6 @@ static int spi_st_remove(struct platform_device *pdev) clk_disable_unprepare(spi_st->clk); pinctrl_pm_select_sleep_state(&pdev->dev); - - return 0; } #ifdef CONFIG_PM @@ -451,7 +449,7 @@ static struct platform_driver spi_st_driver = { .of_match_table = of_match_ptr(stm_spi_match), }, .probe = spi_st_probe, - .remove = spi_st_remove, + .remove_new = spi_st_remove, }; module_platform_driver(spi_st_driver); From patchwork Fri Mar 3 17:20: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: 13159141 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 C2129C7EE2D for ; Fri, 3 Mar 2023 17:21:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230312AbjCCRVf (ORCPT ); Fri, 3 Mar 2023 12:21:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbjCCRVQ (ORCPT ); Fri, 3 Mar 2023 12:21:16 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDC16515DE for ; Fri, 3 Mar 2023 09:21:10 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95f-000751-Tm; Fri, 03 Mar 2023 18:21:07 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95e-001boU-VZ; Fri, 03 Mar 2023 18:21:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95d-001tmT-Kb; Fri, 03 Mar 2023 18:21:05 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Maxime Coquelin , Alexandre Torgue Cc: linux-spi@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 72/87] spi: stm32-qspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:26 +0100 Message-Id: <20230303172041.2103336-73-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1820; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hw0v7/VEboyjh4ufaxKxn8YhNW4zVT4Q1r6kSgkyUo8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiwihaoJipsCTCC2VlZLiQcIlqSvMoBNZjkVT 5Ld2Z22ewKJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsIgAKCRDB/BR4rcrs Ce8IB/0ZtukNATZIF/3Yb5ThyqyiBIACWDZEACUFBOO4wLwVejanAY5BQrjsxHj7b9sMg8PWT47 aLxdki5SV3HWRKIBLkDOFvXbOiDTompRmJajZjXPn1iCEBZq09ZUycDF/07kV2eQx7x8cllmFVo Eyr4kB49MKRGIVngivrjPYC8ypRxmne0+BBGezVKXADvOmaVC4ujCvWj8L0GazIXKjv9lkMQdGm HCyx09ijNA9MvPMxB2cR0IueP2eu+/42AoItVfuxgbloHN4Tkz1PptNEUkUb1yA+qH/Ld3Lxh+t OCw4H2U1y+KRn5JWocJ+e896kIo+bJS+uRijTV5GgYC/X6ZG X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-stm32-qspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c index 9131660c1afb..29125af0afdb 100644 --- a/drivers/spi/spi-stm32-qspi.c +++ b/drivers/spi/spi-stm32-qspi.c @@ -888,7 +888,7 @@ static int stm32_qspi_probe(struct platform_device *pdev) return ret; } -static int stm32_qspi_remove(struct platform_device *pdev) +static void stm32_qspi_remove(struct platform_device *pdev) { struct stm32_qspi *qspi = platform_get_drvdata(pdev); @@ -903,8 +903,6 @@ static int stm32_qspi_remove(struct platform_device *pdev) pm_runtime_set_suspended(qspi->dev); pm_runtime_dont_use_autosuspend(qspi->dev); clk_disable_unprepare(qspi->clk); - - return 0; } static int __maybe_unused stm32_qspi_runtime_suspend(struct device *dev) @@ -968,7 +966,7 @@ MODULE_DEVICE_TABLE(of, stm32_qspi_match); static struct platform_driver stm32_qspi_driver = { .probe = stm32_qspi_probe, - .remove = stm32_qspi_remove, + .remove_new = stm32_qspi_remove, .driver = { .name = "stm32-qspi", .of_match_table = stm32_qspi_match, From patchwork Fri Mar 3 17:20: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: 13159144 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 23EDFC64EC4 for ; Fri, 3 Mar 2023 17:21:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230115AbjCCRVh (ORCPT ); Fri, 3 Mar 2023 12:21:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231626AbjCCRVR (ORCPT ); Fri, 3 Mar 2023 12:21:17 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4291C4743D for ; Fri, 3 Mar 2023 09:21:12 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95f-00074T-Go; Fri, 03 Mar 2023 18:21:07 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95e-001boK-M9; Fri, 03 Mar 2023 18:21:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95d-001tmX-RL; Fri, 03 Mar 2023 18:21:05 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alain Volmat , Mark Brown , Maxime Coquelin , Alexandre Torgue Cc: linux-spi@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 73/87] spi: stm32: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:27 +0100 Message-Id: <20230303172041.2103336-74-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1775; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=TTzji5qZuKUEjFFALcmPwLVE5by1HIpRjVd3ggKjoqg=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiwmxvr9esPSJVH5g3dbhmj4salWV2V+ja3L1 clwRFsikZSJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsJgAKCRDB/BR4rcrs CbU2B/9tBylijbSzh84LNRPeuDQ2AJ2zYYwjs0PXJC98NEms2VKjmdiihvSxC+Uj7awn8bN4UFK FVaXmElsMZPkZPb/H3inzmoXSKP7qvjXOy1fB9aYtTwn4I7YqN+DXRL+1Rd1AJOs1JyknRdyusk KsRILGf4DbfoReFAxj4MSdbfs+93DN1d7OcDM0aABAwFjO07Auz+PR8SeTjAPYoRf9M+kO664H3 LVD3YOYJIhcBibqM5no5j3LIGcdbGiRSDCAVqzRCeNGTwsoeHt8zmxAZSs3ir0Hw/yYXurTLIYn 3KDPTdth+C6KjUyq9Ba6ejiPLOVcKlfo9FolbUKVic2mc8SG X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-stm32.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c index def09cf0dc14..9ccb52296e57 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -1922,7 +1922,7 @@ static int stm32_spi_probe(struct platform_device *pdev) return ret; } -static int stm32_spi_remove(struct platform_device *pdev) +static void stm32_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct stm32_spi *spi = spi_master_get_devdata(master); @@ -1946,8 +1946,6 @@ static int stm32_spi_remove(struct platform_device *pdev) pinctrl_pm_select_sleep_state(&pdev->dev); - - return 0; } static int __maybe_unused stm32_spi_runtime_suspend(struct device *dev) @@ -2023,7 +2021,7 @@ static const struct dev_pm_ops stm32_spi_pm_ops = { static struct platform_driver stm32_spi_driver = { .probe = stm32_spi_probe, - .remove = stm32_spi_remove, + .remove_new = stm32_spi_remove, .driver = { .name = DRIVER_NAME, .pm = &stm32_spi_pm_ops, From patchwork Fri Mar 3 17:20: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: 13159161 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 18D74C83003 for ; Fri, 3 Mar 2023 17:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231698AbjCCRVv (ORCPT ); Fri, 3 Mar 2023 12:21:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbjCCRV0 (ORCPT ); Fri, 3 Mar 2023 12:21:26 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 369E055516 for ; Fri, 3 Mar 2023 09:21:16 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95f-000752-PW; Fri, 03 Mar 2023 18:21:07 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95e-001boV-Vi; Fri, 03 Mar 2023 18:21:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95e-001tma-1s; Fri, 03 Mar 2023 18:21:06 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 74/87] spi: sun4i: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:28 +0100 Message-Id: <20230303172041.2103336-75-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1556; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=99g9qdfvrSS6qm9iWAxK+wzfSUWBvdAyiijDNit3EBg=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiwqcCo3xWxzJzcGnx5prGyPVruiRtD7EF/nI rzT4XSvyLeJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsKgAKCRDB/BR4rcrs CckBB/0agkiww+BvoJrtKNgFUshm76/Smt+E19AaDyarBUQRqtRZcigP3f21l3295Q6R/hu99Pa sa2KlrRm/Jra77tPUetLZgcFAdm/q0sXkCgBbQEOcvNwQpugynZF4mT4ZPSUZ02ozIOeuK1FuRn tJVWmGD3o2TaEmBb1BCepyvPmM73TIj+j2Owj6GE0nWUp8jRuq0WD/n5ihe/EGypSfADYHjlO0k jOMJyoK7IRDmf8QIoTGS3UBIuj/20Fq0CZd+D43xvr04OWnXST12hrMaL5MbKOiLdD5+ln2Bu1G KekksLM1Kw/ux8f4t3sAukJq1sCip/gpUXbq6FI++cJTRQKE X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andre Przywara Acked-by: Jernej Skrabec --- drivers/spi/spi-sun4i.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c index 6000d0761206..994d0fb50e68 100644 --- a/drivers/spi/spi-sun4i.c +++ b/drivers/spi/spi-sun4i.c @@ -516,11 +516,9 @@ static int sun4i_spi_probe(struct platform_device *pdev) return ret; } -static int sun4i_spi_remove(struct platform_device *pdev) +static void sun4i_spi_remove(struct platform_device *pdev) { pm_runtime_force_suspend(&pdev->dev); - - return 0; } static const struct of_device_id sun4i_spi_match[] = { @@ -536,7 +534,7 @@ static const struct dev_pm_ops sun4i_spi_pm_ops = { static struct platform_driver sun4i_spi_driver = { .probe = sun4i_spi_probe, - .remove = sun4i_spi_remove, + .remove_new = sun4i_spi_remove, .driver = { .name = "sun4i-spi", .of_match_table = sun4i_spi_match, From patchwork Fri Mar 3 17:20: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: 13159155 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 B20F2C7EE39 for ; Fri, 3 Mar 2023 17:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231673AbjCCRVq (ORCPT ); Fri, 3 Mar 2023 12:21:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231639AbjCCRVY (ORCPT ); Fri, 3 Mar 2023 12:21:24 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43B504ECD7 for ; Fri, 3 Mar 2023 09:21:15 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95f-00074l-LQ; Fri, 03 Mar 2023 18:21:07 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95e-001boQ-Si; Fri, 03 Mar 2023 18:21:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95e-001tmd-7m; Fri, 03 Mar 2023 18:21:06 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 75/87] spi: sun6i: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:29 +0100 Message-Id: <20230303172041.2103336-76-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1756; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=L9wdw5mZJD1vsaD4GQEwuVfgNTBs6fWoi0FoLR2rTVQ=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiwuITs6LHj/7rTzi+xymG3RU8lwSvLmlKteT 41KREEJwfuJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsLgAKCRDB/BR4rcrs CeCXB/sE2z5MFD566vGSlmJavCVDcZrF68yI0pBjuSqykzU3+Mkky/Sw1K39smK9bXqKPXy0H4N as9HApWNnhaeaguFYcjW1P5xANjs6VUa3Fs4n+85PZmiXRwN9sdfvI18SHX4pwnn3VgcE1j59SI RyF80D+eyk/ijOavSgh2X1D7MfG6OKari//TlmGg+5Ipt/aOJHoz6TXDuHizC+jnDI4qH0aZTEX 84YNldTZogH4gGtXbj7KJT3skxuTMmaZnhOujc20PzfAB3F92z9ROsQDycDZ1g45kEtHeCoHIFB zQ/0awKt9m8Bn2sLyhj/E5+RPDhjMer5OFGyvSYRtgWu6lOg X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andre Przywara Acked-by: Jernej Skrabec --- drivers/spi/spi-sun6i.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c index 23ad052528db..43c29afea6bb 100644 --- a/drivers/spi/spi-sun6i.c +++ b/drivers/spi/spi-sun6i.c @@ -683,7 +683,7 @@ static int sun6i_spi_probe(struct platform_device *pdev) return ret; } -static int sun6i_spi_remove(struct platform_device *pdev) +static void sun6i_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); @@ -693,7 +693,6 @@ static int sun6i_spi_remove(struct platform_device *pdev) dma_release_channel(master->dma_tx); if (master->dma_rx) dma_release_channel(master->dma_rx); - return 0; } static const struct of_device_id sun6i_spi_match[] = { @@ -710,7 +709,7 @@ static const struct dev_pm_ops sun6i_spi_pm_ops = { static struct platform_driver sun6i_spi_driver = { .probe = sun6i_spi_probe, - .remove = sun6i_spi_remove, + .remove_new = sun6i_spi_remove, .driver = { .name = "sun6i-spi", .of_match_table = sun6i_spi_match, From patchwork Fri Mar 3 17:20: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: 13159139 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 CA9B8C64EC4 for ; Fri, 3 Mar 2023 17:21:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231645AbjCCRVd (ORCPT ); Fri, 3 Mar 2023 12:21:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231249AbjCCRVP (ORCPT ); Fri, 3 Mar 2023 12:21:15 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5754C4ECDB for ; Fri, 3 Mar 2023 09:21:10 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95g-00075o-4d; Fri, 03 Mar 2023 18:21:08 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95f-001bob-8C; Fri, 03 Mar 2023 18:21:07 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95e-001tmg-Go; Fri, 03 Mar 2023 18:21:06 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Li-hao Kuo , Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 76/87] spi: sunplus-sp7021: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:30 +0100 Message-Id: <20230303172041.2103336-77-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1866; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=BC8y6HiHTBuf/4tooOQVWB0tHvZfgo9E3XZjZvI4uHY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiw3b+ngxLpEsKB+gJjnwpcbAArD4QX2ftHen dXvuE4Y3HGJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsNwAKCRDB/BR4rcrs CcUbB/9LR10MAXWd/ZlMyQpRp63cOY+D1MgoIvs8OFL/4uqCwW71SRxohTWFp/8s9fKi9lpI0xN +nLSDGzTKw4R5PxiZRzdyg/UnUhV4sL0Xc0T9vI8uyytkgRMrXLzyG0A4LKqUFBUtOAVK9SPltB Zy3yi6thHdcRRj8nQjV2Vf//zcUoEtYmuk4hQzQ+UMeysMy9ZT4SrixbCf9HxHvSGR6iS6FK4bh 6yaksWCjXek+FsQOIG0eM2XxuEYAi1JT3yalvfj4sERbSjgtktfnZnO7kibvQIgrxXWlQhJsR0m tnZsLqpQYmWssWkORob4/veGO/cvb7NonL384Wm0AEnbTDHm X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-sunplus-sp7021.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-sunplus-sp7021.c b/drivers/spi/spi-sunplus-sp7021.c index f1fa88777575..eb8f835a4771 100644 --- a/drivers/spi/spi-sunplus-sp7021.c +++ b/drivers/spi/spi-sunplus-sp7021.c @@ -504,14 +504,13 @@ static int sp7021_spi_controller_probe(struct platform_device *pdev) return 0; } -static int sp7021_spi_controller_remove(struct platform_device *pdev) +static void sp7021_spi_controller_remove(struct platform_device *pdev) { struct spi_controller *ctlr = dev_get_drvdata(&pdev->dev); spi_unregister_controller(ctlr); pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); - return 0; } static int __maybe_unused sp7021_spi_controller_suspend(struct device *dev) @@ -564,7 +563,7 @@ MODULE_DEVICE_TABLE(of, sp7021_spi_controller_ids); static struct platform_driver sp7021_spi_controller_driver = { .probe = sp7021_spi_controller_probe, - .remove = sp7021_spi_controller_remove, + .remove_new = sp7021_spi_controller_remove, .driver = { .name = "sunplus,sp7021-spi-controller", .of_match_table = sp7021_spi_controller_ids, From patchwork Fri Mar 3 17:20: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: 13159142 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 F0F1CC7EE2F for ; Fri, 3 Mar 2023 17:21:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230353AbjCCRVg (ORCPT ); Fri, 3 Mar 2023 12:21:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231555AbjCCRVQ (ORCPT ); Fri, 3 Mar 2023 12:21:16 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C321498B3 for ; Fri, 3 Mar 2023 09:21:11 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95g-00078f-Ir; Fri, 03 Mar 2023 18:21:08 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95f-001bos-Ss; Fri, 03 Mar 2023 18:21:07 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95e-001tml-MB; Fri, 03 Mar 2023 18:21:06 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Masahisa Kojima , Jassi Brar , Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 77/87] spi: synquacer: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:31 +0100 Message-Id: <20230303172041.2103336-78-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1840; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=E0G2X9dV+atZQMnBljstN/VPgCB/dcA2sW7aOmGj5ZY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiw7fCU37dLw4TlNUcPIJQbD3PgXUn7WhErUO 93ERdkdQYmJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsOwAKCRDB/BR4rcrs Cc4uB/9B9SY9MN0fWBOsiG5jxXnWDCNg+z7IH6r5ItdEMRPYkH6N9MmTRRINZLld1fvMH6i91OD BpUpV3tbUZO3Ata4rhJVN9kcwA/tXsQ0Q8BR/ygW5cb+ze7jS8c5YYPTZ43+0RYKu7f9dOsiNfG 7zz0tF3eSvPyIrt9Pw64kU9IRZHOAesz3nhw2kqcW+CQS5caKS5PtXUKqCa+oD51e7qjDWqc24p 6Ve/2MzxdZMAZYHD3uFYhIMFDbCfJLsmaRPJ0QnPYo8GLTnRJi32UL+U7Q37tfqf+wqm+tmU+bJ HEr+hOGabzHM6etXStx99tJoldy3o1sJPnDykmPTF2WYetRg X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-synquacer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-synquacer.c b/drivers/spi/spi-synquacer.c index dc188f9202c9..3a92f722a6c5 100644 --- a/drivers/spi/spi-synquacer.c +++ b/drivers/spi/spi-synquacer.c @@ -735,7 +735,7 @@ static int synquacer_spi_probe(struct platform_device *pdev) return ret; } -static int synquacer_spi_remove(struct platform_device *pdev) +static void synquacer_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct synquacer_spi *sspi = spi_master_get_devdata(master); @@ -743,8 +743,6 @@ static int synquacer_spi_remove(struct platform_device *pdev) pm_runtime_disable(sspi->dev); clk_disable_unprepare(sspi->clk); - - return 0; } static int __maybe_unused synquacer_spi_suspend(struct device *dev) @@ -820,7 +818,7 @@ static struct platform_driver synquacer_spi_driver = { .acpi_match_table = ACPI_PTR(synquacer_hsspi_acpi_ids), }, .probe = synquacer_spi_probe, - .remove = synquacer_spi_remove, + .remove_new = synquacer_spi_remove, }; module_platform_driver(synquacer_spi_driver); From patchwork Fri Mar 3 17:20: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: 13159158 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 DB190C7EE43 for ; Fri, 3 Mar 2023 17:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231642AbjCCRVs (ORCPT ); Fri, 3 Mar 2023 12:21:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231608AbjCCRVZ (ORCPT ); Fri, 3 Mar 2023 12:21:25 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E266C5550C for ; Fri, 3 Mar 2023 09:21:15 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95g-00077C-B6; Fri, 03 Mar 2023 18:21:08 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95f-001bok-M2; Fri, 03 Mar 2023 18:21:07 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95e-001tmq-TT; Fri, 03 Mar 2023 18:21:06 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laxman Dewangan , Mark Brown , Thierry Reding , Jonathan Hunter Cc: linux-spi@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 78/87] spi: tegra114: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:32 +0100 Message-Id: <20230303172041.2103336-79-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1796; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ZbrWp4kl8VJm4r6RChgFbUVt91nTQo4cZsMSRna2sFY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAiw/BDgnp0dbH2M3Mn1GZVRNOolnRiciWg8CB Ke5EfgrpmiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsPwAKCRDB/BR4rcrs Cd7KB/4r/FabBgr9qQquxHbG0PPOqKJHrJzmPh7AmvgbVhJyjYr/WO+IhPXdXvM+myxtiXecijv L80ZiF+2Ug0kWn3Q95JZ92H/6DMBOm8bO696vDaXHuDIBqYNTTrbspV/SleWMXx3x64DhKfGO+0 xGh11RiG6wBt7oLqIH4RTzQYFvfMRaOPFT14jH3JXQNUlT9ZEB2MgRlnHPGmJGOP2ophJ1M+P6H ANUOoKjTf1urHkFjgEOgPhidK51x8uK0FeXX68FDHQOIv5FEWtPQiU8GLqzysJZd6yA3uC8lcKt DOkiGkwVjYyum8NUxNYDoJmRv4N95UvAZbjZcNM/rKdIG7QE X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-tegra114.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index d9be80e3e1bc..b6bee922a92c 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -1440,7 +1440,7 @@ static int tegra_spi_probe(struct platform_device *pdev) return ret; } -static int tegra_spi_remove(struct platform_device *pdev) +static void tegra_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct tegra_spi_data *tspi = spi_master_get_devdata(master); @@ -1456,8 +1456,6 @@ static int tegra_spi_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) tegra_spi_runtime_suspend(&pdev->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1526,7 +1524,7 @@ static struct platform_driver tegra_spi_driver = { .of_match_table = tegra_spi_of_match, }, .probe = tegra_spi_probe, - .remove = tegra_spi_remove, + .remove_new = tegra_spi_remove, }; module_platform_driver(tegra_spi_driver); From patchwork Fri Mar 3 17:20: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: 13159157 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 CA690C7EE37 for ; Fri, 3 Mar 2023 17:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231343AbjCCRVs (ORCPT ); Fri, 3 Mar 2023 12:21:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231610AbjCCRVZ (ORCPT ); Fri, 3 Mar 2023 12:21:25 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3689255514 for ; Fri, 3 Mar 2023 09:21:16 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95g-000787-HD; Fri, 03 Mar 2023 18:21:08 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95f-001bop-Qi; Fri, 03 Mar 2023 18:21:07 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95f-001tmw-3c; Fri, 03 Mar 2023 18:21:07 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laxman Dewangan , Mark Brown , Thierry Reding , Jonathan Hunter Cc: linux-spi@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 79/87] spi: tegra20-sflash: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:33 +0100 Message-Id: <20230303172041.2103336-80-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1855; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0yHwtY1f2DEh02cYlnTMnLJgqt1UL9ENFOM4udCRK8w=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAixCpAnkujA/9YRVxhg1FkrU6OzM9lq8Z6whK wu1f4nXnD6JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsQgAKCRDB/BR4rcrs Cda9CACUUY3zGSi9U5ADSAv/xKGfeHhiu7Qm2ZpWcwC+Sq0Gb2BlhMWU6qDsxJDRtkX+mWHi2/0 4OblTfMpdGWLPNIWQTWyy5hIBHJajqiM1gREcGsimwqaR0AwqVL3LksKVppbt5fdUxnk0FGx9cw 0WLlJGxA4LYWveLj2UbXdfeof8rh/v8pbxq13ZUqihJiJ9fE/Wp2Oo34//JX1uuB41h6uyQ7SGe dtKllfMKhLlgh3MSnPdssON+dNnsebcBlzYvQTXDt33yAUJxukYnAOgX9oICe+2kr8lu09a62NN ai4HsmdCWOKaIPMCtbSzc8277ajeVP1vzYCNOYjoktuIClnC X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-tegra20-sflash.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c index 220ee08c4a06..ed82530ea64b 100644 --- a/drivers/spi/spi-tegra20-sflash.c +++ b/drivers/spi/spi-tegra20-sflash.c @@ -520,7 +520,7 @@ static int tegra_sflash_probe(struct platform_device *pdev) return ret; } -static int tegra_sflash_remove(struct platform_device *pdev) +static void tegra_sflash_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct tegra_sflash_data *tsd = spi_master_get_devdata(master); @@ -530,8 +530,6 @@ static int tegra_sflash_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) tegra_sflash_runtime_suspend(&pdev->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -598,7 +596,7 @@ static struct platform_driver tegra_sflash_driver = { .of_match_table = tegra_sflash_of_match, }, .probe = tegra_sflash_probe, - .remove = tegra_sflash_remove, + .remove_new = tegra_sflash_remove, }; module_platform_driver(tegra_sflash_driver); From patchwork Fri Mar 3 17:20: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: 13159163 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 46042C7EE45 for ; Fri, 3 Mar 2023 17:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231613AbjCCRVu (ORCPT ); Fri, 3 Mar 2023 12:21:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231222AbjCCRV0 (ORCPT ); Fri, 3 Mar 2023 12:21:26 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52D3555518 for ; Fri, 3 Mar 2023 09:21:16 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95i-0007FZ-W6; Fri, 03 Mar 2023 18:21:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95g-001bp2-Aj; Fri, 03 Mar 2023 18:21:08 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95f-001tmz-A9; Fri, 03 Mar 2023 18:21:07 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laxman Dewangan , Mark Brown , Thierry Reding , Jonathan Hunter Cc: linux-spi@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 80/87] spi: tegra20-slink: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:34 +0100 Message-Id: <20230303172041.2103336-81-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-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=wVFz0CNw+fCVgWChfWLOK2RDEB/isoEpt3kufOo7JQE=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAixGrw8czG1d0NhnmQMIBHgv0L4Jg25CKdbI7 yVdW/n6XJKJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsRgAKCRDB/BR4rcrs Cb2/B/4gBBoy57raPWPYBNhPL7Po2Hmguq3RDR4wJ25LB/Yior+iRFeri8MeIqebhGUqiVQDxPL Sg392kLUF7K0KMe2hf9CXb6WDzvUeFti9KR+/LcFUqji3eUZ91YLKH4MumUp0CkwrW7h0ym5bNW 7hTL1uf8zngeQNy26KUmH630XNnOY2KOaUD7eHUM1+LB9i9VUll8l1QL+3bF96/ZgKHpM5zENvE hy0DQPtrfqJHZwcJ7DoLfSS9QhZbQxGweNplwVUzJMObRcyT8n7Qlf1G2MPwUNA/BJzG1KlrZGf z9nKC+ev5IoSFJ9X4GGRlq3fDbtO95pjWYDtaggXXA1K8O7m X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-tegra20-slink.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index 148043d0c2b8..ac7933bc03e2 100644 --- a/drivers/spi/spi-tegra20-slink.c +++ b/drivers/spi/spi-tegra20-slink.c @@ -1134,7 +1134,7 @@ static int tegra_slink_probe(struct platform_device *pdev) return ret; } -static int tegra_slink_remove(struct platform_device *pdev) +static void tegra_slink_remove(struct platform_device *pdev) { struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); struct tegra_slink_data *tspi = spi_master_get_devdata(master); @@ -1152,7 +1152,6 @@ static int tegra_slink_remove(struct platform_device *pdev) tegra_slink_deinit_dma_param(tspi, true); spi_master_put(master); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1220,7 +1219,7 @@ static struct platform_driver tegra_slink_driver = { .of_match_table = tegra_slink_of_match, }, .probe = tegra_slink_probe, - .remove = tegra_slink_remove, + .remove_new = tegra_slink_remove, }; module_platform_driver(tegra_slink_driver); From patchwork Fri Mar 3 17:20: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: 13159160 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 005FBC7EE3A for ; Fri, 3 Mar 2023 17:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231610AbjCCRVt (ORCPT ); Fri, 3 Mar 2023 12:21:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231613AbjCCRVZ (ORCPT ); Fri, 3 Mar 2023 12:21:25 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0193C4ECDB for ; Fri, 3 Mar 2023 09:21:15 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95h-00079k-6B; Fri, 03 Mar 2023 18:21:09 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95g-001bp0-8g; Fri, 03 Mar 2023 18:21:08 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95f-001tn3-HA; Fri, 03 Mar 2023 18:21:07 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laxman Dewangan , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Mark Brown Cc: linux-tegra@vger.kernel.org, linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 81/87] spi: tegra210-quad: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:35 +0100 Message-Id: <20230303172041.2103336-82-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1863; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=i8CVbkIbpfthZgmIdP2HelMOokdVHNzXjjv7NJXvnPQ=; b=owGbwMvMwMV48I9IxdpTbzgZT6slMaQw6Xjx+T2tr1xW9XlTX5SGf7dtcnKoqM8J34efJNsKA nhZjNI7GY1ZGBi5GGTFFFnqirTEJkis+W9XsoQbZhArE8gUBi5OAZgIvxQHwySLtAWCVlkiLVWL fjjvtjkWNmOBinD3nL6Lsb1Zqdw9+2x124SennFTi/RbnJQVxnpxduO1Wzcrdr/ofcllKHDyekl JtYiz3ZGHSwXsXKZFGjYfkvVY5jB9Rf6b7UFxLfsmak7381V5ejvtbZKT8oq/S1y66990n09UTZ /m7RIslPTz3MQU7UVF+/yS1NcJCTjVHDz1sG7DjbVWDgzB1pF19s52KaUax1TUNkq83CYrKnyjc k6a+8J3f32nz5U2VzXca7N9ufz1a5cCZU8c28y2IGkBd8Sh6LydpgabMnbXn+AvcD/13j70//6Y 9hMXArc+dWfqEWVjv2TnbeJ+P9ONNVnpq/Tu9sWduvcB X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-tegra210-quad.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c index 0b9bc3b7f53a..fd0d532364e2 100644 --- a/drivers/spi/spi-tegra210-quad.c +++ b/drivers/spi/spi-tegra210-quad.c @@ -1630,7 +1630,7 @@ static int tegra_qspi_probe(struct platform_device *pdev) return ret; } -static int tegra_qspi_remove(struct platform_device *pdev) +static void tegra_qspi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct tegra_qspi *tqspi = spi_master_get_devdata(master); @@ -1639,8 +1639,6 @@ static int tegra_qspi_remove(struct platform_device *pdev) free_irq(tqspi->irq, tqspi); pm_runtime_force_suspend(&pdev->dev); tegra_qspi_deinit_dma(tqspi); - - return 0; } static int __maybe_unused tegra_qspi_suspend(struct device *dev) @@ -1714,7 +1712,7 @@ static struct platform_driver tegra_qspi_driver = { .acpi_match_table = ACPI_PTR(tegra_qspi_acpi_match), }, .probe = tegra_qspi_probe, - .remove = tegra_qspi_remove, + .remove_new = tegra_qspi_remove, }; module_platform_driver(tegra_qspi_driver); From patchwork Fri Mar 3 17:20: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: 13159145 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 07379C7EE2D for ; Fri, 3 Mar 2023 17:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229974AbjCCRVi (ORCPT ); Fri, 3 Mar 2023 12:21:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231131AbjCCRVS (ORCPT ); Fri, 3 Mar 2023 12:21:18 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DDFD4C6EA for ; Fri, 3 Mar 2023 09:21:12 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95h-0007AU-LG; Fri, 03 Mar 2023 18:21:09 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95g-001bp9-Kh; Fri, 03 Mar 2023 18:21:08 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95f-001tn6-NS; Fri, 03 Mar 2023 18:21:07 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 82/87] spi: topcliff-pch: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:36 +0100 Message-Id: <20230303172041.2103336-83-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1879; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cdZ06FB1jWqZBGeHFWF8P3bWq1hQ4UCD4b7AkbyXEFs=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAixO/T0sni092vqaWiG8/YlQmRb+imHbqlnzI DMRjcdDUHOJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsTgAKCRDB/BR4rcrs CUnKB/0SV6DqoZbRg3lHOcZQgPorUmFHBCSqHHt8tYjRen023I1bdxuLD6nt6jEqiusootvFXin Mlo9Y0CWDqvM4JJPHVe/vBWoR/yGsv7zbX41+8BO6VPvJhmQOUakWMfuq3BBrdY6J7qGjS2HKaT 0NKD7LBxiWNWcCcLMqaleZrIrxPDLZ56gJ2vlI5DPpN+nFx/dfPt3tR5nR6fABfyt3/O4nNU4NB mg7/p54fbC2a1X8RiYbocBsX1ifGtOwvPt6tS5xmlcKEg46kx2rSVYmDmsfyhs5T2HoL6lyFlDp i6JGXiHqM8W6GO/nTyC9hiktOOgWzlUSuNiEm3QdEAucoTYY X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-topcliff-pch.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index cbb60198a7f0..1679a0ba3d62 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -1396,7 +1396,7 @@ static int pch_spi_pd_probe(struct platform_device *plat_dev) return ret; } -static int pch_spi_pd_remove(struct platform_device *plat_dev) +static void pch_spi_pd_remove(struct platform_device *plat_dev) { struct pch_spi_board_data *board_dat = dev_get_platdata(&plat_dev->dev); struct pch_spi_data *data = platform_get_drvdata(plat_dev); @@ -1434,8 +1434,6 @@ static int pch_spi_pd_remove(struct platform_device *plat_dev) pci_iounmap(board_dat->pdev, data->io_remap_addr); spi_unregister_master(data->master); - - return 0; } #ifdef CONFIG_PM static int pch_spi_pd_suspend(struct platform_device *pd_dev, @@ -1516,7 +1514,7 @@ static struct platform_driver pch_spi_pd_driver = { .name = "pch-spi", }, .probe = pch_spi_pd_probe, - .remove = pch_spi_pd_remove, + .remove_new = pch_spi_pd_remove, .suspend = pch_spi_pd_suspend, .resume = pch_spi_pd_resume }; From patchwork Fri Mar 3 17:20: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: 13159147 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 48693C7EE2F for ; Fri, 3 Mar 2023 17:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbjCCRVk (ORCPT ); Fri, 3 Mar 2023 12:21:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231598AbjCCRVS (ORCPT ); Fri, 3 Mar 2023 12:21:18 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 332424DBC1 for ; Fri, 3 Mar 2023 09:21:13 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95i-0007Bx-4s; Fri, 03 Mar 2023 18:21:10 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95g-001bpE-QS; Fri, 03 Mar 2023 18:21:08 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95f-001tnB-Tv; Fri, 03 Mar 2023 18:21:07 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Kunihiko Hayashi , Masami Hiramatsu Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 83/87] spi: uniphier: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:37 +0100 Message-Id: <20230303172041.2103336-84-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1841; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=WCJcpXLjYNcutqOQiSyWeJfVx4NI9iM787/Q1khNnjY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAixSCO4nDQe9R7uWiDtH9Ty06s5hRAo3fjkkk Thjg/AzEMaJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsUgAKCRDB/BR4rcrs CSrTB/wJ4VDTDnsleRQc4gRJBOZi4wLNWq2Fs2psyrdtMm493VhdBYatAwl/YztiJgNVvNt20UA pprb9Sky4VM8R+U52jr3YRQrKNz7SXs0KOVbW/Nihw4foeXjqGDtGsxUAXev+WY3X+rP/JSlP65 NA4I5uo3KStT6NPOe16QZ3a9aDLpF6InzTiXI2DURSlyaLRTv6UntSKCQw4HvE+3IRp96jCZA/I Y7OKTUnXUGm1Nhz3md7WnJbPi5eUdR2uDFllwWyhAdR0PQE4rNwnLAR8jrxC0V5CeA19uJcJQoP +U7AiLDNMtPHiXTgphuVRpptDbmbdu+p3Gg1H98e8J//76a4 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-uniphier.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c index cc0da4822231..f5344527af0b 100644 --- a/drivers/spi/spi-uniphier.c +++ b/drivers/spi/spi-uniphier.c @@ -775,7 +775,7 @@ static int uniphier_spi_probe(struct platform_device *pdev) return ret; } -static int uniphier_spi_remove(struct platform_device *pdev) +static void uniphier_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct uniphier_spi_priv *priv = spi_master_get_devdata(master); @@ -786,8 +786,6 @@ static int uniphier_spi_remove(struct platform_device *pdev) dma_release_channel(master->dma_rx); clk_disable_unprepare(priv->clk); - - return 0; } static const struct of_device_id uniphier_spi_match[] = { @@ -798,7 +796,7 @@ MODULE_DEVICE_TABLE(of, uniphier_spi_match); static struct platform_driver uniphier_spi_driver = { .probe = uniphier_spi_probe, - .remove = uniphier_spi_remove, + .remove_new = uniphier_spi_remove, .driver = { .name = "uniphier-spi", .of_match_table = uniphier_spi_match, From patchwork Fri Mar 3 17:20: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: 13159146 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 1F8D0C64EC4 for ; Fri, 3 Mar 2023 17:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230228AbjCCRVj (ORCPT ); Fri, 3 Mar 2023 12:21:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231597AbjCCRVS (ORCPT ); Fri, 3 Mar 2023 12:21:18 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB5504D63A for ; Fri, 3 Mar 2023 09:21:12 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95h-0007CA-SG; Fri, 03 Mar 2023 18:21:09 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95g-001bpF-Rb; Fri, 03 Mar 2023 18:21:08 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95g-001tnF-3s; Fri, 03 Mar 2023 18:21:08 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Michal Simek Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 84/87] spi: xilinx: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:38 +0100 Message-Id: <20230303172041.2103336-85-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1808; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=1coSjyLVCt5hqzIgXmUNdRRTtaEsNmf1x/8dcg0B/7Q=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAixVdD3ol4CCLpPAXERy7eINNJy/LoDtjkAOs G0TJpGKW2GJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsVQAKCRDB/BR4rcrs CWpDB/wMXwpw7ruvyvKiQP+M13DVGSxsNOZnV5GZfdNyF8HLRCY5tk/WrHu1/E+xVDGPHVU6q5u ckFpO0EvAGI77kKnXh3Ti1PEdCUZFMI3Nvom6OmKEKWNUQbSqoYTZEzdiXLIy8qqjIHtaMQ9qk1 B+/uMA8ukZvbHiJ7c80BiBYetJiCjcC9cFhN9yFEob1yEKCPE3GtpDp01I0/TT60bHjcEoIVxlC hp0L7Aiy8U9l1nCqaQtxHCc1tdSKztutPWLZdXa6xX5RBe7++mFe5fXtbCrz2UUYUQl5VMUJlln txyHn81GwL0hzPTqlzcenGvDTwGacTPv80zHeFcFQbMmul4G X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-xilinx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index 1411548f4255..d2f9eea5e093 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c @@ -504,7 +504,7 @@ static int xilinx_spi_probe(struct platform_device *pdev) return 0; } -static int xilinx_spi_remove(struct platform_device *pdev) +static void xilinx_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct xilinx_spi *xspi = spi_master_get_devdata(master); @@ -518,8 +518,6 @@ static int xilinx_spi_remove(struct platform_device *pdev) xspi->write_fn(0, regs_base + XIPIF_V123B_DGIER_OFFSET); spi_master_put(xspi->bitbang.master); - - return 0; } /* work with hotplug and coldplug */ @@ -527,7 +525,7 @@ MODULE_ALIAS("platform:" XILINX_SPI_NAME); static struct platform_driver xilinx_spi_driver = { .probe = xilinx_spi_probe, - .remove = xilinx_spi_remove, + .remove_new = xilinx_spi_remove, .driver = { .name = XILINX_SPI_NAME, .of_match_table = xilinx_spi_of_match, From patchwork Fri Mar 3 17:20: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: 13159152 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 95508C7EE3A for ; Fri, 3 Mar 2023 17:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231556AbjCCRVn (ORCPT ); Fri, 3 Mar 2023 12:21:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231635AbjCCRVU (ORCPT ); Fri, 3 Mar 2023 12:21:20 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3ED6515E7 for ; Fri, 3 Mar 2023 09:21:13 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95i-0007Ed-KS; Fri, 03 Mar 2023 18:21:10 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95h-001bpP-6v; Fri, 03 Mar 2023 18:21:09 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95g-001tnI-9Y; Fri, 03 Mar 2023 18:21:08 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Max Filippov , Mark Brown Cc: linux-xtensa@linux-xtensa.org, linux-spi@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 85/87] spi: xtensa-xtfpga: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:39 +0100 Message-Id: <20230303172041.2103336-86-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1751; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zddy/8H1Q+53nes0ZYo/vlUEp77xSSG4Eoaio2TywRQ=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAixZKLMpsnqaWhb1HLuRtf2bPnCYCczNppZHL npmL/3EaFGJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsWQAKCRDB/BR4rcrs CVVmCACa/eT7gD2Msi+jN138Zo6eMlbmWARG3V0nBkMnyetMVg8A1dLWiqCA6kmHeZmsPvuIMj9 WEJ0yid/++IvNUoAerxsijF+4Zmmayp6xftqxtiz8XMn2CIReKi2acUFkFF6JYhlcSkrSVh1N6w G4OfieUMk2gh6fZ2iq2+Bdi0x6ODl80DKjCWRRpOjY7VJ80t5bh5nJVyinyTZkpF4RGha2rRR79 VRZnPlks1x+fNAl4RZim4878/wqXhL5t54I1qeB4hmsd51k7B0zYgRqliYrh2TCvq6PnpvpPIN0 jixz3ww70P4iR8vVApNQVni9fGFckTbH4wzcvSO7byIx60Ad X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-xtensa-xtfpga.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-xtensa-xtfpga.c b/drivers/spi/spi-xtensa-xtfpga.c index 2fa7608f94cd..24dc845b940e 100644 --- a/drivers/spi/spi-xtensa-xtfpga.c +++ b/drivers/spi/spi-xtensa-xtfpga.c @@ -117,15 +117,13 @@ static int xtfpga_spi_probe(struct platform_device *pdev) return 0; } -static int xtfpga_spi_remove(struct platform_device *pdev) +static void xtfpga_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct xtfpga_spi *xspi = spi_master_get_devdata(master); spi_bitbang_stop(&xspi->bitbang); spi_master_put(master); - - return 0; } MODULE_ALIAS("platform:" XTFPGA_SPI_NAME); @@ -140,7 +138,7 @@ MODULE_DEVICE_TABLE(of, xtfpga_spi_of_match); static struct platform_driver xtfpga_spi_driver = { .probe = xtfpga_spi_probe, - .remove = xtfpga_spi_remove, + .remove_new = xtfpga_spi_remove, .driver = { .name = XTFPGA_SPI_NAME, .of_match_table = of_match_ptr(xtfpga_spi_of_match), From patchwork Fri Mar 3 17:20: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: 13159151 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 6A2C6C7EE37 for ; Fri, 3 Mar 2023 17:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231391AbjCCRVm (ORCPT ); Fri, 3 Mar 2023 12:21:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231636AbjCCRVU (ORCPT ); Fri, 3 Mar 2023 12:21:20 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF8364FA90 for ; Fri, 3 Mar 2023 09:21:13 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95i-0007EF-KC; Fri, 03 Mar 2023 18:21:10 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95h-001bpM-5B; Fri, 03 Mar 2023 18:21:09 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95g-001tnN-G0; Fri, 03 Mar 2023 18:21:08 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Michal Simek Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 86/87] spi: zynq-qspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:40 +0100 Message-Id: <20230303172041.2103336-87-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1799; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6KxIrLLIN+exUhsDNYaSHiJgnuFJTXjdKzGoSUWhooI=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAixd8jAOSKYod2yr/bKL2CBnPCZyfmw3rhFM3 sTNngGC6daJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsXQAKCRDB/BR4rcrs Cev1B/9Z0L28LMfYw8AlHCnQ/7Rx1oSP0b0osC99N+FzxQWVSwRb9Cg7uA3BtYxEJ62iUZacLbq 5Z2EzwicglevXrRG3jysgLGsq91CHLV4xHdpkimhZoR2gjOBYYp7/gOjvAjOxQQ/Ktawh/ORIO4 KjYrMZ4pWbo4DLS0ze5n+WDJadKJKuyJiZ/ExpHBc4BvjyZY89nFsgmHdIHTLvTlpimOCohkFpL b05r0KdSD2A3AbZmLzzHjQCgKoy2KAZ4NXQ+ybomSNoA/J624+RB36jk/DJVx/dmAE6VgJgbY8m 9QHVNCN7LHAb1p9W4kay0h9en34Dw2XexAJhgm7gvE8DppVW X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-zynq-qspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c index 78f31b61a2aa..8558c0fe3775 100644 --- a/drivers/spi/spi-zynq-qspi.c +++ b/drivers/spi/spi-zynq-qspi.c @@ -741,7 +741,7 @@ static int zynq_qspi_probe(struct platform_device *pdev) * * Return: 0 on success and error value on failure */ -static int zynq_qspi_remove(struct platform_device *pdev) +static void zynq_qspi_remove(struct platform_device *pdev) { struct zynq_qspi *xqspi = platform_get_drvdata(pdev); @@ -749,8 +749,6 @@ static int zynq_qspi_remove(struct platform_device *pdev) clk_disable_unprepare(xqspi->refclk); clk_disable_unprepare(xqspi->pclk); - - return 0; } static const struct of_device_id zynq_qspi_of_match[] = { @@ -765,7 +763,7 @@ MODULE_DEVICE_TABLE(of, zynq_qspi_of_match); */ static struct platform_driver zynq_qspi_driver = { .probe = zynq_qspi_probe, - .remove = zynq_qspi_remove, + .remove_new = zynq_qspi_remove, .driver = { .name = "zynq-qspi", .of_match_table = zynq_qspi_of_match, From patchwork Fri Mar 3 17:20: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: 13159154 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 4E15DC7EE2D for ; Fri, 3 Mar 2023 17:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230381AbjCCRVo (ORCPT ); Fri, 3 Mar 2023 12:21:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231637AbjCCRVY (ORCPT ); Fri, 3 Mar 2023 12:21:24 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D0794FA94 for ; Fri, 3 Mar 2023 09:21:15 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95j-0007Jl-J0; Fri, 03 Mar 2023 18:21:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95i-001bpV-4g; Fri, 03 Mar 2023 18:21:10 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95g-001tnQ-Mj; Fri, 03 Mar 2023 18:21:08 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Michal Simek Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 87/87] spi: zynqmp-gqspi: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:41 +0100 Message-Id: <20230303172041.2103336-88-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1763; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=A2w0qzAbI0ugRYElQv6pogbF7ZRhXQXPw0XIf77eoL0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAixhmoPmaHUDTNIpz2J9m9hSh+YB2hyCjUKiQ 8cvIA04tMqJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIsYQAKCRDB/BR4rcrs CUnbB/9XE2sxGLV94rF8ift1K5ZVJn3L33rYkMcsEbT6nleaPWVW5B3O6VmDi92RmLKwpnV24VA +Nvnq2qiVpXQTna+IXz0pO4oKH7Y9O44+WcbaQGZp5E4/AFyR1UOvnIizxgjK+71F7veJG1oBDR VCQRiiomPPCXYHQLoBz1udwN3cHdwAJCgJh3J88S3eAKozgZScsiqNJqwIETAs8XuZluVzivIVf 17J6m7sI6O/FxiI8Wb3ZKxP4N79zdVSeS30LhVMh1ht7jCRrANlZ3LBV7wnvIVDVHfUI+5pG3iK h99j2ZKsBzSR2TJS6bJoZTTS9gs8XMx9SW6PCP38+3ZUF/iy X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-zynqmp-gqspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index 95ff15665d44..270d28a3f8eb 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c @@ -1364,7 +1364,7 @@ static int zynqmp_qspi_probe(struct platform_device *pdev) * * Return: 0 Always */ -static int zynqmp_qspi_remove(struct platform_device *pdev) +static void zynqmp_qspi_remove(struct platform_device *pdev) { struct zynqmp_qspi *xqspi = platform_get_drvdata(pdev); @@ -1373,15 +1373,13 @@ static int zynqmp_qspi_remove(struct platform_device *pdev) clk_disable_unprepare(xqspi->pclk); pm_runtime_set_suspended(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } MODULE_DEVICE_TABLE(of, zynqmp_qspi_of_match); static struct platform_driver zynqmp_qspi_driver = { .probe = zynqmp_qspi_probe, - .remove = zynqmp_qspi_remove, + .remove_new = zynqmp_qspi_remove, .driver = { .name = "zynqmp-qspi", .of_match_table = zynqmp_qspi_of_match,