From patchwork Wed Jul 12 09:33:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13309928 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 CE4B3EB64D9 for ; Wed, 12 Jul 2023 09:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233167AbjGLJds (ORCPT ); Wed, 12 Jul 2023 05:33:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233113AbjGLJdq (ORCPT ); Wed, 12 Jul 2023 05:33:46 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2131.outbound.protection.outlook.com [40.107.117.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B940F19B; Wed, 12 Jul 2023 02:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HBE9Qk7YJGs1OBR/0XBBh1Cg7wRhiu2juLH3Mz55PgDo3FCLPkhh4DKpNUwHts1ejLbzsBt4U46ajWfec0Pol4PloWNS9ZoYahtu65xt9jCh2zaO0n9eki0H8ttUOmzyE9hu5heuHACOhrgmfi2EOJU8G2lNzXcDzZ+oXey/bdc5+IEPhsZ4kdelloso7ErUR7zowgEibiSr2b+udJlF+v6ZUs5BbYvT+5Tcqk3N0SKhlC3jDrGCQ3LE9v8eKZ6e7CiPPinWWoUDnlW2A0zDasGn149dSbeXPbTd2ABxklhVUV/6xp+tsg05uBkPbPLo2ZIumcQFB11R+7OgY+cx1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=c89Uk5+QEiVyGy9EW+mO0csGCw2tVCASv9GKv0BtYaw=; b=GZ9njliHIQPf2BpZ3CYCAjGsk098ggsyiL7JkzdcNypCPiGtJXS9eU5MheZux1Pl5lH0h8J2iN9IcBYJCHFl835spi4SvlPRCXqNcuZvnf0xUqvmLSPWryvsma78HQAaZKtpF6bNRQPq5Iq6VRn9VmzDVb69gzQLUeq6Uxd5mNGyRgssvs3K4QbYpNNHtRsKEmWLt38pP3lLaATnSJTVezcgSz3nf2TUpnch2W9aFcLlTwqkcAorC8seMQUZFkEkhqhOeZ/MXJXHMlJ+DV38sHKEPiHyHCiT8Bcc5wuvFfqLxT7gC9BamrTVIn+hMKd1wVZ6fcpmaGzEWXLSWn0jWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c89Uk5+QEiVyGy9EW+mO0csGCw2tVCASv9GKv0BtYaw=; b=Tqt6qNhDZrbvGQcgOS2g7l20yU5DZhr8gklDzJyu2WYxEoS7f7PAZAV7l1lalPSL98J3Tv5uv/f0xPmdh9Z9WCvQOdJlAOzYaCc1jWUdFrtiJ7IB/P/ErYI7/0GpEuSUBK7s87Tvf/PGw+td3Ap5DalXY6x2abxCOfFP8hdktnMCvpg/gKJty2MbNgwpcokmQDlMWkb20AqIfqB4Q22Jw+9caA+KCZMiaYhAEsxL2mLwBJFlEo3C+aM4rXSXr4e9daUTotjxW+g5mn3OVipqpeEkXH89QxzC2564gDcS8TQeEAlEPxQh30jLCg7wLofUHbPCvc/Px8L2r/gxTKKn8g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SEYPR06MB5985.apcprd06.prod.outlook.com (2603:1096:101:de::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul 2023 09:33:40 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023 09:33:40 +0000 From: Yangtao Li To: Viresh Kumar , Sudeep Holla , "Rafael J. Wysocki" , Liviu Dudau , Lorenzo Pieralisi Cc: Yangtao Li , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/19] cpufreq: vexpress: Convert to platform remove callback returning void Date: Wed, 12 Jul 2023 17:33:07 +0800 Message-Id: <20230712093322.37322-4-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230712093322.37322-1-frank.li@vivo.com> References: <20230712093322.37322-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5985:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a9f5f7d-838d-4fd5-e39b-08db82bb1360 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WL71Abv15elZ7rOB1HiyIKWzdKUIQ0hT1Dlv47eHSvdhQ/2i8vYM1LR1W5Iab8VKzrVtvy95L3MazEwUOMa7ngp4pFlmzNwQVBh7GeGLtk0eZ060vILRaUFMFl7/Ru3YIXNyhRBdDUdhm/0apu7P0Dyt1GQ3KFlywcPvYLCbOpqYRvYVVeZA4wojdWzemGa3DudW3SfMHAsnsqSKl7HScHJ/7TkDmi14hDD0vVGFqHOWo/k+I7VpkegkT1bXGyccM7CSIa6Vmcmh7uz1M/S42mGNKhj5+POT17r+4sU5PiI1Dw/qG02fgh7VcmIHZbZ9q9D4TMLoc/rnYOsKrwx3MfA2Xb9EDMZR+/xYcd1FC27y4qYMhCNSAWgQM7eW3BVsF7gCGXdCntGQH9QxSAy0wdOGxqJs/SXvZ07KnfQvMChIPE3bIfjH8BmK4Ql89B6sC664mXXwXsgsAPUm+JfE+wbcgU5bsu2dLYf4pPkc/78CMs3onvDaLtOOfG6phDEpX+sUo18L3ESeACpnjQBu0pUUKKyCE9kgiz0wy0zkpqdbwqn3OTJ4Po1g7VCsJ40SWdMepF/kVjYCdJkh7XWdefe33WJoqsBj16qejkuWGRduZEUsUa7mWe91u7DdWJ+1 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(366004)(376002)(39860400002)(136003)(451199021)(186003)(2616005)(110136005)(54906003)(38350700002)(38100700002)(5660300002)(8936002)(52116002)(6666004)(6486002)(86362001)(8676002)(478600001)(316002)(41300700001)(2906002)(4326008)(66476007)(66556008)(66946007)(6506007)(83380400001)(26005)(1076003)(6512007)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?msISTeoFZlZyuy68YshwYVh3+pJ+?= =?utf-8?q?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GJq1NeawYk3KVEbTDoFZHGjWiny2OiaNxfsPM/gFflc2UjUyYk6pDBVEH84m0K?= =?utf-8?q?So7gAx52xfOhOv0a4Pvfd5jQl0P7TrWQg/kin4/fNoeGUWhLuU0m4NdKL8Qn0cOBd?= =?utf-8?q?y2hUJy331p4GOkIv7ITvvzz4h70emJXY93oIKYaihBP2iie/vNKqETnKBOZTYQFoV?= =?utf-8?q?02Tx2vw8RIeMQBMY8TQnoiunLgKCvGoKYVKi+mEjkg/5blu1AH6zGXezkhPsyr+FG?= =?utf-8?q?V0fJfxdxPSxFphORyQNKQXE/7IMlGWPDlpG5t2wHj6xbTC+ejsBZQvEiLYGgiuQNt?= =?utf-8?q?/iSFa5EGbih2QV1f84yG//yvcjx8iucOsqrHwKCHUPZ4hbxqmDJMyPO26ikVc4fVy?= =?utf-8?q?jjLbF3CrbCxGZsmdxXF6lcmK683UwOkZKy4UEktJ3NzXwkb3eH1xPbUZYBsjRClei?= =?utf-8?q?tjfvD7lvTCvo6LNcM8CuuPFLNgfNI09wCcQNvAz9xw+OITXUGIgrNRm171aD13ktn?= =?utf-8?q?UrYCNATTyCcm/xTtzKS8JBe8P26Dzu9J0cC4FypQtgowjqV5XcuV1Yejb3eSUlC1b?= =?utf-8?q?7ZJN87YExEJCYFoaGslzG4EDG2gEMya10vgFmEv02FERDDzubTZ2hWN5XObzVI6pv?= =?utf-8?q?98lsl8mWY3KR?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a9f5f7d-838d-4fd5-e39b-08db82bb1360 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 09:33:40.0136 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0KuF0DSw0+Ljcr5YsJdZLpGUfVO8+quGHITZCssUCZ0KdqIz+3PL45vEwFtE990v3gMx3xZbqNmiZKJOKWu5SQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5985 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 (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. Cc: Uwe Kleine-König Signed-off-by: Yangtao Li Reviewed-by: Sudeep Holla --- drivers/cpufreq/vexpress-spc-cpufreq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/vexpress-spc-cpufreq.c b/drivers/cpufreq/vexpress-spc-cpufreq.c index d295f405c4bb..cf33e01dfda6 100644 --- a/drivers/cpufreq/vexpress-spc-cpufreq.c +++ b/drivers/cpufreq/vexpress-spc-cpufreq.c @@ -552,7 +552,7 @@ static int ve_spc_cpufreq_probe(struct platform_device *pdev) return ret; } -static int ve_spc_cpufreq_remove(struct platform_device *pdev) +static void ve_spc_cpufreq_remove(struct platform_device *pdev) { bL_switcher_get_enabled(); __bLs_unregister_notifier(); @@ -560,7 +560,6 @@ static int ve_spc_cpufreq_remove(struct platform_device *pdev) bL_switcher_put_enabled(); pr_info("%s: Un-registered platform driver: %s\n", __func__, ve_spc_cpufreq_driver.name); - return 0; } static struct platform_driver ve_spc_cpufreq_platdrv = { @@ -568,7 +567,7 @@ static struct platform_driver ve_spc_cpufreq_platdrv = { .name = "vexpress-spc-cpufreq", }, .probe = ve_spc_cpufreq_probe, - .remove = ve_spc_cpufreq_remove, + .remove_new = ve_spc_cpufreq_remove, }; module_platform_driver(ve_spc_cpufreq_platdrv);