Message ID | 20230712093322.37322-17-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1034288vqm; Wed, 12 Jul 2023 02:58:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlFPrhNhsFlSTGzKr1yLWFWQ+5P+xbVg34x6Jjdfj3jp0ijYsaUDv1w4o8MyosSh40bWkvRR X-Received: by 2002:a05:6a21:33a0:b0:131:eb99:d518 with SMTP id yy32-20020a056a2133a000b00131eb99d518mr4913274pzb.41.1689155902749; Wed, 12 Jul 2023 02:58:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689155902; cv=pass; d=google.com; s=arc-20160816; b=CAyM1Eg6j/IbAv59hqGMetFBCcuVXeamfJSj2YfRJd4blpedhfcZwTe/My1bOhkaW2 DzbvDVVP+fTG+XLqjmMcB0uN43sd9f9nr57vF9NVbHm4iuOg1D0cG6BsnaGk94tibIBF /LeNBA90LvF77P2psPcLR1cgTK+9V4fzi86JI3ZLkH0qerdZOT2/5qGV2ygZn//JXxDu 1em9DdMVvizs9pqyux649oWljUeODEvT9WH/xxxc+SgiwCFoqCf53CXyMXmfpnXtsfPB 6sbqOBySrFsZ9f9Wyc3DgpNDfKzmLDSKZLb8HXxqKNgzJk/ocxQmKuO9GdKjyRqKxVfD CK8Q== 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=QCJxJqCS0KKYw026hjVugnxJVvGsQ/lL/AxNkg9+mC8=; fh=792QnPNe7B6CJvN2sfEQHjHNzAPA4mlp0TVXfBm6Avs=; b=fzTiU8T1DF6iIXEd3ZuSVRG+NWHjL9amvYK4GYnRHzhQs0EyLqhKWQdu6Jd7fQbnk4 rH2BoctcLd3enuYSgcdYJnW3Z6oMQluO6EWzKz9d78mnIzTsrCb4FOhg7uNV1cnx8KJU a7I4GqT8ovrz3qiNpVBBAFdCOi1lgu/iYPnIIboFwE4eX7UC+8cJEzPwoidu8ubgTooL WCFWp3yizk3tXK5hYBdKWSaYcBNiO+9hP7W+si+kQz3IngluucJKElpUHjrULGbtt7Ut Kh1ERuSXpTi2AM26UrZXAdMiEsGG65E53qg/7dUTkHf6jK5YSRYDuOYYLvCq9AUJ/Q3J gwHw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=nWmt8ubd; 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 c5-20020a6566c5000000b0053ef469281bsi2811201pgw.474.2023.07.12.02.58.09; Wed, 12 Jul 2023 02:58:22 -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=nWmt8ubd; 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 S232444AbjGLJgI (ORCPT <rfc822;gnulinuxfreebsd@gmail.com> + 99 others); Wed, 12 Jul 2023 05:36:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231977AbjGLJfh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 12 Jul 2023 05:35:37 -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 B961B1BDF; Wed, 12 Jul 2023 02:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KuT3hNmvNMFAbPANuN3fxUKMTSnRm6y+D6a+tbLPvTW7zv7179xx88rMqODdAwHl8XpT54W70W4Q0m1BaqtLRgHLvJPFzDkuXIChwJaueINqVMBIf6xCS9mc5E8/9L+v9FdmMx41EoHQCURZazBciYUhem7TzdaC5/gdmndBjUzRob7SLwIY2GtjteJvFg+s+WSdy1X7AGiun9bMmnutLdXDO/xe1kBHrXw6MZcLWlE92Zz9bicdLrxTmaxiDvlM85JE5TyinENqUn0djh8b2+EJlD6tLD8t3zAMwkQ580m+HgAbbNQKUCbwHEN7oFibl06lND3eJ7YdE60iBZTvSw== 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=QCJxJqCS0KKYw026hjVugnxJVvGsQ/lL/AxNkg9+mC8=; b=QuXUedM7NX/U0Uo55SAx/kuN7KzJTm6wvopEGo+nFjsK1kMkvElnxgdqBLwXhjA79XFhGJ0uT1VAfaiqXDuXC2Hhppq6HztaYuozMqRe54ESGkH/wA09W1t2SyZDx/Q0Pkg1W0Yp5W0m+eYTW4uMftb41NV8JOeMSoLjmHml438WfZWGwhP02JCyUcHzlhcqZRw8FfrZt7hk2r2ktwA0TcmBAUQhegmAAkI7mxur3pCCmH8VWO2EiqX78+w9W9r/h8bzc5cClxDA08pjFFge7g/1SDN89ZanMG3zgvAuZLmZSCyfrdvOUEEen/twJsAb2Gqsz8IP7QW/VN/ZJeFW/w== 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=QCJxJqCS0KKYw026hjVugnxJVvGsQ/lL/AxNkg9+mC8=; b=nWmt8ubdlOq/bkuoJZhYaVp7QtJIVRuBmJoqv865216Pnjj3ZFBAchCsOdNxr9hMc9viQ9m93HPbfSWb1T9N8aHjSfF69J4jQM6qaAd4AjS1PdsomIhgDxcvO7Xq4RYhx/d4W4Y++WbIXgo7JrYDVrcXxByQwkC1YLY3y8wCYb4A+1mA8+BpHdh5SFaBqHDUNxJw9vmlTWm0/R51WoSTjVVF/a9yYHtJSQiKwCETI52vD6At4o8wII6WglWoC8oHSBnYvGQP5BXNcbgi/nESlWmpLo/azZmG+bbpnuC4T1q8jNz0yEM4NcWIvqQMiMEj7eWa4oMUMbeBh+AkCl4sLA== 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:34:02 +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:34:02 +0000 From: Yangtao Li <frank.li@vivo.com> To: "Rafael J. Wysocki" <rafael@kernel.org>, Viresh Kumar <viresh.kumar@linaro.org> Cc: Yangtao Li <frank.li@vivo.com>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/19] cpufreq: acpi: Convert to platform remove callback returning void Date: Wed, 12 Jul 2023 17:33:20 +0800 Message-Id: <20230712093322.37322-17-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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: 9b5658ce-a5cb-4a0a-0c8a-08db82bb2105 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dmuGR+XlQ+vsaBwsl7o+pCda837dc9Zn7b/Nl5/McPX8ajaIGzzsiLmPrtc8AYfFE7RiOH/wF4iAJqQee+4b5kLQ9bLRo+ZpzcmCr+Ky49ShEA969X7uNI5zBBT6BI4ChrAmAArpw76PmeN/P+sDlHoqloOorxo01Yx8GmxXWN0o6+y2RFAehXtaAxUDMN1Y6/cHU4SRiWJAqp4VBY2C3Jv2SMrSK6CiWD3ICEwMpey5IJ2oDMGK/LErNE+UQRQAIzA0AXZCedOzyivjuQ5zsAeLw+axDJbrXBNxdYsK66pqcw/4x8ffyLff9KlFGxDcbzaNkCMuKFMmd5zaKqkMHCXxcmXJcZRu/Na6Pai8ufB/tT4FP4Kzvo795lEYGjAPzTRf5sSrl0UtrRcy0qxTyeQ4zq6n3u95wG23BqKF/PHGLXpPPLg7TC813pRqNMWcKW3y9jbIT3sXkjhsaW7HV9mgHiCgGi/LtZaFevuPVCkS1lfk2hIKSnfljnLWCI81knYFpDWD+MlE25jvlNJXrqqI+KajzyiOxjb3EeeMCA7ddhXuszhNvuzn9UQpx0vs3HfS6BESoMSOVLHsqTMphtBNX3kmfpa9slXR4ubZBcS4g31m5lZMcjzv1y/FjdN6 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?MlYlOaDu8uznIfrael+/dIOwbkjV?= =?utf-8?q?IFczY5qF824Aph0tWaz7diSMjW7SpT9C37wkCp2pJNIJh61JsZkMiTtqac4YEpndJ?= =?utf-8?q?ypy5SpgUe1H6URuYlsHg1EsJDjOKaGQ6r1i1NYk5/62uETiM0elHbslYJ0wSy+Q2u?= =?utf-8?q?sdTqjqx/ZsQeRp7Ua1NTEgB/BGeWxE9pKFTZQ+cRtJcJVmvKorlzd+wgwCuRr5SgP?= =?utf-8?q?0Ng8nCKBDVF8jFT4Z/0GCbB7Kskr6zJQKZwnTi41bRk3TV/PUeapgbfP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PaHX1xzY4FJ8zcycnFmeznIrQVPwlA1?= =?utf-8?q?36Fx5voN8iQrQeeLKk3HvNt8h+hfsMQfYjX4SZu83VMQEvWlhSZV8AWDjJnE6HKRV?= =?utf-8?q?BWsNYg0HpzREdoxLTnnMJusSsoAN6EkFUJKLkXPjYez7P0cr1eLmN+5a+ydsiLItM?= =?utf-8?q?enpglK8I6nmE2/TSCBle/7dHPGNLuT1+BfMedGyZ213qJ9EUm7oQWKY9j57jOQcsV?= =?utf-8?q?C9lGylYu1EnXUJa9o9NXHUyrF46kGDrGoZE7Zim2qiCT2G5mMJqJ4dWEnmCo1Sijd?= =?utf-8?q?ShLoAhZmS2n0cD8YajQF883qJigKUE8ccrSaT0qRh0IuVLbP5HH0+iq68a2BjgBR6?= =?utf-8?q?OJKzOY1YYWti62vIlbfI2CfP5OVMioN6aCXZScQhUqgmxVK51pcqLK9E2r4pMzwb/?= =?utf-8?q?eyCGojl7H/PY?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b5658ce-a5cb-4a0a-0c8a-08db82bb2105 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:34:02.8930 (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: +O5tqYl8IcGf3O37n5vRGESFvwe51tI8SSV4x8FPQY5RpXgpXtC9wPHxoLHT5dveyyF7Rw6JilYlA+Tfd1p2xA== 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771208339595990345 X-GMAIL-MSGID: 1771208339595990345 |
Series |
[01/19] cpufreq: sun50i: Convert to platform remove callback returning void
|
|
Commit Message
李扬韬
July 12, 2023, 9:33 a.m. UTC
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 <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/cpufreq/acpi-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Comments
On Wed, Jul 12, 2023 at 11:34 AM Yangtao Li <frank.li@vivo.com> wrote: > > 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 <u.kleine-koenig@pengutronix.de> > Signed-off-by: Yangtao Li <frank.li@vivo.com> Acked-by: Rafael J. Wysocki <rafael@kernel.org> or please let me know if you want me to pick this up. Thanks! > --- > drivers/cpufreq/acpi-cpufreq.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c > index b2f05d27167e..37f1cdf46d29 100644 > --- a/drivers/cpufreq/acpi-cpufreq.c > +++ b/drivers/cpufreq/acpi-cpufreq.c > @@ -1011,22 +1011,20 @@ static int __init acpi_cpufreq_probe(struct platform_device *pdev) > return ret; > } > > -static int acpi_cpufreq_remove(struct platform_device *pdev) > +static void acpi_cpufreq_remove(struct platform_device *pdev) > { > pr_debug("%s\n", __func__); > > cpufreq_unregister_driver(&acpi_cpufreq_driver); > > free_acpi_perf_data(); > - > - return 0; > } > > static struct platform_driver acpi_cpufreq_platdrv = { > .driver = { > .name = "acpi-cpufreq", > }, > - .remove = acpi_cpufreq_remove, > + .remove_new = acpi_cpufreq_remove, > }; > > static int __init acpi_cpufreq_init(void) > -- > 2.39.0 >
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index b2f05d27167e..37f1cdf46d29 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -1011,22 +1011,20 @@ static int __init acpi_cpufreq_probe(struct platform_device *pdev) return ret; } -static int acpi_cpufreq_remove(struct platform_device *pdev) +static void acpi_cpufreq_remove(struct platform_device *pdev) { pr_debug("%s\n", __func__); cpufreq_unregister_driver(&acpi_cpufreq_driver); free_acpi_perf_data(); - - return 0; } static struct platform_driver acpi_cpufreq_platdrv = { .driver = { .name = "acpi-cpufreq", }, - .remove = acpi_cpufreq_remove, + .remove_new = acpi_cpufreq_remove, }; static int __init acpi_cpufreq_init(void)