From patchwork Sat Nov 4 21:15: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: 741024 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 67B1EC4332F for ; Sat, 4 Nov 2023 21:15:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbjKDVPu (ORCPT ); Sat, 4 Nov 2023 17:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229969AbjKDVPs (ORCPT ); Sat, 4 Nov 2023 17:15:48 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79B4ED61 for ; Sat, 4 Nov 2023 14:15:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qzNza-0007zB-Su; Sat, 04 Nov 2023 22:15:42 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qzNza-006e1e-Cn; Sat, 04 Nov 2023 22:15:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qzNza-00D1bV-3m; Sat, 04 Nov 2023 22:15:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/14] power: reset: rmobile-reset: Convert to platform remove callback returning void Date: Sat, 4 Nov 2023 22:15:14 +0100 Message-ID: <20231104211501.3676352-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231104211501.3676352-16-u.kleine-koenig@pengutronix.de> References: <20231104211501.3676352-16-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1801; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=MJfb+/PjmRQpmXBAVa1pFQGegKcO7w3Ns8Dqi3tP/Bk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlRrRj+ryKRh/HAnlrZroDz4jwCvCA8UtEROp1q d5YXWsWuE6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUa0YwAKCRCPgPtYfRL+ ThgtB/4vrbqI07okSBeSaT9WSNN3AYedO25GgWoV67vQJiE0YU5oOg0FumiBh6E8dqc5s6BHVin l5cVkU9n5J16j9l6hwJQ/DiP8UqPyCeTOe/DsxbRNKA6xAQ3MpVJ9E+Y7dHaSAXEAA6ooQr0+iq pncuie19m++a+URUdOkMa+vrRb6vV9rpXOqDcMMNaqxm1HyynsPKxfEwzQUlk/pBU8IpNfELlrB zRo5DsnoP7yCIbMZ5E5Q0o8OzNFc03HzbemMKXLeNEOKSAF9BUzrTlm2GyPwC77nb4WcQP2sFyX 8V0YQu0s0fJpGYq5SBA0injdb0o4muZbdSbqVPXFYUqmjmRQ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/power/reset/rmobile-reset.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/power/reset/rmobile-reset.c b/drivers/power/reset/rmobile-reset.c index bd3b396558e0..5df9b41c68c7 100644 --- a/drivers/power/reset/rmobile-reset.c +++ b/drivers/power/reset/rmobile-reset.c @@ -59,11 +59,10 @@ static int rmobile_reset_probe(struct platform_device *pdev) return error; } -static int rmobile_reset_remove(struct platform_device *pdev) +static void rmobile_reset_remove(struct platform_device *pdev) { unregister_restart_handler(&rmobile_reset_nb); iounmap(sysc_base2); - return 0; } static const struct of_device_id rmobile_reset_of_match[] = { @@ -74,7 +73,7 @@ MODULE_DEVICE_TABLE(of, rmobile_reset_of_match); static struct platform_driver rmobile_reset_driver = { .probe = rmobile_reset_probe, - .remove = rmobile_reset_remove, + .remove_new = rmobile_reset_remove, .driver = { .name = "rmobile_reset", .of_match_table = rmobile_reset_of_match,