From patchwork Fri Mar 3 21:36: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: 658750 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 DFCBBC7EE33 for ; Fri, 3 Mar 2023 21:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231824AbjCCVhi (ORCPT ); Fri, 3 Mar 2023 16:37:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231728AbjCCVhh (ORCPT ); Fri, 3 Mar 2023 16:37:37 -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 72CC262D8D for ; Fri, 3 Mar 2023 13:37:36 -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 1pYD5p-0008Uy-Cc; Fri, 03 Mar 2023 22:37:33 +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 1pYD5o-001eAH-Np; Fri, 03 Mar 2023 22:37:32 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5n-001wxK-UU; Fri, 03 Mar 2023 22:37:31 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/34] watchdog: ar7: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:46 +0100 Message-Id: <20230303213716.2123717-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1594; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=RkHCGC/s6zXR1s/1Ybq/smzYK3nLB5LM3xWD9STFFbE=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmgdAK0AQJR6edTzhWdTCt9tTOZG+Rbtz8wgp Fd345C/v6eJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoHQAKCRDB/BR4rcrs CRuzB/9ThWB7myFo9F8tSt7kd06iabMEZcod1PeUwsun1hEFz8ZAbVeuEzOP/Y3LjeomyX8pukr rDPPc1O7l8L1P6POwpaX7QNN5sMNA+nceLRJg7wsFMq/TKMHCxnL3XNtwnxVMTEZoRAJPtbGd+v XvbSNzedb+hcEj9lutcu3/KrUdXVb6a7wzxt6XGRgdCmTBw7pr0P5AHqQgZ8vJKMXR6t1YA1WWB 76VRgcSy/w+nwv0fI7MtoW1j5q7v7yF+mCD6B2nmE7jWtDhOV5/2PqNe1N660jj54dSBMFWpp5G QNToA22ZG/khd1BlVT+SAvPdGOb7BK57gYziyKUbIOK2EPQL 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/ar7_wdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/ar7_wdt.c b/drivers/watchdog/ar7_wdt.c index 743e171d97a3..cdcaeb0961ac 100644 --- a/drivers/watchdog/ar7_wdt.c +++ b/drivers/watchdog/ar7_wdt.c @@ -290,12 +290,11 @@ static int ar7_wdt_probe(struct platform_device *pdev) return rc; } -static int ar7_wdt_remove(struct platform_device *pdev) +static void ar7_wdt_remove(struct platform_device *pdev) { misc_deregister(&ar7_wdt_miscdev); clk_put(vbus_clk); vbus_clk = NULL; - return 0; } static void ar7_wdt_shutdown(struct platform_device *pdev) @@ -306,7 +305,7 @@ static void ar7_wdt_shutdown(struct platform_device *pdev) static struct platform_driver ar7_wdt_driver = { .probe = ar7_wdt_probe, - .remove = ar7_wdt_remove, + .remove_new = ar7_wdt_remove, .shutdown = ar7_wdt_shutdown, .driver = { .name = "ar7_wdt", From patchwork Fri Mar 3 21:36: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: 658751 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 30C36C7EE32 for ; Fri, 3 Mar 2023 21:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231764AbjCCVhh (ORCPT ); Fri, 3 Mar 2023 16:37:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231612AbjCCVhg (ORCPT ); Fri, 3 Mar 2023 16:37:36 -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 BCF4C6233F for ; Fri, 3 Mar 2023 13:37:35 -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 1pYD5p-0008V9-N4; Fri, 03 Mar 2023 22:37:33 +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 1pYD5p-001eAP-1k; Fri, 03 Mar 2023 22:37:33 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5o-001wxR-CM; Fri, 03 Mar 2023 22:37:32 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 06/34] watchdog: ath79: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:48 +0100 Message-Id: <20230303213716.2123717-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1606; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=abIaa5WCkXHESWKNN8dLZhdz2pEteQfyDjCNlGaF9lM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmgj3nBpq2X9YByL60qTTdeTFoVEWNIfvAKxk 7xdWPyY5r+JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoIwAKCRDB/BR4rcrs CWgiB/9ZZEcHclbs9JoxVCmjPMh0ZaMXIb/6z/krBcnE+KbWCSmD1oZHm26ZT2BVOxNumnOmr+M xK9Ypmgqov9Gj4FtiP/DtbUsunepT6FHSEmDAaI7raRukoI8Q3lwg16zM3pH6j+f/3w6IPlJcEV 6oDygimRvKLIAEeqEV279Q0F+B9rAFx1298cnLo0ShwA2/V/KSRpJXrbiHF5TacAQIHPZ9uQWcL 5iyYs+TDZ6UFj8B5bBqsDQ/ZTbMMaAlU3fePyUgzlwBkWv/734pA2a/qngfD2o4JxCfRPbyl2Sv TiucmIeXg0NSBdq7QqYcWAhfsEEuwfJIkf5ehP8ndtPBXVer 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/ath79_wdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/ath79_wdt.c b/drivers/watchdog/ath79_wdt.c index 0f18f06a21b6..b7b705060438 100644 --- a/drivers/watchdog/ath79_wdt.c +++ b/drivers/watchdog/ath79_wdt.c @@ -296,11 +296,10 @@ static int ath79_wdt_probe(struct platform_device *pdev) return err; } -static int ath79_wdt_remove(struct platform_device *pdev) +static void ath79_wdt_remove(struct platform_device *pdev) { misc_deregister(&ath79_wdt_miscdev); clk_disable_unprepare(wdt_clk); - return 0; } static void ath79_wdt_shutdown(struct platform_device *pdev) @@ -318,7 +317,7 @@ MODULE_DEVICE_TABLE(of, ath79_wdt_match); static struct platform_driver ath79_wdt_driver = { .probe = ath79_wdt_probe, - .remove = ath79_wdt_remove, + .remove_new = ath79_wdt_remove, .shutdown = ath79_wdt_shutdown, .driver = { .name = DRIVER_NAME, From patchwork Fri Mar 3 21:36: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: 658747 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 6EF1DC7EE32 for ; Fri, 3 Mar 2023 21:37:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231857AbjCCVhk (ORCPT ); Fri, 3 Mar 2023 16:37:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231725AbjCCVhi (ORCPT ); Fri, 3 Mar 2023 16:37:38 -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 E8F9662D8A for ; Fri, 3 Mar 2023 13:37:36 -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 1pYD5r-00006u-1s; Fri, 03 Mar 2023 22:37:35 +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 1pYD5q-001eAq-CO; Fri, 03 Mar 2023 22:37:34 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5o-001wxZ-Om; Fri, 03 Mar 2023 22:37:32 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 08/34] watchdog: bcm47xx: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:50 +0100 Message-Id: <20230303213716.2123717-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1619; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=avG4o+348YUkK0zg7PzY2tPH9b+vC7iws+Yi2l2JfNE=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmgrl1An784na5A8uj9qAXph0YvU5APg/BILa PHpEL01xniJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoKwAKCRDB/BR4rcrs CY3TB/9llxKkGv+EWOeCNKVhgoyHXIJxNHw9qLfIsJcV3dDy209ROJxNUMFw9DlRSfeTUNoe5sP 1HxlEldqnqytUc/WJMMr7I2lzynL3Xc+4bGiRa+6Od6XsETdbyVMyRJmQAqPYvHHQ2c55nepwlI qyN8D+9ngh9C9+guLKHYdRU1b+EyeB69uTRBmvvbiQWLgO3TM9Su6wW2S+015ulWf5VZMNtGhMU Ltd1PR3iKmuc19odclHdcjCMFStyJ0t5ICSSPq2lzGIOKkfmbNySrSR5f/2zBbDilmcaI80Ovla kewdVz+jYIL7FPrfhSi6qg9hlFpyM1lpVsuKenKOnDmQ783q 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/bcm47xx_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/bcm47xx_wdt.c b/drivers/watchdog/bcm47xx_wdt.c index 05425c1dfd4c..841ca1839f7f 100644 --- a/drivers/watchdog/bcm47xx_wdt.c +++ b/drivers/watchdog/bcm47xx_wdt.c @@ -218,13 +218,11 @@ static int bcm47xx_wdt_probe(struct platform_device *pdev) return ret; } -static int bcm47xx_wdt_remove(struct platform_device *pdev) +static void bcm47xx_wdt_remove(struct platform_device *pdev) { struct bcm47xx_wdt *wdt = dev_get_platdata(&pdev->dev); watchdog_unregister_device(&wdt->wdd); - - return 0; } static struct platform_driver bcm47xx_wdt_driver = { @@ -232,7 +230,7 @@ static struct platform_driver bcm47xx_wdt_driver = { .name = "bcm47xx-wdt", }, .probe = bcm47xx_wdt_probe, - .remove = bcm47xx_wdt_remove, + .remove_new = bcm47xx_wdt_remove, }; module_platform_driver(bcm47xx_wdt_driver); From patchwork Fri Mar 3 21:36: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: 658749 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 59D11C7EE45 for ; Fri, 3 Mar 2023 21:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231856AbjCCVhj (ORCPT ); Fri, 3 Mar 2023 16:37:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231808AbjCCVhh (ORCPT ); Fri, 3 Mar 2023 16:37:37 -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 D118D6233F for ; Fri, 3 Mar 2023 13:37:36 -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 1pYD5r-00006x-1Y; Fri, 03 Mar 2023 22:37:35 +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 1pYD5q-001eAp-CC; Fri, 03 Mar 2023 22:37:34 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5p-001wxo-M7; Fri, 03 Mar 2023 22:37:33 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/34] watchdog: gef: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:54 +0100 Message-Id: <20230303213716.2123717-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1591; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Br27F/QZG9StXFuBEXX2hkDJ3aauh97InfFDgn1gzWQ=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmg52NFb9aGgFZQvbXSt8xGFAoDkvm9mS7NsV iXhgUKGwQiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoOQAKCRDB/BR4rcrs CdFjCACY/d/7OMkMiNCDECYAJ6zih5OiEAtBZlb5JItHyJjHHDPGTjT8mYPBbGrkDmMatslV9/b l21KYcNHZrRyrbSqxQtjfSz6Kk/aLYlrjmxuk+wz+QrEygNUxpPr38DJqgvomuSlVc64UtI6VaU W5xoQJkCc6NTOWr9Kvf38zczFdaPpKLqUEh5zPe7e+VAAqYBNGpsASzBnCnHcQhbLQ9PQwq94E3 RojWsDjLuSJcYXj3Tk41YyA9TLWQDKww59p3BRXMvGtuxkgtMAMhY4Zxv4dnELGBLoPOziK5pT3 aDpoXiEJh+YCZ0qn5J92uaA66FBdbqUJl14jErNvs4SAB2O8 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/gef_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/gef_wdt.c b/drivers/watchdog/gef_wdt.c index df5406aa7d25..97afc907f659 100644 --- a/drivers/watchdog/gef_wdt.c +++ b/drivers/watchdog/gef_wdt.c @@ -283,15 +283,13 @@ static int gef_wdt_probe(struct platform_device *dev) return misc_register(&gef_wdt_miscdev); } -static int gef_wdt_remove(struct platform_device *dev) +static void gef_wdt_remove(struct platform_device *dev) { misc_deregister(&gef_wdt_miscdev); gef_wdt_handler_disable(); iounmap(gef_wdt_regs); - - return 0; } static const struct of_device_id gef_wdt_ids[] = { @@ -308,7 +306,7 @@ static struct platform_driver gef_wdt_driver = { .of_match_table = gef_wdt_ids, }, .probe = gef_wdt_probe, - .remove = gef_wdt_remove, + .remove_new = gef_wdt_remove, }; static int __init gef_wdt_init(void) From patchwork Fri Mar 3 21:36: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: 658748 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 F0778C7EE30 for ; Fri, 3 Mar 2023 21:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231859AbjCCVhk (ORCPT ); Fri, 3 Mar 2023 16:37:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231816AbjCCVhi (ORCPT ); Fri, 3 Mar 2023 16:37:38 -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 7E04462D8E for ; Fri, 3 Mar 2023 13:37:37 -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 1pYD5r-00008s-Ku; Fri, 03 Mar 2023 22:37:35 +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 1pYD5r-001eB1-0g; Fri, 03 Mar 2023 22:37:35 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5q-001wxx-2q; Fri, 03 Mar 2023 22:37:34 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 14/34] watchdog: ib700wdt: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:56 +0100 Message-Id: <20230303213716.2123717-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1620; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=qX312mK73J6n8dWMC9RwhZKepqeQdygjvCLx7DBJEpU=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhAwKsbP/lUEFd5Shvrll6qyjt20n4yuxnQr Qn0eQwlL7+JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoQAAKCRDB/BR4rcrs Cce7B/4mAMIDk6bNtuNdbmHiecaVavoGC67qx0j2WGWkyLbpeCnzZcTP1GP1FFmNfwTC2RHGCF9 19FTL0w2joxzqt6zNoJGoPEv8aYyp69KfCxLuOGL0LkCtWtVFbfZeuD4k6EtvMMMZvfTs0Y0Ccx s7rU9UxDspsQHx8U2ZGQVVkFYuM/3GricYWl8bMfkmi7UvoZTsA3FDlXsFLWW55drA5b4P986mx ydXpm2HfkD8bbrzQ9a8pv0wvDdE5EMeQq8kEi1CsN0IZPKYkz5gA6hlOlne/tvupsi5MetsQLCb hDWE2ghG42OmSNhZwwm1bVdhe7+uE5kMzNCXfoNaEDngQhpJ 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/ib700wdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/ib700wdt.c b/drivers/watchdog/ib700wdt.c index a0ddedc362fc..39ea97009abd 100644 --- a/drivers/watchdog/ib700wdt.c +++ b/drivers/watchdog/ib700wdt.c @@ -316,14 +316,13 @@ static int __init ibwdt_probe(struct platform_device *dev) return res; } -static int ibwdt_remove(struct platform_device *dev) +static void ibwdt_remove(struct platform_device *dev) { misc_deregister(&ibwdt_miscdev); release_region(WDT_START, 1); #if WDT_START != WDT_STOP release_region(WDT_STOP, 1); #endif - return 0; } static void ibwdt_shutdown(struct platform_device *dev) @@ -333,7 +332,7 @@ static void ibwdt_shutdown(struct platform_device *dev) } static struct platform_driver ibwdt_driver = { - .remove = ibwdt_remove, + .remove_new = ibwdt_remove, .shutdown = ibwdt_shutdown, .driver = { .name = DRV_NAME, From patchwork Fri Mar 3 21:36: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: 658746 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 E974BC64EC4 for ; Fri, 3 Mar 2023 21:37:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231867AbjCCVhm (ORCPT ); Fri, 3 Mar 2023 16:37:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231846AbjCCVhi (ORCPT ); Fri, 3 Mar 2023 16:37:38 -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 EDE0962D9C for ; Fri, 3 Mar 2023 13:37:37 -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 1pYD5s-00009O-5f; Fri, 03 Mar 2023 22:37:36 +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 1pYD5r-001eBA-HZ; Fri, 03 Mar 2023 22:37:35 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5q-001wy1-AA; Fri, 03 Mar 2023 22:37:34 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 15/34] watchdog: ie6xx: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:57 +0100 Message-Id: <20230303213716.2123717-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1597; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=PY3cMeE4IAUNZ91V0oLVd/41FhzXd72iTtsjfresafs=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhDZOPK3tXm4Bga2cRT+8pPMmQHHcwMGhgUd x81ZW/FUxGJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoQwAKCRDB/BR4rcrs CQ7HB/0RN28C2LrjYxrG5hPFqIhddoWIZitK4MH9xLfmNb/ErDxe1AQWFMG0AOpho1IF95/XxUo VRb/1DWGmVEukJ7HgvXv+OrZlycnXOqkpRYy8lyZJJGpvT+zewti0ASY+vVa4JrVlDrB796Z8fj YBCs9mrpfYwBwbYnEfJPZ+HAp0Wnkes+2YzwSl6Hog98zmlV0L3ubLKXH5bJdu8TothDsYWy/y5 GvnVrfpooOP3jh4aGRZmuy53usewdVkwk7dINWwdW3eFzHiEz40Gu/q06WzZD2bdIgRGBsF/rjM 5HwA6dFFOOyjoBqXBAr2WTXYUzreDxU6GzsKvjm/ThnU8bfg 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/ie6xx_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/ie6xx_wdt.c b/drivers/watchdog/ie6xx_wdt.c index 8f28993fab8b..e5cbb409df25 100644 --- a/drivers/watchdog/ie6xx_wdt.c +++ b/drivers/watchdog/ie6xx_wdt.c @@ -266,7 +266,7 @@ static int ie6xx_wdt_probe(struct platform_device *pdev) return ret; } -static int ie6xx_wdt_remove(struct platform_device *pdev) +static void ie6xx_wdt_remove(struct platform_device *pdev) { struct resource *res; @@ -276,13 +276,11 @@ static int ie6xx_wdt_remove(struct platform_device *pdev) ie6xx_wdt_debugfs_exit(); release_region(res->start, resource_size(res)); ie6xx_wdt_data.sch_wdtba = 0; - - return 0; } static struct platform_driver ie6xx_wdt_driver = { .probe = ie6xx_wdt_probe, - .remove = ie6xx_wdt_remove, + .remove_new = ie6xx_wdt_remove, .driver = { .name = DRIVER_NAME, }, From patchwork Fri Mar 3 21:36: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: 658745 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 14E76C7EE30 for ; Fri, 3 Mar 2023 21:37:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231866AbjCCVho (ORCPT ); Fri, 3 Mar 2023 16:37:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231847AbjCCVhj (ORCPT ); Fri, 3 Mar 2023 16:37:39 -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 595BA6233F for ; Fri, 3 Mar 2023 13:37:38 -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 1pYD5s-00009d-Hc; Fri, 03 Mar 2023 22:37:36 +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 1pYD5r-001eBG-Sw; Fri, 03 Mar 2023 22:37:35 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5q-001wy9-Nk; Fri, 03 Mar 2023 22:37:34 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 17/34] watchdog: mtx-1: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:59 +0100 Message-Id: <20230303213716.2123717-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1583; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=JynVHIU1C8idOxmj9F78LBnlLYI6md8oMsgxVjNsJWE=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhKQpkXhIm3oZFrNIitHjDBadeq9W9NFa8AS XC7CdQWF7mJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoSgAKCRDB/BR4rcrs CUJvB/0a93kZ5PLGryhI83PIQ+l0x4APk0y8owGOBfFIO+ytn9qJTlBSDLI/4fwx21FF2Qi73t3 h2sJbV4TeQiWauAk9obNnAr32QsAbn4+/9NL5xuhTkVJCEojSYfSDz/b4d6wXPFhqI5p/9LaUPE 2nOy+XR94jiUB+xghz81d/FrWEgoHKL6grUqlnbMK1agrH0yLWZyfKyg1JpPYmIoMuq2e9Z97qB I/QXv+sSdKDHIUzFnoV7H84rG4EfZfeiHAn7RVW6TSqOiR7edwfBzygjQyQOqob4wKHSENjYo1f yuBX6jO9qiocxegDQr7UQMP41AMZfKYWE9GyBxMJwf5O6w12 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/mtx-1_wdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/mtx-1_wdt.c b/drivers/watchdog/mtx-1_wdt.c index ea1bbf5ee528..152e41ecbb14 100644 --- a/drivers/watchdog/mtx-1_wdt.c +++ b/drivers/watchdog/mtx-1_wdt.c @@ -221,7 +221,7 @@ static int mtx1_wdt_probe(struct platform_device *pdev) return 0; } -static int mtx1_wdt_remove(struct platform_device *pdev) +static void mtx1_wdt_remove(struct platform_device *pdev) { /* FIXME: do we need to lock this test ? */ if (mtx1_wdt_device.queue) { @@ -230,12 +230,11 @@ static int mtx1_wdt_remove(struct platform_device *pdev) } misc_deregister(&mtx1_wdt_misc); - return 0; } static struct platform_driver mtx1_wdt_driver = { .probe = mtx1_wdt_probe, - .remove = mtx1_wdt_remove, + .remove_new = mtx1_wdt_remove, .driver.name = "mtx1-wdt", .driver.owner = THIS_MODULE, }; From patchwork Fri Mar 3 21:37: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: 658744 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 7439BC7EE3A for ; Fri, 3 Mar 2023 21:37:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231886AbjCCVho (ORCPT ); Fri, 3 Mar 2023 16:37:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231793AbjCCVhj (ORCPT ); Fri, 3 Mar 2023 16:37:39 -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 D948262D8E for ; Fri, 3 Mar 2023 13:37:38 -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 1pYD5s-0000A0-PE; Fri, 03 Mar 2023 22:37:36 +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 1pYD5s-001eBN-4P; Fri, 03 Mar 2023 22:37:36 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5q-001wyC-Un; Fri, 03 Mar 2023 22:37:34 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 18/34] watchdog: nic7018: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:00 +0100 Message-Id: <20230303213716.2123717-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1762; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IgIBURT08KNAyITcnmDzkiD1kSrg7T91+Mj13I3MbCI=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhNvYiqUi9/LTcjl/sngm/L4RXaXlkOM9za2 47km9scQEiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoTQAKCRDB/BR4rcrs CcYaCACQXE9TDw6mYV5/db6el5DEbh++wXQviw07R7QZRdAvuDAmGtqpfT6Rt9k5oRXnQxLQ7a+ ok1tnswjbGOyRE4XX32bzu5OBso3CoV4VFpVzgmjgo7rnj0BVUqwwUVnQMiXxXhMWQ5UOKMjkDx 6KdKHUhYAu+WulHxuYaTEk0e4v70X84n2l2YvbZX7I3Ml3S19V1k0CXNJ2SWg1IlnfBRmj/3+h5 IdPky2t2qgnNVohW+D2GoaIpBg3GEqjs22pSFkGxo8O+2E1aqfBMVAU7HX0oloTA8Smc/UpZdnk gHE2/L3TVHWaphFT199wSKzLdWTnSErYh9t8xM758OlWHte6 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/nic7018_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/nic7018_wdt.c b/drivers/watchdog/nic7018_wdt.c index 2a46cc662943..c3f0a4926667 100644 --- a/drivers/watchdog/nic7018_wdt.c +++ b/drivers/watchdog/nic7018_wdt.c @@ -218,7 +218,7 @@ static int nic7018_probe(struct platform_device *pdev) return 0; } -static int nic7018_remove(struct platform_device *pdev) +static void nic7018_remove(struct platform_device *pdev) { struct nic7018_wdt *wdt = platform_get_drvdata(pdev); @@ -226,8 +226,6 @@ static int nic7018_remove(struct platform_device *pdev) /* Lock WDT register */ outb(LOCK, wdt->io_base + WDT_REG_LOCK); - - return 0; } static const struct acpi_device_id nic7018_device_ids[] = { @@ -238,7 +236,7 @@ MODULE_DEVICE_TABLE(acpi, nic7018_device_ids); static struct platform_driver watchdog_driver = { .probe = nic7018_probe, - .remove = nic7018_remove, + .remove_new = nic7018_remove, .driver = { .name = KBUILD_MODNAME, .acpi_match_table = ACPI_PTR(nic7018_device_ids), From patchwork Fri Mar 3 21:37: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: 658742 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 F0458C7EE3A for ; Fri, 3 Mar 2023 21:37:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231903AbjCCVhs (ORCPT ); Fri, 3 Mar 2023 16:37:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231868AbjCCVhl (ORCPT ); Fri, 3 Mar 2023 16:37:41 -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 8ED4662DAB for ; Fri, 3 Mar 2023 13:37:40 -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 1pYD5t-0000Al-Pd; Fri, 03 Mar 2023 22:37:37 +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 1pYD5s-001eBf-JR; Fri, 03 Mar 2023 22:37:36 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5r-001wyQ-R3; Fri, 03 Mar 2023 22:37:35 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 22/34] watchdog: rc32434: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:04 +0100 Message-Id: <20230303213716.2123717-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1622; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=D/j5TpP0VuMfEGUkXxUmbliFxRAsyCz2Q5rCAP6yoP4=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhb13kOuU6zHGA9UenJbo9/+iys/TsKhF7O2 ChgCm5WqyyJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoWwAKCRDB/BR4rcrs Cd7jB/92KS78PpN9wRTCc9Zd+usl/aDkE1sbkt18rU/9rK5cNDPVwPZbRR8J2WK+Qi7aBBigXL9 V7rJ7pp7cibNi0OQjRr6+qy/gzbA47f92Q5N1Bf49E5Qj2EhLUXmBxaHVSn/JVZ0Vgu1yDwEyRy nB21lr0JfE+/cWDmgGvObRIWgSQI019L7hHIQva0ruH3QazZjyn0rZeC1RtpUdBK+ea5Ufabntr bnQpDSV0foY5t5zaqWlcbIYpDmF9fL52d68Vw/YNgFHeTFuKblVMcM22PXPIb7JPlJ47uX9pqP9 lVPr7ieFqkXDdP+jbQbSMcF+PkNrzUG39b5WCW1ClvcchRzH 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/rc32434_wdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/rc32434_wdt.c b/drivers/watchdog/rc32434_wdt.c index e74802f3a32e..417f9b75679c 100644 --- a/drivers/watchdog/rc32434_wdt.c +++ b/drivers/watchdog/rc32434_wdt.c @@ -298,10 +298,9 @@ static int rc32434_wdt_probe(struct platform_device *pdev) return 0; } -static int rc32434_wdt_remove(struct platform_device *pdev) +static void rc32434_wdt_remove(struct platform_device *pdev) { misc_deregister(&rc32434_wdt_miscdev); - return 0; } static void rc32434_wdt_shutdown(struct platform_device *pdev) @@ -311,7 +310,7 @@ static void rc32434_wdt_shutdown(struct platform_device *pdev) static struct platform_driver rc32434_wdt_driver = { .probe = rc32434_wdt_probe, - .remove = rc32434_wdt_remove, + .remove_new = rc32434_wdt_remove, .shutdown = rc32434_wdt_shutdown, .driver = { .name = "rc32434_wdt", From patchwork Fri Mar 3 21:37: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: 658743 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 3DB62C64EC4 for ; Fri, 3 Mar 2023 21:37:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231887AbjCCVhq (ORCPT ); Fri, 3 Mar 2023 16:37:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231863AbjCCVhk (ORCPT ); Fri, 3 Mar 2023 16:37:40 -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 C21BA62DA6 for ; Fri, 3 Mar 2023 13:37:39 -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 1pYD5t-0000B4-Kd; Fri, 03 Mar 2023 22:37:37 +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 1pYD5s-001eBj-LV; Fri, 03 Mar 2023 22:37:36 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5s-001wyU-2c; Fri, 03 Mar 2023 22:37:36 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 23/34] watchdog: rdc321x: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:05 +0100 Message-Id: <20230303213716.2123717-24-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1595; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4Uc/GUbsJ5mGzo5yktgs+0ov7Pv+uSQWt7F9Cn9coHs=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhfrclGZ3TzSYbq6i+lqOQL5R6WRZU+97/DH UFoOQKiYMaJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoXwAKCRDB/BR4rcrs CR9rB/92QXbI6gAO+PddWUVLUeYdezWKSZ24LWMHD1JogN4gm3zl8RtEhlVwoi2XSGmUIEP5pmf XASjKM4iuEbbkQFAu6lcfV1t4JUIhk7035qIcUtkUKs/CK1P/yppM9o5TPmXbxmf2NJAmhXZBQw xJZ+uMqD5r0eVIA2ISZkZF89od1/L9hyoGVhWAsCjNk0oJzsS93pYqFvaq4vjZ1ka2FDQyKgwdu UjMn7JxBMKp5xXYGftbu2Lc32owWatxCc/HoEcVrzdlKLWxNbOIfpkkIIivXotckMyF3aHpUW4z 46YhR9XyYCPo2GRfxZLPYvd9+Y0ZnUpPkuLrUwgeUgQKhL8r 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/rdc321x_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/rdc321x_wdt.c b/drivers/watchdog/rdc321x_wdt.c index f0c94ea51c3e..6176f4343fc5 100644 --- a/drivers/watchdog/rdc321x_wdt.c +++ b/drivers/watchdog/rdc321x_wdt.c @@ -257,7 +257,7 @@ static int rdc321x_wdt_probe(struct platform_device *pdev) return 0; } -static int rdc321x_wdt_remove(struct platform_device *pdev) +static void rdc321x_wdt_remove(struct platform_device *pdev) { if (rdc321x_wdt_device.queue) { rdc321x_wdt_device.queue = 0; @@ -265,13 +265,11 @@ static int rdc321x_wdt_remove(struct platform_device *pdev) } misc_deregister(&rdc321x_wdt_misc); - - return 0; } static struct platform_driver rdc321x_wdt_driver = { .probe = rdc321x_wdt_probe, - .remove = rdc321x_wdt_remove, + .remove_new = rdc321x_wdt_remove, .driver = { .name = "rdc321x-wdt", }, From patchwork Fri Mar 3 21:37: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: 658741 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 E9702C83003 for ; Fri, 3 Mar 2023 21:37:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231910AbjCCVhs (ORCPT ); Fri, 3 Mar 2023 16:37:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231873AbjCCVhm (ORCPT ); Fri, 3 Mar 2023 16:37:42 -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 69AA462D9C for ; Fri, 3 Mar 2023 13:37:41 -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 1pYD5u-0000GU-S9; Fri, 03 Mar 2023 22:37:38 +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 1pYD5t-001eBy-As; Fri, 03 Mar 2023 22:37:37 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5s-001wyf-HP; Fri, 03 Mar 2023 22:37:36 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 25/34] watchdog: riowd: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:07 +0100 Message-Id: <20230303213716.2123717-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-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=tjRKZsDzkYhVDX0U2QePSy5P8HALIQ/Qu5/tfhqwcTI=; b=owGbwMvMwMV48I9IxdpTbzgZT6slMaQwZaTxRizN00qbNb9vWSx71K0bZ86qXKwIZ/Gxtw4Q3 XMrOy60k9GYhYGRi0FWTJGlrkhLbILEmv92JUu4YQaxMoFMYeDiFICJ2F5m/80mEf+9nWfNtAyD VPs/+9jPzzn2yjp1c0+Gf0/4F83DrGoeMyVC5ysqr33VOt0uMbzaV+7ruofaW36vVlWdpZnxt+l UQP7f1WL/1NY4r1v672rAm9PtLOolc1Y3HjBg323s3NIbfq7+rfCrmX+ismSFxDhZMx7ETe96qn X5S2L71cOFk8NuZAqEqxmJrM2s/5GiK9XXs+C3TO9xgevBi/yFn7x7yXop8sYMm5mMm/SMwhakl MoUa8sw7GYu0O2RPDlnq+gcmwmi550NtdcmB835xKO3WM1IUORvQ5uxi0UOi5mg6uFdMaEPS44G z2S5/jJjoaIWRxXzdeXGHLVuxfe+iTI5V4QZpRe53pYDAA== 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/riowd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/riowd.c b/drivers/watchdog/riowd.c index 747e346ed06c..c04b383e1712 100644 --- a/drivers/watchdog/riowd.c +++ b/drivers/watchdog/riowd.c @@ -217,14 +217,12 @@ static int riowd_probe(struct platform_device *op) return err; } -static int riowd_remove(struct platform_device *op) +static void riowd_remove(struct platform_device *op) { struct riowd *p = platform_get_drvdata(op); misc_deregister(&riowd_miscdev); of_iounmap(&op->resource[0], p->regs, 2); - - return 0; } static const struct of_device_id riowd_match[] = { @@ -241,7 +239,7 @@ static struct platform_driver riowd_driver = { .of_match_table = riowd_match, }, .probe = riowd_probe, - .remove = riowd_remove, + .remove_new = riowd_remove, }; module_platform_driver(riowd_driver); From patchwork Fri Mar 3 21:37: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: 658739 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 A7425C7EE30 for ; Fri, 3 Mar 2023 21:37:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231877AbjCCVhu (ORCPT ); Fri, 3 Mar 2023 16:37:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231876AbjCCVhn (ORCPT ); Fri, 3 Mar 2023 16:37:43 -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 E995E62D8D for ; Fri, 3 Mar 2023 13:37:41 -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 1pYD5v-0000J5-9y; Fri, 03 Mar 2023 22:37:39 +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 1pYD5t-001eC5-OQ; Fri, 03 Mar 2023 22:37:37 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5t-001wyo-1Z; Fri, 03 Mar 2023 22:37:37 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 27/34] watchdog: rti: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:09 +0100 Message-Id: <20230303213716.2123717-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1648; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=y0ppS3/lHOfKcdZ+vVTZLvSg0Vcg/PYnmu6MvKULFV0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhtZfWgPjXdn1m8oF4nZv7Y/Vi5BvYiXvAWw OOWLdsZUbOJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJobQAKCRDB/BR4rcrs CUdSB/46PdjFhSC3js+NW7hBkK8ZL/zjz4ZNST3hS6Uz/Drw1a+Ow6Pu/l4N1nAslMcuXfaeM53 Wb/lYZiumVDKRucfe723vyYsNtMN4tt6eEpki57DBJ1nPLjq1lnc7zq8vkNJoEOUxY/K/Fw1NIH WVcVYxv7eQ+RUxX2Tl3n3N4WxYdHYWO3c2d8/uSWTFfWsGB4ccUR1+2TiHEFYgFwBPye2EUthoD 7OOAIlaEZO4IKinw5qWZA8RGnc0hef78GIabSQPFfv5jgxp3x1oBJp4IdxZw90xAaYhumc9ca2q iVF8NKgHbSBl9WtSOILQhZLdTNRrshL1tugZNYr7D1EB0sx4 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/rti_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c index 6e9253761fc1..ce8f18e93aa9 100644 --- a/drivers/watchdog/rti_wdt.c +++ b/drivers/watchdog/rti_wdt.c @@ -304,15 +304,13 @@ static int rti_wdt_probe(struct platform_device *pdev) return ret; } -static int rti_wdt_remove(struct platform_device *pdev) +static void rti_wdt_remove(struct platform_device *pdev) { struct rti_wdt_device *wdt = platform_get_drvdata(pdev); watchdog_unregister_device(&wdt->wdd); pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id rti_wdt_of_match[] = { @@ -327,7 +325,7 @@ static struct platform_driver rti_wdt_driver = { .of_match_table = rti_wdt_of_match, }, .probe = rti_wdt_probe, - .remove = rti_wdt_remove, + .remove_new = rti_wdt_remove, }; module_platform_driver(rti_wdt_driver); From patchwork Fri Mar 3 21:37: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: 658736 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 4391CC64EC4 for ; Fri, 3 Mar 2023 21:37:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231925AbjCCVhy (ORCPT ); Fri, 3 Mar 2023 16:37:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231808AbjCCVhq (ORCPT ); Fri, 3 Mar 2023 16:37:46 -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 945E662D8E for ; Fri, 3 Mar 2023 13:37:45 -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 1pYD5v-0000MI-Jj; Fri, 03 Mar 2023 22:37:39 +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 1pYD5u-001eCI-GX; Fri, 03 Mar 2023 22:37:38 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5t-001wyr-8Y; Fri, 03 Mar 2023 22:37:37 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski , Wim Van Sebroeck , Guenter Roeck Cc: Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 28/34] watchdog: s3c2410: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:10 +0100 Message-Id: <20230303213716.2123717-29-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-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=M+DN6Ffcu47NvDlJ71rx485DsQUZMI7Kl6vBiuQHIaI=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhx0CtjwFuTgZla7LkQRXk62OR+DTlQfjsgs mG811DGxLeJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJocQAKCRDB/BR4rcrs CcLPCACUexN6C8auNnEIoxV3LNntl/LWc+Xs+y1CEHX5mk0o+qdS6522BqH2fFs9kH/g54KhAHM OyMzSl9wfsAtTHOqhDCQriOrPpI/3SJyKFu/I+ChBsnCvj0Iblk83vZl9rWB7bzVWsc97oUrrlu XmAFMOaiQ9aYBK1urau9B0JCsRtd6E2KRw2Hnz395cHzla1PfbqcoMfO8qtspD1BzFSgqZ86XmL C1smF2NYluWPaltuZUWWI+0SOCFPd7nisJe9/nCagzrAu3aOQeDsylRVkddnYuWEomkVGhSD9Z1 nFCRLRdBcoG6HiyAdxFNi/OMmqETdIwa6wO89swJgGbcG1vV 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/s3c2410_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index cf104a844a43..d1f408913843 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c @@ -775,7 +775,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev) return ret; } -static int s3c2410wdt_remove(struct platform_device *dev) +static void s3c2410wdt_remove(struct platform_device *dev) { int ret; struct s3c2410_wdt *wdt = platform_get_drvdata(dev); @@ -789,8 +789,6 @@ static int s3c2410wdt_remove(struct platform_device *dev) clk_disable_unprepare(wdt->src_clk); clk_disable_unprepare(wdt->bus_clk); - - return 0; } static void s3c2410wdt_shutdown(struct platform_device *dev) @@ -845,7 +843,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(s3c2410wdt_pm_ops, static struct platform_driver s3c2410wdt_driver = { .probe = s3c2410wdt_probe, - .remove = s3c2410wdt_remove, + .remove_new = s3c2410wdt_remove, .shutdown = s3c2410wdt_shutdown, .id_table = s3c2410_wdt_ids, .driver = { From patchwork Fri Mar 3 21:37: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: 658740 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 89B7DC87FDD for ; Fri, 3 Mar 2023 21:37:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231842AbjCCVht (ORCPT ); Fri, 3 Mar 2023 16:37:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231871AbjCCVhn (ORCPT ); Fri, 3 Mar 2023 16:37:43 -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 E9AC162DA7 for ; Fri, 3 Mar 2023 13:37:41 -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 1pYD5v-0000LQ-MN; Fri, 03 Mar 2023 22:37:39 +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 1pYD5u-001eCE-7w; Fri, 03 Mar 2023 22:37:38 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5t-001wyw-G1; Fri, 03 Mar 2023 22:37:37 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 29/34] watchdog: sa1100: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:11 +0100 Message-Id: <20230303213716.2123717-30-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1511; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4Hz0VcW4tHHMgapWfyP+rDds0Bu0FqD2STrYvV0j9V8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmh0b12GJblzUyjriMtZJ0lZTdlpDxCWIOu/l 1XttkY5N9iJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJodAAKCRDB/BR4rcrs CcbQB/47uNgTTb/5/71HWfNfOa1YEv5SqjvlmlYOtQ1ANYtN9sn1OlEEpc12vQwkhyylPPMDDfK 6Mx5Pigl96RWD5trhq9JKBXGO7KzjWVtcUPg4f8LVMRpTrlGL0rXOQRCKIRKx1WCqTG+OcqWQxE jZYX7yCJRT9gnTC8u0I0zd+qVgM2RXWwuae/QR1P6HeDVHhND2lu2pmwocxLXiRncWQ282oMvaA ixD03N15qlK0xZo3byEVkOjsLkvSpGcGSqzyh6LfsDh0vVPBA2/n7SRl4Vb6oVV+1YHrWKFQlEJ Kq+T1oUmyWDtGGo+gKIHYYwhXi7yXn5wH78HSKNlepqlkoFH 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/sa1100_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c index 82ac5d19f519..5d2df008b92a 100644 --- a/drivers/watchdog/sa1100_wdt.c +++ b/drivers/watchdog/sa1100_wdt.c @@ -229,19 +229,17 @@ static int sa1100dog_probe(struct platform_device *pdev) return ret; } -static int sa1100dog_remove(struct platform_device *pdev) +static void sa1100dog_remove(struct platform_device *pdev) { misc_deregister(&sa1100dog_miscdev); clk_disable_unprepare(clk); clk_put(clk); - - return 0; } static struct platform_driver sa1100dog_driver = { .driver.name = "sa1100_wdt", .probe = sa1100dog_probe, - .remove = sa1100dog_remove, + .remove_new = sa1100dog_remove, }; module_platform_driver(sa1100dog_driver); From patchwork Fri Mar 3 21:37: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: 658738 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 98380C7EE39 for ; Fri, 3 Mar 2023 21:37:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231615AbjCCVhv (ORCPT ); Fri, 3 Mar 2023 16:37:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231881AbjCCVhn (ORCPT ); Fri, 3 Mar 2023 16:37:43 -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 309A862DB0 for ; Fri, 3 Mar 2023 13:37:42 -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 1pYD5w-0000MH-1l; Fri, 03 Mar 2023 22:37:40 +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 1pYD5u-001eCJ-Gf; Fri, 03 Mar 2023 22:37:38 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5t-001wyz-MM; Fri, 03 Mar 2023 22:37:37 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 30/34] watchdog: sch311x: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:12 +0100 Message-Id: <20230303213716.2123717-31-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1875; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iVlH6Z3xXpcEeYUc2mGof+xkaDC4Lm3O9ljwCn/Ey+g=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmh4FbRpe31Yef6x6jiaV2mZxZIKc0JWQziQN gGo2L4OoV+JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoeAAKCRDB/BR4rcrs CRnRB/sF1wWSPJX5xYHE+TwkGbjnnNmHIdM2peN2+2tSnHVD58lFzpQ68d+6jsDsSYBqMX5qgf0 dqtDZ4wXXE7hFZu/0p5J22+gnnNq+22GtF++O0a+nKtSQ9KJUePGum6XbjSX4TSJfBR1wyxPhfr TsRgA30bSpDGxtfNygJF1cOwzZ6Bo6wjKcNGrjmE5qlvKD9mQis2iqbgxmja0c+VVj/54zAH9R7 9PWkupzpt5KKqG0hQ7KnG0AooiQEjhOhbomKtR0Ua8kym+IJo5QRy1aqCVl1ityFOIE73CRwSTF Qc78OEg9sb2x62xPf3MYksIk2OTMM6ZhFxyKf5bAkqWCttlC 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/sch311x_wdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/sch311x_wdt.c b/drivers/watchdog/sch311x_wdt.c index d8b77fe10eba..409d49880170 100644 --- a/drivers/watchdog/sch311x_wdt.c +++ b/drivers/watchdog/sch311x_wdt.c @@ -425,7 +425,7 @@ static int sch311x_wdt_probe(struct platform_device *pdev) return err; } -static int sch311x_wdt_remove(struct platform_device *pdev) +static void sch311x_wdt_remove(struct platform_device *pdev) { /* Stop the timer before we leave */ if (!nowayout) @@ -436,7 +436,6 @@ static int sch311x_wdt_remove(struct platform_device *pdev) release_region(sch311x_wdt_data.runtime_reg + WDT_TIME_OUT, 4); release_region(sch311x_wdt_data.runtime_reg + GP60, 1); sch311x_wdt_data.runtime_reg = 0; - return 0; } static void sch311x_wdt_shutdown(struct platform_device *dev) @@ -447,7 +446,7 @@ static void sch311x_wdt_shutdown(struct platform_device *dev) static struct platform_driver sch311x_wdt_driver = { .probe = sch311x_wdt_probe, - .remove = sch311x_wdt_remove, + .remove_new = sch311x_wdt_remove, .shutdown = sch311x_wdt_shutdown, .driver = { .name = DRV_NAME, From patchwork Fri Mar 3 21:37: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: 658737 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 12CE3C7EE32 for ; Fri, 3 Mar 2023 21:37:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231923AbjCCVhx (ORCPT ); Fri, 3 Mar 2023 16:37:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231851AbjCCVho (ORCPT ); Fri, 3 Mar 2023 16:37: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 4086562D8D for ; Fri, 3 Mar 2023 13:37:43 -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 1pYD5w-0000NX-Hl; Fri, 03 Mar 2023 22:37:40 +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 1pYD5v-001eCY-3U; Fri, 03 Mar 2023 22:37:39 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5u-001wzB-CA; Fri, 03 Mar 2023 22:37:38 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck , Maxime Coquelin , Alexandre Torgue Cc: linux-watchdog@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 33/34] watchdog: stmp3xxx_rtc: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:15 +0100 Message-Id: <20230303213716.2123717-34-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> References: <20230303213716.2123717-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1604; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7BLjEAE+OMR4vcRLdtu8fbKtU1EdPh6RPJWc/ir7b/0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmiCCHlZhBDExndJ5m6lx0wuc8QePPa20UA98 P6qVFb7UF6JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoggAKCRDB/BR4rcrs Ce8lB/9hwoU4opbIZHMZsgS3Z8HcBKf0uHx/7pm9CDNVex/0uLwAE1H1KMZxpjHXMYPCOJ3NBxE x7JjZGZGCCrub8vaYQLn/OCQ20S4PPLyniXXPFteu0lgqxxLk2z7fbMMZue3ctXwGmZD9M3UcB2 HdZOuRUyD6dwtoXswmAn3hHyTry37KEaFuslVjJAad+9fRuJ2XQJ5P0RGRZcDwOB/ciKHeqx5Bt N1b9qsd+i5EVMCi88Bmmq+ykhkX2pqn488i6cQeymdT2/Pdve1wIsoRtysde6tnEmkCCxbgqtBh LVJbn3W/Z2tFN78SGN/nP6klYZWs7IL9HhGpQYL5tKvgTd2N 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-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@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/watchdog/stmp3xxx_rtc_wdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/stmp3xxx_rtc_wdt.c b/drivers/watchdog/stmp3xxx_rtc_wdt.c index 7caf3aa71c6a..4b2caa9807ac 100644 --- a/drivers/watchdog/stmp3xxx_rtc_wdt.c +++ b/drivers/watchdog/stmp3xxx_rtc_wdt.c @@ -109,10 +109,9 @@ static int stmp3xxx_wdt_probe(struct platform_device *pdev) return 0; } -static int stmp3xxx_wdt_remove(struct platform_device *pdev) +static void stmp3xxx_wdt_remove(struct platform_device *pdev) { unregister_reboot_notifier(&wdt_notifier); - return 0; } static int __maybe_unused stmp3xxx_wdt_suspend(struct device *dev) @@ -144,7 +143,7 @@ static struct platform_driver stmp3xxx_wdt_driver = { .pm = &stmp3xxx_wdt_pm_ops, }, .probe = stmp3xxx_wdt_probe, - .remove = stmp3xxx_wdt_remove, + .remove_new = stmp3xxx_wdt_remove, }; module_platform_driver(stmp3xxx_wdt_driver);