From patchwork Fri Mar 3 21:36: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: 13159510 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 773C8C7EE32 for ; Fri, 3 Mar 2023 21:37:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231895AbjCCVhz (ORCPT ); Fri, 3 Mar 2023 16:37:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231891AbjCCVhq (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 D330762D86 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 1pYD5q-0008Uv-9m; Fri, 03 Mar 2023 22:37:34 +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 1pYD5n-001eA4-VA; Fri, 03 Mar 2023 22:37:31 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pYD5n-001wxA-BV; Fri, 03 Mar 2023 22:37:31 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski , Wim Van Sebroeck , Guenter Roeck , Doug Anderson , Leela Krishna Amudala 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 01/34] watchdog: s3c2410: Don't skip cleanup in remove's error path Date: Fri, 3 Mar 2023 22:36:43 +0100 Message-Id: <20230303213716.2123717-2-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=1190; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=dH5K8jSqecnVYqdbPPG8j+uJBNtwI1UmMnEH81NXN2o=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmgSDlZ9h3UXAn5MUbhKAXXOUHQmQQZBssmp9 ybpzz62ncCJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoEgAKCRDB/BR4rcrs CQKUCACesLXMrz4kUplOzOB+eOBKfnhFGAVh1/Lw/nAQfuyvdVV/xHHrJgU9VIvKm5t3HGQnqhB UOz7IPMuVr0tQ6vS+BVA/IFwum94L2lgwcOLzYMIQmvBFbZNG9LKDQp+VzvatcJRnhaj8drhjIm 0vks5wkawx6BfUQsCkWmKk7EVEvsrcNaw3fe3CLr622YCoD7OLVT0dto2YWJHn3C/6k7n49BD6M /ncSMYvsfECmFlEgzWwdfjZNUgQP/21sBIQja2xqKhW4DB5lp8DhzdFSDzH2aXoHJRgWqk81gdY eCzuBYAoeuW9A9QaDT00vN6LKHsqXtrcB3gIN5n/HReqcDEd 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 Returning early in a platform driver's remove callback is wrong. In this case the watchdog device is never removed although it's parent is gone which likely can trigger a use-after-free in sysfs. Also the two used clocks will never be disabled. Instead only warn if s3c2410wdt_enable() fails and cleanup. Note that returning 0 is the right thing to do then to suppress another warning message by the driver core. Fixes: 4f1f653a68d6 ("watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu register") Signed-off-by: Uwe Kleine-König --- drivers/watchdog/s3c2410_wdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 200ba236a72e..cf104a844a43 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c @@ -782,7 +782,8 @@ static int s3c2410wdt_remove(struct platform_device *dev) ret = s3c2410wdt_enable(wdt, false); if (ret < 0) - return ret; + dev_warn(&dev->dev, + "Failed to disable watchdog (%pe)\n", ERR_PTR(ret)); watchdog_unregister_device(&wdt->wdt_device); From patchwork Fri Mar 3 21:36: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: 13159478 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 9D769C7EE30 for ; Fri, 3 Mar 2023 21:37:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231752AbjCCVhh (ORCPT ); Fri, 3 Mar 2023 16:37:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231292AbjCCVhg (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 55E9F62D86 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-0008Uw-8b; 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-001eA9-Ct; 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-001wxD-Ht; 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 02/34] watchdog: acquirewdt: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:44 +0100 Message-Id: <20230303213716.2123717-3-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=1615; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=9+q6C+nj1xYa0tIZrxM2LYMQH3OvD3DGaw1eGi3kuN4=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmgWO7DqToqu+bNAasPZmOaF65IkE9uWq7qAA 3fKCOtBvJmJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoFgAKCRDB/BR4rcrs Cf1kB/9UpQxQCbZozInzUxOOWhiW4vPwx6AmFPr1lM/je1K0W8mjwM71RQ7EMLe+/NnpWOK5+Cd u9POxN1p/WbECiP6BJSxAcTVSthJXPP8SdX5gY87JU2yuN/0yVeocpneRo1xxzoGh94epN1xGhU /h6MwqeCaxcFdDP5TSHNFL3BB+zsDvJNf/ZZCdd4zD7Va8k11n6xBmD+AuuRZJ4ulKNFiY48iu6 NhbGZAk4k/QVnbMKpLoHDu3FEDqWbGyPMuMdl6Rayd+JWnkGbO3lphiEOXOqEPY4Gds0Dydzbj9 MBUIRs2PgrIEwGh3zGkc/B8Vk1wm3IEzJfRZE+MKeetU84Of 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 Reviewed-by: Guenter Roeck --- drivers/watchdog/acquirewdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c index bc6f333565d3..53b04abd55b0 100644 --- a/drivers/watchdog/acquirewdt.c +++ b/drivers/watchdog/acquirewdt.c @@ -271,14 +271,12 @@ static int __init acq_probe(struct platform_device *dev) return ret; } -static int acq_remove(struct platform_device *dev) +static void acq_remove(struct platform_device *dev) { misc_deregister(&acq_miscdev); release_region(wdt_start, 1); if (wdt_stop != wdt_start) release_region(wdt_stop, 1); - - return 0; } static void acq_shutdown(struct platform_device *dev) @@ -288,7 +286,7 @@ static void acq_shutdown(struct platform_device *dev) } static struct platform_driver acquirewdt_driver = { - .remove = acq_remove, + .remove_new = acq_remove, .shutdown = acq_shutdown, .driver = { .name = DRV_NAME, From patchwork Fri Mar 3 21:36: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: 13159480 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 9936DC64EC4 for ; Fri, 3 Mar 2023 21:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231612AbjCCVhh (ORCPT ); Fri, 3 Mar 2023 16:37:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231725AbjCCVhg (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 7062B62D8A 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-0008Ux-8d; 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-001eAD-GZ; 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-001wxG-OK; 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 03/34] watchdog: advantechwdt: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:45 +0100 Message-Id: <20230303213716.2123717-4-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=1646; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=H4BXHHkhLbqRbC62pRYTELNAroaWXfz0bieKzM3Xji0=; b=owGbwMvMwMV48I9IxdpTbzgZT6slMaQwZUgyTFWYE3AoNbyH04jBcGJA1dXl0Z93XeZWEnB9s 4DpJdf1TkZjFgZGLgZZMUWWuiItsQkSa/7blSzhhhnEygQ2hYtTACZSEc/BMN1Gj9Fj4dfDEgu+ x3+pU5182NWXNbl5vUtQmkz+jwnhph86ch3TAxxnLGwO+jzhRNwbqTjjAx8XXJTqvC72S2li+DI z/xfap640nOdnKIgrWnyxfP5RrqPCKRa3mNZYpF3+dH/nk0L3RcIRW26wOPI8yMoTnpV+us27NC DR5tMG/VtMkW/+Le3iqq8pyt94s7VKP+pqb0xvuG+1j8YBHu8n9U/FZ56e94GDuUZG43prqFlqp 5yGlkSw2mHmWwd/hvA9Xm1+a0NS0CqnX/wvvnlm+O1755pmrqvQyGZup9RnvUVgrtWtme9s2u0W XDFJfLhDWsxrjd2XXx8ibP0DS4prWL+e9PCT82LRWAgA 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 Reviewed-by: Guenter Roeck --- drivers/watchdog/advantechwdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c index 554fe85da50e..7a0acbc3e4dd 100644 --- a/drivers/watchdog/advantechwdt.c +++ b/drivers/watchdog/advantechwdt.c @@ -279,14 +279,12 @@ static int __init advwdt_probe(struct platform_device *dev) goto out; } -static int advwdt_remove(struct platform_device *dev) +static void advwdt_remove(struct platform_device *dev) { misc_deregister(&advwdt_miscdev); release_region(wdt_start, 1); if (wdt_stop != wdt_start) release_region(wdt_stop, 1); - - return 0; } static void advwdt_shutdown(struct platform_device *dev) @@ -296,7 +294,7 @@ static void advwdt_shutdown(struct platform_device *dev) } static struct platform_driver advwdt_driver = { - .remove = advwdt_remove, + .remove_new = advwdt_remove, .shutdown = advwdt_shutdown, .driver = { .name = DRV_NAME, 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: 13159481 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 Reviewed-by: Guenter Roeck --- 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: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: 13159512 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 E55BBC64EC4 for ; Fri, 3 Mar 2023 21:38:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231917AbjCCVh6 (ORCPT ); Fri, 3 Mar 2023 16:37:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231889AbjCCVhu (ORCPT ); Fri, 3 Mar 2023 16:37:50 -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 2C54762D8E for ; Fri, 3 Mar 2023 13:37:49 -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-0008Uz-VX; Fri, 03 Mar 2023 22:37:34 +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-001eAL-SU; 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 1pYD5o-001wxO-5R; Fri, 03 Mar 2023 22:37:32 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 05/34] watchdog: at91rm9200: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:47 +0100 Message-Id: <20230303213716.2123717-6-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=1774; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=y9c84V3OIUrX7btc5Pg+PdesCQSfurferO1R0FfG/Vk=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmggv2CxtyhyWnlFhtc46w9G8ZFP9Cu1oDsG7 dqiVegZJWSJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoIAAKCRDB/BR4rcrs CUXSCACBuuSDAwdFKgcWCQue2LLM5AoiE8sujzZObYel82ZdeVhJ8qHlq333ebgsG71PBH15CeA GPKfhpfeEuTrGnJHnjir8d7GrEeJWsN285yQGe6b1WvGEpY1eGDzFomOlTB/Jn92gGG/5djq3XV xnvexkpmWURp2AGpqpkqWe14+zIdnbC1LyH0J9xcP+8ip8gwaUbNDIspxB9cyuNyDqu+iH6O3Ln 5l3cOzduDz+10f98hE7qw7ZwJiLVyuwEhW4r7SWlb2yHgcmDdif3JLTW3MirSqOf0RJLvpq81d7 F1W+lJC/fRi3eP0/WJ3Y8PHMU85QZwfA10cyN9sB/gP++rTa 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 Reviewed-by: Guenter Roeck Reviewed-by: Claudiu Beznea --- drivers/watchdog/at91rm9200_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c index d57409c1a4d1..d20ec27ba354 100644 --- a/drivers/watchdog/at91rm9200_wdt.c +++ b/drivers/watchdog/at91rm9200_wdt.c @@ -258,7 +258,7 @@ static int at91wdt_probe(struct platform_device *pdev) return 0; } -static int at91wdt_remove(struct platform_device *pdev) +static void at91wdt_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; int res; @@ -269,8 +269,6 @@ static int at91wdt_remove(struct platform_device *pdev) misc_deregister(&at91wdt_miscdev); at91wdt_miscdev.parent = NULL; - - return 0; } static void at91wdt_shutdown(struct platform_device *pdev) @@ -299,7 +297,7 @@ MODULE_DEVICE_TABLE(of, at91_wdt_dt_ids); static struct platform_driver at91wdt_driver = { .probe = at91wdt_probe, - .remove = at91wdt_remove, + .remove_new = at91wdt_remove, .shutdown = at91wdt_shutdown, .suspend = pm_ptr(at91wdt_suspend), .resume = pm_ptr(at91wdt_resume), 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: 13159479 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 Reviewed-by: Guenter Roeck --- 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: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: 13159486 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 EA9CDC83003 for ; Fri, 3 Mar 2023 21:37:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231725AbjCCVhl (ORCPT ); Fri, 3 Mar 2023 16:37:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231836AbjCCVhi (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 E9A1A62D95 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-00005s-6N; 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 1pYD5p-001eAb-U5; 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-001wxV-Iv; Fri, 03 Mar 2023 22:37:32 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck , Florian Fainelli , Ray Jui , Scott Branden Cc: Broadcom internal kernel review list , linux-watchdog@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 07/34] watchdog: bcm2835: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:49 +0100 Message-Id: <20230303213716.2123717-8-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=1468; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cI7FTjbvztVO6mz6+txwLW+bweaeRgJNiyo/oBrE/yY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmgo+Puf549yBsfiDBiX7gp2NIBVMu1ZVqoJI 8YaJ3R9+AiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoKAAKCRDB/BR4rcrs CVHhB/0XbA+S7QgbQsCThmgE0osCJrZKChczOg9O2uvLgw1cyTcyuXLxyPApWp91Iy582TBmLh0 Vx9v1dPCvT2hDupuL2plxhX88u5l2hfTDigVXN7zeP5VZOOU5vlNW4jwZz7+3biAUJCs2POkMNX TO8NXN6jibV8Dz/wM9mpUvtY2LelV4nXdg7jym9tMepWqLf3xuKJik1AgU6EK7SLZyUnhp43Ot6 f5p+Xk42TN8j0zIdgytM4Z+jiztdo3V8G3zXgXrPSAJAoamb3jxv57hTJ9RW5L9fyGHFL8tvSWl JjmW6GhwHQSPVohn877iWueLGpwM9QKpuI4hmcCpry7yMEEV 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 Reviewed-by: Florian Fainelli Reviewed-by: Guenter Roeck --- drivers/watchdog/bcm2835_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c index 94907176a0e4..7a855289ff5e 100644 --- a/drivers/watchdog/bcm2835_wdt.c +++ b/drivers/watchdog/bcm2835_wdt.c @@ -218,17 +218,15 @@ static int bcm2835_wdt_probe(struct platform_device *pdev) return 0; } -static int bcm2835_wdt_remove(struct platform_device *pdev) +static void bcm2835_wdt_remove(struct platform_device *pdev) { if (pm_power_off == bcm2835_power_off) pm_power_off = NULL; - - return 0; } static struct platform_driver bcm2835_wdt_driver = { .probe = bcm2835_wdt_probe, - .remove = bcm2835_wdt_remove, + .remove_new = bcm2835_wdt_remove, .driver = { .name = "bcm2835-wdt", }, 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: 13159487 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: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: 13159488 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 37AC2C7EE33 for ; Fri, 3 Mar 2023 21:37:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231816AbjCCVhl (ORCPT ); Fri, 3 Mar 2023 16:37:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231842AbjCCVhi (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 E6BCD62D8D 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-00005o-6D; 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 1pYD5p-001eAZ-S9; 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 1pYD5p-001wxe-0E; Fri, 03 Mar 2023 22:37:33 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck , Florian Fainelli , Ray Jui , Scott Branden Cc: Broadcom internal kernel review list , linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 09/34] watchdog: bcm_kona: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:51 +0100 Message-Id: <20230303213716.2123717-10-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=1640; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6iQrQBQ/8cNCzN3/6Tl45oGFovNbg5BTl82HWggeOFY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmguDgpt8HM3j99LPU+PXylW2tji63SJPoRhQ Y2NiSXPyvWJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoLgAKCRDB/BR4rcrs CdW7B/91OEJ0xeknRiUNvKV+XA5wgtecSgbDhobNEdDK7gxipzxsm2nGU+UriSIefBAyI42UW2L Uk7ksvV9Vt0SI0eUXtpSQEuyxqvAtQAOP1tgOwQMlvjyP/xaMQPEEajXzO7oELBnJJXLHVcgOMr gVk9RZWl8sp6tSiNfXzJXIUPRUN4LRtcRJunsPD+g+IvQt6cXAOH+djNZoG+iQHhHMl0WhzgJqb nt7H9H83g8HCRRfGI1GCSICAkl1Sdyrx3em6MB84IX04DYBpddWnwxAshOgA5QmmZ7tQtmBEbC5 dawe+bm52wnllyI07QYEHjknJRsI4N4Rj2ass6OJFbbZgxb3 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 Reviewed-by: Florian Fainelli Reviewed-by: Guenter Roeck --- drivers/watchdog/bcm_kona_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c index 8237c4e9c2a0..49e12d47b073 100644 --- a/drivers/watchdog/bcm_kona_wdt.c +++ b/drivers/watchdog/bcm_kona_wdt.c @@ -310,12 +310,10 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev) return 0; } -static int bcm_kona_wdt_remove(struct platform_device *pdev) +static void bcm_kona_wdt_remove(struct platform_device *pdev) { bcm_kona_wdt_debug_exit(pdev); dev_dbg(&pdev->dev, "Watchdog driver disabled"); - - return 0; } static const struct of_device_id bcm_kona_wdt_of_match[] = { @@ -330,7 +328,7 @@ static struct platform_driver bcm_kona_wdt_driver = { .of_match_table = bcm_kona_wdt_of_match, }, .probe = bcm_kona_wdt_probe, - .remove = bcm_kona_wdt_remove, + .remove_new = bcm_kona_wdt_remove, }; module_platform_driver(bcm_kona_wdt_driver); From patchwork Fri Mar 3 21:36: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: 13159482 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 8809AC7EE3A for ; Fri, 3 Mar 2023 21:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231728AbjCCVhi (ORCPT ); Fri, 3 Mar 2023 16:37:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231292AbjCCVhh (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 6540462D8C 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 1pYD5q-00005t-K0; Fri, 03 Mar 2023 22:37:34 +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-001eAd-UH; 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 1pYD5p-001wxi-6y; 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 10/34] watchdog: cpwd: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:52 +0100 Message-Id: <20230303213716.2123717-11-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=1636; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=LMkzrPF5eAJZYQfTdtVD0pd5bkljN8DywNHIHulvdDs=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmgyzwyAUGRctfux1Tu5vY6uhBWvZyPrp0ow/ +CwE0bFC/mJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoMgAKCRDB/BR4rcrs CTELB/sEbWvRv39V/BQc7ZXZ4OIWgHhtW18iTWGmV9RzQoKnBIr+5xEeoimiok82VoWBZRmhvU5 aV1hMjW+lxAVHncLeMKksNAyar9SbAqalXgWCTcxqg5l8rCer5uLlT/B7a4mPpd5bc4nQVJMLqP SC5IqbNGiXfDkBJUrH9B27iipU1RZYhkb2KgCALQQeGUzC5i0SQLQMHf+Cfo/y52V0vFyZsnJRn Cl174FKehO20U3fXT+SAd6UR+eD1FXIp2JIPpm9rK1MisB+Tu/odf2nN/wJ8kB2xbG/n1oxcBjw kPzGVB8syKfMqkrmjks5zXYF5vpbXNsHkCizFuBOE+QaMz2C 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 Reviewed-by: Guenter Roeck --- drivers/watchdog/cpwd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c index 1eafe0b4d71c..47250f9b68c7 100644 --- a/drivers/watchdog/cpwd.c +++ b/drivers/watchdog/cpwd.c @@ -614,7 +614,7 @@ static int cpwd_probe(struct platform_device *op) return err; } -static int cpwd_remove(struct platform_device *op) +static void cpwd_remove(struct platform_device *op) { struct cpwd *p = platform_get_drvdata(op); int i; @@ -638,8 +638,6 @@ static int cpwd_remove(struct platform_device *op) of_iounmap(&op->resource[0], p->regs, 4 * WD_TIMER_REGSZ); cpwd_device = NULL; - - return 0; } static const struct of_device_id cpwd_match[] = { @@ -656,7 +654,7 @@ static struct platform_driver cpwd_driver = { .of_match_table = cpwd_match, }, .probe = cpwd_probe, - .remove = cpwd_remove, + .remove_new = cpwd_remove, }; module_platform_driver(cpwd_driver); From patchwork Fri Mar 3 21:36: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: 13159484 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 C7BD6C7EE39 for ; Fri, 3 Mar 2023 21:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231292AbjCCVhj (ORCPT ); Fri, 3 Mar 2023 16:37:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231793AbjCCVhh (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 8CAF362D86 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 1pYD5q-00006D-Qf; Fri, 03 Mar 2023 22:37:34 +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-001eAl-58; 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-001wxl-Et; 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 11/34] watchdog: dw: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:53 +0100 Message-Id: <20230303213716.2123717-12-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=1747; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=5Y2NHWphrFZXOxH/6CBv3LnZTHSvhtiO0Ar57w0WXf4=; b=owGbwMvMwMV48I9IxdpTbzgZT6slMaQwZZi+jcqTSd7KvtZSjJlFOnfWcz0J17j1hv+3P2/sm FXgumJvJ6MxCwMjF4OsmCJLXZGW2ASJNf/tSpZwwwxiZQKZwsDFKQATuZfM/oe3KXnaVv1FWxae aZbgz5ieprFH2spT1Xgtf5Cwzx2rJdlywbel1k/94mO0O6P8zHrvZ3eKmPc5Wermlj3jPrYg7Xz mMdEv2459+HhxQ2ZXyaaDP1YERL3R39LTYOrKmLF4904/N6kMtfgmL5s1Tixf9uRZV0rmz0kNDX y5vzJ7FU+4l22dwT+XFPMNE3N+b7ny9ddVtZv/Z39xKWxWyhLaf5CVTTW2ZfZp9SO6O2RXhhtEP /nhvii58/dDA5PkV82zpYLTHzJ+cX4i3LrCzFo+0S894cR/c80e1acSgc9DCg/qB+fa5TlnF/qV ZV6b6BneZ3JeRuD8t3yr80+FdkxcGhf8+rnsZNVnFzu1AA== 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 Reviewed-by: Guenter Roeck --- drivers/watchdog/dw_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c index 462f15bd5ffa..6f88bd81f8a1 100644 --- a/drivers/watchdog/dw_wdt.c +++ b/drivers/watchdog/dw_wdt.c @@ -681,7 +681,7 @@ static int dw_wdt_drv_probe(struct platform_device *pdev) return ret; } -static int dw_wdt_drv_remove(struct platform_device *pdev) +static void dw_wdt_drv_remove(struct platform_device *pdev) { struct dw_wdt *dw_wdt = platform_get_drvdata(pdev); @@ -691,8 +691,6 @@ static int dw_wdt_drv_remove(struct platform_device *pdev) reset_control_assert(dw_wdt->rst); clk_disable_unprepare(dw_wdt->pclk); clk_disable_unprepare(dw_wdt->clk); - - return 0; } #ifdef CONFIG_OF @@ -705,7 +703,7 @@ MODULE_DEVICE_TABLE(of, dw_wdt_of_match); static struct platform_driver dw_wdt_driver = { .probe = dw_wdt_drv_probe, - .remove = dw_wdt_drv_remove, + .remove_new = dw_wdt_drv_remove, .driver = { .name = "dw_wdt", .of_match_table = of_match_ptr(dw_wdt_of_match), 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: 13159483 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 Reviewed-by: Guenter Roeck --- 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: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: 13159490 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 76C13C7EE39 for ; Fri, 3 Mar 2023 21:37:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231882AbjCCVhn (ORCPT ); Fri, 3 Mar 2023 16:37:43 -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 S231851AbjCCVhj (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 8A8F562D86 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-00009v-Lh; 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-001eBJ-1G; 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 1pYD5p-001wxr-SF; 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 13/34] watchdog: geodewdt: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:55 +0100 Message-Id: <20230303213716.2123717-14-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=1547; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=SKAV+qcj5+C+HrTYZy8tDYcd6N3r9EXGU/nAfdzZO8k=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmg9wUXy0j1mKaV80r0j3T2YXDlGOAtEB948R ibybzj3vG6JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoPQAKCRDB/BR4rcrs CYfUB/9HX+f49ANA1n+lthIu0b4X/XzrCYuQQpECyGpKwx7yW1Nt88izsW0gip9VNGay2hrT9Gh tpB0l4mjj7Fzp/T1AwdUkUaDLX+QfZOCWFq17tWe/BeSs/5PHSLDVDPebCxkxPGpz4S3z2dQc/M SerSCenj47EuUUSwlorRcCJB1WNCSXGNamxj0Y4wfmtCBgeBayR7xyKYqr4WI+S3nLEWFVbYtHq JqwwwTBvAeO33SSSQUS7G1cTsDQ9RPwINMbRU7BPlhwf55yA7xi0f9hmEiTZalsJXcFq2GCVmU3 pR2gGeNuB7aa9tnesthPvGTvykCz3dAFwCktuJISgtu2+7mi 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 Reviewed-by: Guenter Roeck --- drivers/watchdog/geodewdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/geodewdt.c b/drivers/watchdog/geodewdt.c index 0b699c783d57..5186c37ad451 100644 --- a/drivers/watchdog/geodewdt.c +++ b/drivers/watchdog/geodewdt.c @@ -238,10 +238,9 @@ static int __init geodewdt_probe(struct platform_device *dev) return ret; } -static int geodewdt_remove(struct platform_device *dev) +static void geodewdt_remove(struct platform_device *dev) { misc_deregister(&geodewdt_miscdev); - return 0; } static void geodewdt_shutdown(struct platform_device *dev) @@ -250,7 +249,7 @@ static void geodewdt_shutdown(struct platform_device *dev) } static struct platform_driver geodewdt_driver = { - .remove = geodewdt_remove, + .remove_new = geodewdt_remove, .shutdown = geodewdt_shutdown, .driver = { .name = DRV_NAME, 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: 13159485 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 Reviewed-by: Guenter Roeck --- 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: 13159489 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 Reviewed-by: Guenter Roeck --- 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: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: 13159492 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 1355EC7EE33 for ; Fri, 3 Mar 2023 21:37:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231888AbjCCVhp (ORCPT ); Fri, 3 Mar 2023 16:37:45 -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 S231858AbjCCVhk (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 31A9D62D8D 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 1pYD5s-0000A5-SP; 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-001eBQ-7E; 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-001wy6-HL; Fri, 03 Mar 2023 22:37:34 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck , Vladimir Zapolskiy Cc: linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 16/34] watchdog: lpc18xx: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:36:58 +0100 Message-Id: <20230303213716.2123717-17-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=1770; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=n7azFGUPBrsh0Bp6UwezUzjK+kCPODWtZ+uq4gprEN8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhHkiVkKSlGIMQLTEQ1j04fq3VA+xdDBKyY5 iiMjUB5XCeJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoRwAKCRDB/BR4rcrs CVQZB/4rnCJKXjN1CTYmT1nM59qWxDcfNiSsGGzhWPlAijT/Z3FA3tBIFVgoPbpm/8fh6FFK+df k1/cir/iHMkjWbZ78ER1dTWnFVsbweQ73fk4zt4TBby4EbG4Gmp1ml/6ostsHdsleAKKPelvRoc 6cKjc1v6bmt6QYITdAd9YUf4P9xsqHIAAx86ymjCyt51DrSzO7zc+GTg9f61hR7/SquH5BsbyEP KXWQ0mQdavr6eT14x/eRNqUWODBjnAajMBthAUWTWlcmIRoiQQp2BW7XR4ESBWzagPF5vUXVq3z dmsFpWfPUu8HKRGWydVFxcBlzZZtxxJiE2EbQplEBXxDCCKO 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 Reviewed-by: Guenter Roeck --- drivers/watchdog/lpc18xx_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/lpc18xx_wdt.c b/drivers/watchdog/lpc18xx_wdt.c index 1b9b5f21a0df..19535f4a2fd2 100644 --- a/drivers/watchdog/lpc18xx_wdt.c +++ b/drivers/watchdog/lpc18xx_wdt.c @@ -261,14 +261,12 @@ static int lpc18xx_wdt_probe(struct platform_device *pdev) return devm_watchdog_register_device(dev, &lpc18xx_wdt->wdt_dev); } -static int lpc18xx_wdt_remove(struct platform_device *pdev) +static void lpc18xx_wdt_remove(struct platform_device *pdev) { struct lpc18xx_wdt_dev *lpc18xx_wdt = platform_get_drvdata(pdev); dev_warn(&pdev->dev, "I quit now, hardware will probably reboot!\n"); del_timer_sync(&lpc18xx_wdt->timer); - - return 0; } static const struct of_device_id lpc18xx_wdt_match[] = { @@ -283,7 +281,7 @@ static struct platform_driver lpc18xx_wdt_driver = { .of_match_table = lpc18xx_wdt_match, }, .probe = lpc18xx_wdt_probe, - .remove = lpc18xx_wdt_remove, + .remove_new = lpc18xx_wdt_remove, }; module_platform_driver(lpc18xx_wdt_driver); 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: 13159491 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 Reviewed-by: Guenter Roeck --- 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: 13159493 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 Reviewed-by: Guenter Roeck --- 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: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: 13159494 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 D87BBC7EE43 for ; Fri, 3 Mar 2023 21:37:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231847AbjCCVhp (ORCPT ); Fri, 3 Mar 2023 16:37:45 -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 S231808AbjCCVhk (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 65C7C62D9C 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-0000AM-4Z; 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-001eBW-DV; 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-001wyG-5Z; 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 19/34] watchdog: nv_tco: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:01 +0100 Message-Id: <20230303213716.2123717-20-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=1544; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=N474ygOiq5p6UhyWq5RkJUOSzFCpjF/S6GwTzm//nUM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhRZZiOfocWCNCFpf/WzFAkNsxNbtg7Eq5db zue/z6g2YqJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoUQAKCRDB/BR4rcrs CZXFB/98QZMb0w0vfOeDyh4n5wec/HM7clSteY97pQ7G9JMFL5mKTsgni4N2zoMHtYiL9w+qYly K5Xbmt1Uvuu8im4ZvNJEwCLDTxJUOtzD/x40O6I3NaizNSOqT1m1QSPumOCF+Y/KyL4lK/Na9su KkINB/5WCi+c1YN9davUmXXcLbypG18fxs2dPEnYCZJyUBL7jOem0oImrrIvYDjFWK6SwHq1Un9 S2Bkh48cUdO5tmwqIHveh4RQNHqElAQhh6WZsTNpRtjnIGLWfUxiXTDoko79XueUkKDapEHIA/8 BFwmXeb54IyjA7a7UvoQMY4h+6wUfgl0hT1ajbW5FJtY2/WO 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 Reviewed-by: Guenter Roeck --- drivers/watchdog/nv_tco.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/nv_tco.c b/drivers/watchdog/nv_tco.c index f6902a337422..ac4a9c16341d 100644 --- a/drivers/watchdog/nv_tco.c +++ b/drivers/watchdog/nv_tco.c @@ -446,12 +446,10 @@ static void nv_tco_cleanup(void) release_region(tcobase, 0x10); } -static int nv_tco_remove(struct platform_device *dev) +static void nv_tco_remove(struct platform_device *dev) { if (tcobase) nv_tco_cleanup(); - - return 0; } static void nv_tco_shutdown(struct platform_device *dev) @@ -469,7 +467,7 @@ static void nv_tco_shutdown(struct platform_device *dev) static struct platform_driver nv_tco_driver = { .probe = nv_tco_init, - .remove = nv_tco_remove, + .remove_new = nv_tco_remove, .shutdown = nv_tco_shutdown, .driver = { .name = TCO_MODULE_NAME, From patchwork Fri Mar 3 21:37: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: 13159498 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 A8F13C7EE32 for ; Fri, 3 Mar 2023 21:37:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231893AbjCCVhr (ORCPT ); Fri, 3 Mar 2023 16:37:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231861AbjCCVhk (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 ADBCF62D86 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-0000Ab-3s; 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-001eBb-GF; 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-001wyJ-CT; 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 20/34] watchdog: omap: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:02 +0100 Message-Id: <20230303213716.2123717-21-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=1736; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=XN+dBdzk16QJCxdEFibRRQ9fthPrchYs74S0K9CsNb0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhU8CfwdBULSFgWPuERnMS47GTOh8YVEnAlD JE9Jicy2TeJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoVAAKCRDB/BR4rcrs CX3JCACQRNJxBTOvi7BeQb6hK8xGqSJRnxrXrOVwzZRD30ssGMpkdsZBSiou8h9Op5d0LKvyu81 EPK4EXRPNf63y7S7TYkuXlXOYjjeqGdjWflVHei0D6thZYngm6DVER9uAc2/oFqiWA78xESM+6y LNIPqGLIVh1Cl3fGHmUwF8DHGvPfApH+AJwFYH04V54ZSkoFJKJo+10K2XHlZQX0vXRzjERQq0M +h8/5sTDWOmLdNFYXFqTefburAvrJaub82kkxITPgDv2/lGZFgDuCODbNAAEHgD7Iya4mlhFs9M T973+EBWXHnN+r+NrRkIQJSqya/8p2U+9hPp5a5leVyLn9NV 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 Reviewed-by: Guenter Roeck --- drivers/watchdog/omap_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index e75aa86f63cb..a7a12f2fe9de 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c @@ -306,14 +306,12 @@ static void omap_wdt_shutdown(struct platform_device *pdev) mutex_unlock(&wdev->lock); } -static int omap_wdt_remove(struct platform_device *pdev) +static void omap_wdt_remove(struct platform_device *pdev) { struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); pm_runtime_disable(wdev->dev); watchdog_unregister_device(&wdev->wdog); - - return 0; } /* REVISIT ... not clear this is the best way to handle system suspend; and @@ -359,7 +357,7 @@ MODULE_DEVICE_TABLE(of, omap_wdt_of_match); static struct platform_driver omap_wdt_driver = { .probe = omap_wdt_probe, - .remove = omap_wdt_remove, + .remove_new = omap_wdt_remove, .shutdown = omap_wdt_shutdown, .suspend = pm_ptr(omap_wdt_suspend), .resume = pm_ptr(omap_wdt_resume), From patchwork Fri Mar 3 21:37: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: 13159496 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 23553C7EE39 for ; Fri, 3 Mar 2023 21:37:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231863AbjCCVhr (ORCPT ); Fri, 3 Mar 2023 16:37:47 -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 S231862AbjCCVhk (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 C25D862DA7 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-0000AJ-7O; 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-001eBV-Co; 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-001wyM-JZ; 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 21/34] watchdog: orion: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:03 +0100 Message-Id: <20230303213716.2123717-22-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=1853; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=bfMsGz9qpwvbKKYF+ssoYFDlsYAdFfN+8CB/uAFAt+k=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhX1V3f94C6sXUgFDxyBqYnzbHytqU25cfcf hUWnH2axUeJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoVwAKCRDB/BR4rcrs Cbi6B/92cUksSk0a6l8SZP0K+H0NnsfbPDOK0ajRBGjSyZ0wRa2a7Bx6927E0LAeHGS3eYWQ9t+ WP3YkwW6aODXoROUIcd/1jusCe8Fw4+/jpfjDpogJCRVs0gs1WXSZG5VH9GWHxDtEZXUbpgteff tF3ExIO91J1t0QkrRzzbAFTM5XHmtJoHnQrBQLDeegDB66ZX4sBW4X6EEatqPdc7wqKq63ENHDj oyDwAuEv9B9JPkljj4hCdcS/cH7cKw6s4iRj+dbScdBA4kW+AJPIX9T0zFGtFe5gQP/VmT4WMin ukA6bJrmQLCbzCyBbudDqlyLK5jBe5I6M4Ri4lFPZL7SDXSC 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 Reviewed-by: Guenter Roeck --- drivers/watchdog/orion_wdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index e25e6bf4647f..5ec2dd8fd5fa 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c @@ -649,7 +649,7 @@ static int orion_wdt_probe(struct platform_device *pdev) return ret; } -static int orion_wdt_remove(struct platform_device *pdev) +static void orion_wdt_remove(struct platform_device *pdev) { struct watchdog_device *wdt_dev = platform_get_drvdata(pdev); struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev); @@ -657,7 +657,6 @@ static int orion_wdt_remove(struct platform_device *pdev) watchdog_unregister_device(wdt_dev); clk_disable_unprepare(dev->clk); clk_put(dev->clk); - return 0; } static void orion_wdt_shutdown(struct platform_device *pdev) @@ -668,7 +667,7 @@ static void orion_wdt_shutdown(struct platform_device *pdev) static struct platform_driver orion_wdt_driver = { .probe = orion_wdt_probe, - .remove = orion_wdt_remove, + .remove_new = orion_wdt_remove, .shutdown = orion_wdt_shutdown, .driver = { .name = "orion_wdt", 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: 13159497 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 Reviewed-by: Guenter Roeck --- 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: 13159495 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 Reviewed-by: Guenter Roeck --- 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: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: 13159500 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 0FEC2C8300C for ; Fri, 3 Mar 2023 21:37:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231861AbjCCVht (ORCPT ); Fri, 3 Mar 2023 16:37:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231842AbjCCVhm (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 7147E62DA6 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-0000Fx-Oa; 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-001eBu-8k; 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-001wyZ-A9; 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 24/34] watchdog: renesas: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:06 +0100 Message-Id: <20230303213716.2123717-25-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=1598; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=y1lJI0IICJXW8SluHHYFHg1hyYDIrzGh81N9PINLqMM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhjp66tQsp32Tk6Qo8KLzTxzNGoOrgFfcnGa r4mMukEZuiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoYwAKCRDB/BR4rcrs CZlQB/48ioRXPTgnPh5dT09qUc2WkTf7BJTWik3n1ahyNaXYMcjQ3d0nlKFRw16w9BXXadbm0VV ZnWrmCboP/6Qx+ZKYqFc48pe4F1VivF8ts+AZyhivaiDJ7mMSVxnGYgKNUxOoIGX1/354LRHZYM +00MjpyuuwZjjS+WU9WsDm2AS5do7bSX+iXP9o96FOm/6ysHqYqAbgNAzFuZDKrcGIIKzEDeGy0 AKTFPsqv3/4/aXZSXHGHgJsQmBPaDWu2SHB+RoT7cWPn5hliaYYnPET/i8RUGPD7eRv4m47l9qO 2/Ul14bolNFlNq34IhiVX77zf/H2rUaNyt7p2w5cCDbT2qsc 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 Reviewed-by: Guenter Roeck --- drivers/watchdog/renesas_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c index 41d58ea5eb2f..12c41d6e5cd6 100644 --- a/drivers/watchdog/renesas_wdt.c +++ b/drivers/watchdog/renesas_wdt.c @@ -292,14 +292,12 @@ static int rwdt_probe(struct platform_device *pdev) return ret; } -static int rwdt_remove(struct platform_device *pdev) +static void rwdt_remove(struct platform_device *pdev) { struct rwdt_priv *priv = platform_get_drvdata(pdev); watchdog_unregister_device(&priv->wdev); pm_runtime_disable(&pdev->dev); - - return 0; } static int __maybe_unused rwdt_suspend(struct device *dev) @@ -339,7 +337,7 @@ static struct platform_driver rwdt_driver = { .pm = &rwdt_pm_ops, }, .probe = rwdt_probe, - .remove = rwdt_remove, + .remove_new = rwdt_remove, }; module_platform_driver(rwdt_driver); 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: 13159499 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 Reviewed-by: Guenter Roeck --- 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: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: 13159502 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 13FA7C87FDE for ; Fri, 3 Mar 2023 21:37:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231871AbjCCVhu (ORCPT ); Fri, 3 Mar 2023 16:37:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231877AbjCCVhn (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 EB05262DAA 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-0000J7-A3; 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-001eC6-Oo; 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-001wyl-Qb; 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 26/34] watchdog: rn5t618: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:08 +0100 Message-Id: <20230303213716.2123717-27-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=1540; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=13adthKED0hw/LacgJu2Y/eoMB75bN5Yr91DJjqZzXg=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmhqAxaRMiwYmcGxsOzY1fcEFeOC7hNGND0Qp WWnUQiEX8mJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoagAKCRDB/BR4rcrs CSmZCACXtu9u0DYMnkFdOB7Ah6X/8QqEGysblV35cMQC74bVU0NTZE0waNGrdItypDM6RDrmp9K zWmffyvvI35p1roxvgA+pxjrGeGXtY8rCWKB7y+mV1PeGocwY21xN6jG5hMSE9yESdzf843EQLy dJuuZzQfVJHkHjD5jXMmrKq565fBAjmFR0s9nPnkLEIudiQxID1YydStZjM4wAzoHguBCyDZsG2 fPG965MapSc4KPKTwidEzFfIKG1ciWi9R4EdJFKMDFCkD1JRViWrJtjqWHxCHQx9IUJbnezGbLN hf0zqUBsRHdHQuIOOAImmzZE9oQjR2CEUGhSG6oLEpYRb3Jd 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/rn5t618_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/rn5t618_wdt.c b/drivers/watchdog/rn5t618_wdt.c index 40d8ebd8c0ac..b0da5cc8ccdf 100644 --- a/drivers/watchdog/rn5t618_wdt.c +++ b/drivers/watchdog/rn5t618_wdt.c @@ -181,18 +181,16 @@ static int rn5t618_wdt_probe(struct platform_device *pdev) return watchdog_register_device(&wdt->wdt_dev); } -static int rn5t618_wdt_remove(struct platform_device *pdev) +static void rn5t618_wdt_remove(struct platform_device *pdev) { struct rn5t618_wdt *wdt = platform_get_drvdata(pdev); watchdog_unregister_device(&wdt->wdt_dev); - - return 0; } static struct platform_driver rn5t618_wdt_driver = { .probe = rn5t618_wdt_probe, - .remove = rn5t618_wdt_remove, + .remove_new = rn5t618_wdt_remove, .driver = { .name = DRIVER_NAME, }, 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: 13159503 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 Reviewed-by: Guenter Roeck --- 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: 13159509 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: 13159501 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 Reviewed-by: Guenter Roeck --- 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: 13159505 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 Reviewed-by: Guenter Roeck --- 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: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: 13159504 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 0F11CC7EE33 for ; Fri, 3 Mar 2023 21:37:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231876AbjCCVhv (ORCPT ); Fri, 3 Mar 2023 16:37:51 -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 S231846AbjCCVhn (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 6ADFC62D8C 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-0000MO-33; 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-001eCO-Ie; 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-001wz4-Sf; 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 31/34] watchdog: shwdt: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:13 +0100 Message-Id: <20230303213716.2123717-32-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=1497; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iVUZR7ZZG6sIBvoU4vG2GXDXD0MjRal6itztdA9q34o=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmh7kucYCkd5mkxJsFJ4CxnidglB5WX2HF1Hj qeuFs4moIyJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJoewAKCRDB/BR4rcrs CYJiB/9ftbS9UYhXVnGC9XmcjhqLL82PxS33nTde+hvK1Gy7gecM4SM2ATiVIt0ukYhFfMPUBRc N2ozqOKcaoIChQu1xX8b0/KpFc6AaJnI5yuxqu063+jv83UE6pXYCe2uTRPuYiyc2S+OMnTf6FP QLoNtB+5+gIo9xj3Hoj4oFgWsq9aSKgC2lXMtwv6Doh6BTNUA2VdM77jfX+21wsMP7AUv3pfFjy gC+EwQChE76glCMRLHMAf+ucWHXhc4vQchraS1kU7CuZprdw8f4CLouf6CKRnLaPgifnL8laFu5 64Xg1FKb9eZH3mg7Tdh37JGlnpXygZTTq+b53CKO+UMyGDbk 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 Reviewed-by: Guenter Roeck --- drivers/watchdog/shwdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c index f55533e0e045..10f1fba78ec2 100644 --- a/drivers/watchdog/shwdt.c +++ b/drivers/watchdog/shwdt.c @@ -279,13 +279,11 @@ static int sh_wdt_probe(struct platform_device *pdev) return 0; } -static int sh_wdt_remove(struct platform_device *pdev) +static void sh_wdt_remove(struct platform_device *pdev) { watchdog_unregister_device(&sh_wdt_dev); pm_runtime_disable(&pdev->dev); - - return 0; } static void sh_wdt_shutdown(struct platform_device *pdev) @@ -299,7 +297,7 @@ static struct platform_driver sh_wdt_driver = { }, .probe = sh_wdt_probe, - .remove = sh_wdt_remove, + .remove_new = sh_wdt_remove, .shutdown = sh_wdt_shutdown, }; From patchwork Fri Mar 3 21:37: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: 13159508 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 0291BC7EE30 for ; Fri, 3 Mar 2023 21:37:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231851AbjCCVhx (ORCPT ); Fri, 3 Mar 2023 16:37:53 -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 S231874AbjCCVho (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 D06D362DA6 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-0000N0-9D; 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-001eCS-PN; 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 1pYD5u-001wz7-4L; Fri, 03 Mar 2023 22:37:38 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Patrice Chotard , Wim Van Sebroeck , Guenter Roeck Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 32/34] watchdog: st_lpc: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:14 +0100 Message-Id: <20230303213716.2123717-33-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=1582; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=al0sJH9Vx+3pAatMgMQcHOXZ2nL9pYUC5vDzmERSQTs=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmh+wt2Z9tpJ4E1RYrtfNA7CNjiGqLU9S/g9r 7cfzHKlobaJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJofgAKCRDB/BR4rcrs CSYMB/9p2SbGFV3lrCniLVC5LxVRB42yn804LyT0ZhwpxJ7JP4EDHe3X0xw4DHkKZZnNluXNsFb dleHYaQTyuoa1h8lFfHNwLMFKFQa8wDuton3Kla8BUe/9pi/3yT/g9s+ei8dTW0HD5DFLDsyYBt 5PrOwkZI9GK7gl6ItOheIPk7utc9W9mBS816V+DEbs+ojYOW5+xjzuzY1cbrAm86o/Q0RrbMcMK NpcY12xXiNCimZouDHSxClwqf0xTCyq1E79L9154N0HxpOiK3ffyuwJItvcN57LmYUpy9f17AsU ghke1UU3PmXBbog/PLp26jzIv9/7ie6bEHc2mfLR7Dk1rwB+ 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 Reviewed-by: Guenter Roeck --- drivers/watchdog/st_lpc_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/st_lpc_wdt.c b/drivers/watchdog/st_lpc_wdt.c index 39abecdb9dd1..d2aa43c00221 100644 --- a/drivers/watchdog/st_lpc_wdt.c +++ b/drivers/watchdog/st_lpc_wdt.c @@ -239,13 +239,11 @@ static int st_wdog_probe(struct platform_device *pdev) return ret; } -static int st_wdog_remove(struct platform_device *pdev) +static void st_wdog_remove(struct platform_device *pdev) { struct st_wdog *st_wdog = watchdog_get_drvdata(&st_wdog_dev); st_wdog_setup(st_wdog, false); - - return 0; } static int st_wdog_suspend(struct device *dev) @@ -295,7 +293,7 @@ static struct platform_driver st_wdog_driver = { .of_match_table = st_wdog_match, }, .probe = st_wdog_probe, - .remove = st_wdog_remove, + .remove_new = st_wdog_remove, }; module_platform_driver(st_wdog_driver); 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: 13159507 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 Reviewed-by: Guenter Roeck --- 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); From patchwork Fri Mar 3 21:37: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: 13159506 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 AD274C7EE3A for ; Fri, 3 Mar 2023 21:37:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231892AbjCCVhw (ORCPT ); Fri, 3 Mar 2023 16:37:52 -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 S231883AbjCCVhn (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 0094862D8E 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-0000OL-MO; 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-001eCb-C1; 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-001wzE-JM; Fri, 03 Mar 2023 22:37:38 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Guenter Roeck Cc: patches@opensource.cirrus.com, linux-watchdog@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 34/34] watchdog: wm8350: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 22:37:16 +0100 Message-Id: <20230303213716.2123717-35-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=1461; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=FsTnlhggXsgEULKqbXWL/LTIOxmfSKGmu5i8CQCqZsE=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAmiFtSMLGcsyUp3OzB+xkaNCByzphZuintiRG snzjgtBKYeJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAJohQAKCRDB/BR4rcrs CTBqB/4hcZWYiM/Scq4FHWrfA6b5P4oge5iuLGgEVqEgmCp8W7TBzvJqQy7c/WoOZRZtXcv6ryP ueXfffcb8xdQ3LhnXtl22RiHEowYgWK+XfiIZggqxQklSqQ50gm0IvWBLjxWxkRjXvDqLr6ATxJ 9YvZyQ6vY0uEqJXZ6PbbAVPnQExt2C5v2eyT1nP5sIednhABJwNCKyFpGwRhDeMRdYNBVjpOhVq gZ7y9TQfaSqK1HmsXN/xH1zxdgUBbLrEhsJNOxsIH0RM+FMNvSnLG9crD6JZ3AdNAzWQphtKxJf EVdJJfUrXnt4Eh0p7w0AQlvjxTML8ALztjOj7uLFzJKueo3Z 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/wm8350_wdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/wm8350_wdt.c b/drivers/watchdog/wm8350_wdt.c index 33c62d51f00a..febda195aed2 100644 --- a/drivers/watchdog/wm8350_wdt.c +++ b/drivers/watchdog/wm8350_wdt.c @@ -156,15 +156,14 @@ static int wm8350_wdt_probe(struct platform_device *pdev) return watchdog_register_device(&wm8350_wdt); } -static int wm8350_wdt_remove(struct platform_device *pdev) +static void wm8350_wdt_remove(struct platform_device *pdev) { watchdog_unregister_device(&wm8350_wdt); - return 0; } static struct platform_driver wm8350_wdt_driver = { .probe = wm8350_wdt_probe, - .remove = wm8350_wdt_remove, + .remove_new = wm8350_wdt_remove, .driver = { .name = "wm8350-wdt", },