From patchwork Mon Mar 13 07:54:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 68665 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1053742wrd; Mon, 13 Mar 2023 00:59:52 -0700 (PDT) X-Google-Smtp-Source: AK7set964CwW/62fF8uhZGy0SxQNjV36ANXnxtm9dx8zHVvKvq63a92NCcu1nrUCsKuwBx+VJKSH X-Received: by 2002:aa7:9984:0:b0:5a9:d5c7:199e with SMTP id k4-20020aa79984000000b005a9d5c7199emr28686748pfh.9.1678694392085; Mon, 13 Mar 2023 00:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678694392; cv=none; d=google.com; s=arc-20160816; b=0Hic44rqiJ/2f87BOtNwoT1Cc3bmv0wzUwVRTs5Bty6TY8svmEHql1uji9/SFAD2gU l9uq+raaiGApABOWQDeU37pA6Ia2kj5OcB/GEb6Ee1/mJR9nHlACSLCi087O8C0VJjN1 CiWKib0SPP5Xga0kH8tJU1ccD9iI37nxqkHtY9uhfv0TTHpXvLHAtd+jAO2p+uBzjSkX O8BcqN1sMchndcWOlf1Of6Did2QNjwRPJki94udYQiRznCBWw65Tht423K7E69v4lpE3 9DboOOVNk4WKl3mzubBNxqTejuAolBL9zKTe4st0Yad5yiiOBG2AeznneMnOWpciVzoE Lqaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2yn9x/LOjW3rZLfqOZcwYniwvWq5WENcDHx9IPKJG50=; b=IMAnvNbAo2FBYZeiJSSaHqvd72M3eO/+n2Q9pciNtrvVM/yYna76SNbec8QN6Oca3n 3vlim9xV07gmucJkezuPOy8aRMHPHyGXRmp7TqWleNvEbB3U0zncAzNNRJMnvmzl2Fht KgvN37RIGvytDyDjZpKFtczjyO8Ijugb914Y7e2632+C7Fjw2fIyZxuzEZovZAT28qWj hxMl5wQFK2HGX4YfgeCWLLG08cKKMpjOzUrdRj1nkKpSLjn44c6wGP1+1Xhw6YYFt6wa Qfk3Qxc8yiQZNp6z3Ytes/Mp0/OeDToR5VbQwc5pJCYb2b0BMHO4dqJbWUzj1CxilI5f EN+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x7-20020aa79407000000b005a8cf0d93cbsi6074497pfo.3.2023.03.13.00.59.37; Mon, 13 Mar 2023 00:59:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230162AbjCMH5F (ORCPT + 99 others); Mon, 13 Mar 2023 03:57:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbjCMH42 (ORCPT ); Mon, 13 Mar 2023 03:56:28 -0400 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 C35EC359F for ; Mon, 13 Mar 2023 00:54:46 -0700 (PDT) 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 1pbd0w-0001jC-Ui; Mon, 13 Mar 2023 08:54: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 1pbd0w-003nam-6T; Mon, 13 Mar 2023 08:54:38 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pbd0v-004TOj-DO; Mon, 13 Mar 2023 08:54:37 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Daniel Lezcano , Thomas Gleixner , Thierry Reding , Jonathan Hunter Cc: linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 4/5] clocksource: timer-tegra186: Convert to platform remove callback returning void Date: Mon, 13 Mar 2023 08:54:29 +0100 Message-Id: <20230313075430.2730803-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230313075430.2730803-1-u.kleine-koenig@pengutronix.de> References: <20230313075430.2730803-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1785; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=fWROh41pLFAOOuaiIIcU6R9zdNm1DYH76BDFy3r52HE=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkDtavHL7WtDQHc1rbvZJIqcgl0K9PqzTyycMnC 6Nf5KH11GuJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZA7WrwAKCRDB/BR4rcrs CWQLB/41/1OCgtQxaLErB4WJV6Ma17tE20bSAkkJok3pVc7CSdHeSW8eNf9kjC3KRUrj2ligs4l LIVuFA/HaxYHMAL4Yl6HqF7MIn/4xMfvbIN0H1EP/hgfBA+2dfwJcd4DsLQnIPTqGTcRSI7qmbB gjXgAvzizCICokkN1p7zKo97Nki8sgv5AGB0w89dZKRXh3IAWVCYJv4xP3rLlsYjg6fwD37jW1z 86yfBkfSrGKOuJLbsLmiHr40+xsMfDItTmlVvcS2cFckywqhSVydAjn5/tryyJqkSk102PhkH0c /6GUqM5+8JqrVQuQIZ3+iWbv7vuN16/sc7nsxUipYgkOw9bB 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-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760238650699476070?= X-GMAIL-MSGID: =?utf-8?q?1760238650699476070?= 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/clocksource/timer-tegra186.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/clocksource/timer-tegra186.c b/drivers/clocksource/timer-tegra186.c index ea742889ee06..ccc762d32422 100644 --- a/drivers/clocksource/timer-tegra186.c +++ b/drivers/clocksource/timer-tegra186.c @@ -447,15 +447,13 @@ static int tegra186_timer_probe(struct platform_device *pdev) return err; } -static int tegra186_timer_remove(struct platform_device *pdev) +static void tegra186_timer_remove(struct platform_device *pdev) { struct tegra186_timer *tegra = platform_get_drvdata(pdev); clocksource_unregister(&tegra->usec); clocksource_unregister(&tegra->osc); clocksource_unregister(&tegra->tsc); - - return 0; } static int __maybe_unused tegra186_timer_suspend(struct device *dev) @@ -505,7 +503,7 @@ static struct platform_driver tegra186_wdt_driver = { .of_match_table = tegra186_timer_of_match, }, .probe = tegra186_timer_probe, - .remove = tegra186_timer_remove, + .remove_new = tegra186_timer_remove, }; module_platform_driver(tegra186_wdt_driver);