From patchwork Wed Jul 12 09:33:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 119038 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1034572vqm; Wed, 12 Jul 2023 02:59:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlEOC4E4e+RPJyoCT+Kly0f0J54QbtzZruqGLM2HCAGUWE1i4jYo28kDUwIP3Ecl0XDS9X7R X-Received: by 2002:a05:6a20:3d20:b0:12d:1fba:faca with SMTP id y32-20020a056a203d2000b0012d1fbafacamr23004219pzi.28.1689155944339; Wed, 12 Jul 2023 02:59:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689155944; cv=pass; d=google.com; s=arc-20160816; b=YgPK2DhCFocWKGQYS1FPBmKliNj767qpfKY345o+4kwAb4zHBm5ScvxST5xdDJu9rT arKHunLqQNlf0KFv5eKru2Pm1GMYZMVPEngdqa2gAsZoX4RfIhGckkB6VHBasM44RlRw wVgxYUGLK5dORCYmTnjx2lsGJqrQhkJ0AWcEnI4OjZ9pymHXvU3yrbd3kSQaEb3PoH0r jmVOy+wc82oTKWxwbcXl4KNgl3jMG0le8J3DlPiroTOoav/gCTn2QBP9FlwolJXxfjvh pAijlZBiXxGSM0w2ZRMPNk0F9/DBs+8hiIB9yFd0bjFJ7g7OzRRF8G5f1AO/5O28frEF +YBg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RHAWR+GUpAJDQGPWQJfK9K89QVrh/eBdAeEeYad/c7Y=; fh=792QnPNe7B6CJvN2sfEQHjHNzAPA4mlp0TVXfBm6Avs=; b=DN4cvbsKcqise2GkuNCqJXh6NYzVuHfP/LLS2TkJjwBohzt4vOsI+dnrXvvNDCFLgW CTPuBMQoX0U/noS5IO4QMpBrjlXMYHEk7vqhjKARqcXNISmxsbhAQ2RRQ3jmJD1WG3nV jhqOIAA7p6LBfY3tLPq8LR1T2xj6gRsSCcHIOYY6sTMvlzkVE5OCKGu367CpoCmX9iZK +BXCFi3QwCjg57sP8oXnKUyDnyUB9ZfQe5ZqRfr01vWlnnDsYVhy7EWV/+xh6pbGBS6F UPd68PkoRdthFiRzQJE8neOU7FvvlgtHXH9T02d6Hc1U8yPTO6nh3y9sHMcqO4sLi1E6 Qa8A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=fuhtAMRd; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x9-20020a170902a38900b001ac4f733007si2983977pla.549.2023.07.12.02.58.51; Wed, 12 Jul 2023 02:59:04 -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; dkim=pass header.i=@vivo.com header.s=selector2 header.b=fuhtAMRd; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233298AbjGLJfG (ORCPT + 99 others); Wed, 12 Jul 2023 05:35:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233320AbjGLJer (ORCPT ); Wed, 12 Jul 2023 05:34:47 -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 E812F1FF1; Wed, 12 Jul 2023 02:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZrZtV5E1qzrcitTZlF1uV9nbHzJ1wI1tLMhO7qAiZmwEJS2iyG2zt4wcBfGFfl/xHwRCGAb6lSaSXNpgjKA1os4HYI5G5E4V/YVB8iuUvt4rjbiFnw8fNOuWBYhqjfGpe/Gou7GsP3OFYd4fPfq4kXE5Cw01FRU5nfDWspLijbejzWxd7+xl/EG85E7v99GvYYMbLlmgGDsQglKhHaAV4AoeKbgr8B/R2gapD63wRoUmqpuRPBx5+obzb0Sq7EgxifssgBfKZE6SR9s+4B9GJzXaG9JshNbYofYqtl5I8KXqgwD+5C31lv1cFexoA5I+fwNa4YkTiBdK68adjqH1Dg== 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=RHAWR+GUpAJDQGPWQJfK9K89QVrh/eBdAeEeYad/c7Y=; b=UNOcyUNh7al7h5BKwLklCKDiq1naW3AusdKjIGqCFCOnqm6cowMW3cv+HLi2GfbW+LFX2Rh9Nlq68KZoCykVbjEwwVdxhrZUUYMuRQ6mkyn90sFAJTduMxZ7z750/Xcb2N99CfZhYwcgmotU2ajLCxJ293RTVF8+ITlPYbuRVE2O5ywHW29v4K4X9Rqekt0bBWkIr3TRM2/w18HwdLOxaAJ8y9hBHgwSOsCselwRKUWWhh6pYWhg9BbNUkHSyf7sMOUhddAhQDpiw7goG/EMjKP6X3YKynjZxeYKYLlCfBNIfdHfH7KldlqoMIsCcMNOgcjTfmjSgQW4TNKUTXOBRw== 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=RHAWR+GUpAJDQGPWQJfK9K89QVrh/eBdAeEeYad/c7Y=; b=fuhtAMRdxhKYbWda7dyC3eRgOAjCpPLjmtkCx7+aIf12YBZxr1CUyJwuLOYQpMG8aCZ5eJh7ngBFGyw6EmxmrBs7oM+9c6DOJrJCFiYgfUQFhtrHKEXTZavmRJlTkTE1gZI5kXuMNVcqCeiYequC7ibCPj5g74Y65kmuJWlzZi5diQDlLgT0RBnnsgFd9f2a1o5+FVskjB59BIBlxIw2g+Frg53DdRlZN3UbKNkA4mLiPQzig9/9rWm3G/XLb3hsEpvJOzlW/uyKWnELWNIOalNE8Pqos7l9XCaRnvebHLqT+3Th5qWJCYlwegu5hJT+0kAQ5CoytmESU2HjzU/GcA== 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:56 +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:56 +0000 From: Yangtao Li To: "Rafael J. Wysocki" , Viresh Kumar Cc: Yangtao Li , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/19] cpufreq: pcc-cpufreq: Convert to platform remove callback returning void Date: Wed, 12 Jul 2023 17:33:16 +0800 Message-Id: <20230712093322.37322-13-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: 292f889f-7359-4be9-1cd5-08db82bb1d17 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K8iv0pXMx0d5b+vHXEv+cPGeqh6X9+mafmNcTOSJV4JNWUZO0JhpPnCl0c3x727R8K1+tAzW1pQztKv+tzOKstS8Jts6+DaBhL+o3QMxj9+QxsgszXAWq2RD8psNoSefXRgZqpzYh/3cWgnaqeO/9HH2QpI7u0Pd+35Yc+zCQerArsRuTdM/+NPyDLlIB5D+kF3ysn6H8/D1rd5giddC61KmR4CoriVwUDQHfd3zkJyPFTcc7IJpm76HkLIkqkCGa93WqRFZq13HlG6+gOo8ozAqSjz2RGjRLHppJVuIYNk9FfMfuUu8vlec/8uwc3Ri/YOt3eBvcxLF0hCZWCuWIUi++ji3NIZd/hbHKlSAfKm1qUkZ88K8KdkqGFbiEtkEiZaYInRjDYvnc4vYDGwKn3HI7dZlAAvqMSwvznH81M5ZHmmoCgVDzq1FZ+vNSyqg48fSgwb61F/U8WfsXMdfxHpEC4dXzakS6JucOTsYhxEcpkhNE9drD4NyfoGVryHtgbptTNwN5NiuPrxwztyD24zJ+tMFtjNL1rAEey2nxk3+HJjHAIihpPpRdryJLrOk+5W7+zV9ExUX1dfVcwXHuoe+11y2s8X5n5htNBk29U/lfdVLxSELmWD3szeHjeka 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?v38ZYQU7zZf06L2tHaxX6plTS1Ik?= =?utf-8?q?FGF1uRnTugNdOACfH48NI5CmgbUD9WECn347jA24qAavmVPzB7Ios13JKxlDxDjKb?= =?utf-8?q?JkDs2b3fXqKkLNRhFo2Zo5kMBPEqviX9Wow2y0sH8au2h5hLqxnXY2Uv5sXPm8d86?= =?utf-8?q?Yf8N+hAD+xGMxbakrTex6xtMRj7C2xzdhFchn5oyl20VkzrRRwCvG1YXQBnad0s7/?= =?utf-8?q?oz4PgTaio7hJPqP2qI0oSzcFar9o1eXNZcLpcfDdgw5f/R3O+R6590euwPetyHQOT?= =?utf-8?q?BsdyIqSn4myCNbPpdFxLzkc405idsikhTIehRnTAY6jfZ1/i3dalPtZgeUZmB3uxM?= =?utf-8?q?KGJUSsWbLWYm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fIlpx04HC7r2xYRSb7M/i3pQrAbKEOaqrZwO162+xbtnDNRFNw5s/7E+I?= =?utf-8?q?4HKBDdoOYEFOxRJJkxzNqIfR4mXwIOKiPQTDZzISUGYs7Rdzms8SbHvGQTYNnQHN5?= =?utf-8?q?k0cKwANuRjAdBw7hICPZnWq8sQb8DEgjFk5griyaboMWjvvPe5z3Ak0NTIJeHREfG?= =?utf-8?q?S2L08ikxkX0dys1MChwJPJPltrP5/DiY90mIbvoprUO8Zxd8mT8HOWPaPXujvxydb?= =?utf-8?q?IiYe1eWtVaQKIBk/Z2cYvarV5a2x7HIvsUJQ/Okv7RvTVSZQdjsZXB/jm4uMt50pp?= =?utf-8?q?FeQwWTFBDBEk?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 292f889f-7359-4be9-1cd5-08db82bb1d17 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:56.2940 (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: PTOnohbT5o1lO43d4NLr7IANcKW2NHPDA1r0RgJ899uTOkYT9Qlq5LCaTl2attdeXXpWRb+F4P6NBpwMm2Nqgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5985 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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: INBOX X-GMAIL-THRID: 1771208383279342370 X-GMAIL-MSGID: 1771208383279342370 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 Acked-by: Rafael J. Wysocki --- drivers/cpufreq/pcc-cpufreq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c index 73efbcf5513b..84fe37def0f1 100644 --- a/drivers/cpufreq/pcc-cpufreq.c +++ b/drivers/cpufreq/pcc-cpufreq.c @@ -608,22 +608,20 @@ static int __init pcc_cpufreq_probe(struct platform_device *pdev) return ret; } -static int pcc_cpufreq_remove(struct platform_device *pdev) +static void pcc_cpufreq_remove(struct platform_device *pdev) { cpufreq_unregister_driver(&pcc_cpufreq_driver); pcc_clear_mapping(); free_percpu(pcc_cpu_info); - - return 0; } static struct platform_driver pcc_cpufreq_platdrv = { .driver = { .name = "pcc-cpufreq", }, - .remove = pcc_cpufreq_remove, + .remove_new = pcc_cpufreq_remove, }; static int __init pcc_cpufreq_init(void)