[09/19] cpufreq: brcmstb-avs-cpufreq: Convert to platform remove callback returning void
Message ID | 20230712093322.37322-9-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 c18csp1026970vqm; Wed, 12 Jul 2023 02:39:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlG3a4qA3ZIpB2fzfIpVwzrDlcxW42rkg9HVDzXwNoY6+rJXPl7g8pZ7Cgwu3ozUq/GHQxuu X-Received: by 2002:a05:6a00:c87:b0:666:ba76:eef5 with SMTP id a7-20020a056a000c8700b00666ba76eef5mr17841645pfv.8.1689154753215; Wed, 12 Jul 2023 02:39:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689154753; cv=pass; d=google.com; s=arc-20160816; b=oiDqtVTi+aPkw0apWn6ZztDPxjoW/8pDvI8bVYb3ztz0K0WPKIk+/NMnoSG71FJKq6 fAnRs0tkL4cJOXpeG1dE+1ajti6/SE+y5N0tmoliht3hbeHM5oDojxB1NUZ7aDYr7bjy Ql94UyyaTUKAsD9RIn22vQXOGnP0XovAaRpjxnMRqf6GkxWVOMOtXO4JDwNA2O2vp53D HVACaSysa/Np7QrVxoHy22BueiTBfQdPIhfKUv47pEeuOLttgACXmY94a6TjZYgXBizu BNvkCQBsy3Uyt4ZZvzt6S/66PHNuPgwm0uF33A6QPdgPvEF+VAMM9TggFtasSqGKJB54 4oIQ== 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=cD12YVZGlHFVmTXoPA/7PJvtGDdpXVHEHm/asZT4mm0=; fh=wYr1e90neP0BkTQQ165e1J1MYukgNFSj9GYxvrW/m3g=; b=AWXM/1koniWBC2E9q42IvqUaeyxwRG8LRFXVQXetlYhrdeh6z5qVZvnT+P0M94ZdQw hRSh7Ms7PxEMg8KQFpwUS42/uibLlu95HKttz81ef41TE+dmgAWvkWGjAw8KIVRGFU2/ JFFe97Fsgl5W3cQLP1DMVseDy8jeExGCTen2AKz1HCz8TfjQ1ErYIOK1emXsLj/aS6LA qTgaPnSe0ZLnSJCGiidQXMSdVEjKPGMHt64TLbXb7hhSFbknfb9TQAfbzztdWnDGGVGi vKFGsdkclSU+8a3auuWnpLUomjfnep65WWsH5mWdGYITwcl6oZMK9y4VQXB+OghTgfBF BSoA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=hlqnwzWi; 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 b7-20020a656687000000b0055bcb258715si2947911pgw.52.2023.07.12.02.38.59; Wed, 12 Jul 2023 02:39:13 -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=hlqnwzWi; 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 S233184AbjGLJe0 (ORCPT <rfc822;gnulinuxfreebsd@gmail.com> + 99 others); Wed, 12 Jul 2023 05:34:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233257AbjGLJd5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 12 Jul 2023 05:33:57 -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 E0B2D1739; Wed, 12 Jul 2023 02:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hFGleRb8uNlVyqMZ6BKA1zoYY4lsUeBH/JNXD0a4IuEvM9MDuXPoPYX+PRCqlS+vwhi6NyDGQzvMZM0AjlXaNOoIYN/uYY1kyzn2zg/nYRnIgyX4H7epais1PIqbakWo4hnSTA7c5FUwSuTE+9YMF1ertiilVhGR1MED9KZvVMxcWhXuXHDHG9EN2Recq1bwDYbaFAJOzXa2H3QzMPrBfO1MLDD/Bd/5yD9aeycIpRD8vCcnxN9r393oCaAvVkWHmWa/rwJA0D3sJiKfxeMGUgqp+NJ6kmqYPYL/ZB6zBNX9jltNsm3uAHk70bjaa/EQ2nL0pK8Q0DXtM1qulW/iWQ== 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=cD12YVZGlHFVmTXoPA/7PJvtGDdpXVHEHm/asZT4mm0=; b=DtEnilNo1avqbFxPuP/ec34eNo6sGNxn+7XKNjv/NFoWHA5p6lQ/TbzLkZZs5pojtVv+oed1L4MVyKqwsApxEQ1bujiPirTHqv5jTL9KM6nSaGLZaexL+HrQivrTvQZKEckTYRgu6POMsqMRV6Ygtk2+yXhAoGe7HO3nbmBzMW5PAGu4vGpr3+e1MbwfhddDiufntsqL8OK6FTBCvto4vLPl4bIx6C8Ekd3kUiqJC1Xl/wulm7VfO0KNgFDaMV246Eh9K6lejakPGYGPSisFbLhmoblaJsRouqV+u8m305xQFFbU17f4JqiIzCz78POoK86qXh0SGd7wwblNGzuhiA== 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=cD12YVZGlHFVmTXoPA/7PJvtGDdpXVHEHm/asZT4mm0=; b=hlqnwzWi0j7Y5Qj/IW98RGAjrTBo7eKBru/zz7vf662yT5Vcp65g3JRDYVuG9QDIVIEzsUzBf54cQsboF//rN9GNu3EcWaf8mG6gt5Qa+6rAxaEHuDf3X/INs7+7i1h5KbLy+EtJBn9P4626s7f40EvueVO+MkMzQhd2/Ird15ubTwXS9pXBvRNfGj1zrTaWWuIBTArinfh35E9yqMrKVnszi36EJx2gWMMobP/civtQDjDBYWsGZobq9YUuCh53t08VI7x6DV6ky5T7VGsjoXoEXRGNjyUsxGsMkM8BWSbj6ClKESl/Gcm8rb9emarwx6cee1bK0AvgBrDzBAk5jw== 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:49 +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:49 +0000 From: Yangtao Li <frank.li@vivo.com> To: Markus Mayer <mmayer@broadcom.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Viresh Kumar <viresh.kumar@linaro.org>, Florian Fainelli <florian.fainelli@broadcom.com> 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-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/19] cpufreq: brcmstb-avs-cpufreq: Convert to platform remove callback returning void Date: Wed, 12 Jul 2023 17:33:12 +0800 Message-Id: <20230712093322.37322-9-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: dddc010a-4a7d-44f0-093e-08db82bb1903 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IqmhE9j0prBPkrJr73HKHAE9JudXx7w9QPIcRq4r+E/ScDzaehyMHE3vd/rUGPJVODbRUMEXsE0FaJlpUQnJNsQ6b088wRz7RXHqcGAdLeoPplkAeSfZU9HqYTt+UfmmrBlT9Q42N61knssL0Klf1As4lQNeG1MYqbgPdvO3FlybWjDwuSFbOSG+UUsOpxXwibRYucLBph+xiStB+HFQBEBaIn88mtWNUJAG+WPeRbh6jnQOHutzQ5lyT4ZIsXyy7N+Bb9hKRBMWX4Fwk1il7yy3ZA3V/iSaoYowrzX/GudD1DlFYNmLfyH7WzzYHU1zhN04U2IhgFyyrt6B6ihWuVmtv56jdZsoDcE/K1tJ5okbdku8+7Jpn9NGtTLXqZ8cQgSb2hhY8qpIcIhxZCO+rT3d95jJjOngB3jilfaYT23fG2zWKzmxR+QeunN6Vyc74QiYgnm8v6OxgVf+n/SXHXn44idgoM8CFzTSUNWNiHON2ngZPhlfYMfveeMq30xoXtJ/WAA9N7cOL9tdc0hQVWB5HtuY62jDs8FzSj3jrMb9jylfaDMJBrJv/05qr67p4arGxQKPwAtqex1YBIvuGqahVytDwiEkKsOBWF2r2TcdfBclY0u9JpC8gz1t3Apl 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?5vtm6bFy8Lgdry/VRCmYtEVHUOvU?= =?utf-8?q?CnBdmGsfnBkcVo5z0ndYe/gUVXi+yMiWvVRvyZxkEM0SoKv5CF5y3Pb8XmqpGsydQ?= =?utf-8?q?RNdUJUhB4m4I64WjO94DtKWfTtRQMmyo3iR1cphs340lF521cIkW2Y2DQ3qGF8P4V?= =?utf-8?q?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ZGR?= =?utf-8?q?PXybgrMqsErA2s/idIvHQfOU3cNGQIBtaqlaJbuchbjT3mUHqfAqNxGcOmk5Jre8X?= =?utf-8?q?im16zA6dW8oHWROZVlOREN70LfWoRvqSaiUyYG6Sk5yOoe6NuiWZ4gS9bc/n/FAFk?= =?utf-8?q?OjQ72GfqGKPu8KjP1jDRcsGvOLWXNhQ8QVYAn/ILerJXJIKw0+er5Vla/yQSFOkHr?= =?utf-8?q?40pE/JnFSp9wPvYRYTnDgfj3tAuLinjsCpklA78kg8UZLMtyOJ3P0eB8UpSC493Li?= =?utf-8?q?ise/0LDF5kyme6c60m/E2akr1b5jtpzkYooNvEgHnaZaAOeHb4toD9w/9FmCwxVcP?= =?utf-8?q?+VbjRPi2B1I0256e2uZ+d4MMvMiwdOjiE0WU/u3cNZYHQSucPjhGForMeWknq5iPY?= =?utf-8?q?+ht6qwteAXeiHwdY2+D5WU45FsNRjdSuykLdpHN5o6dshL35MwUZCjrLyDPfriY46?= =?utf-8?q?dOVmVJiS04/roLImo6L1zINQUfdJUToLYB/z0fNikUuTKQvTLGzFDCQaKdYabX04V?= =?utf-8?q?H4DGo169mA15?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: dddc010a-4a7d-44f0-093e-08db82bb1903 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:49.4543 (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: r/IMmw7L285JUbyFiesPCPBj348BWrbuRxHDXd3/QLPRs0Uq6Zb7y27GJ23Y7e8sWwDfiX1YO1GF9aY9X5f5FQ== 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: 1771207134491247927 X-GMAIL-MSGID: 1771207134491247927 |
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/brcmstb-avs-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Comments
On 7/12/2023 11:33 AM, Yangtao Li 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> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c index ffea6402189d..1bdd513bcd19 100644 --- a/drivers/cpufreq/brcmstb-avs-cpufreq.c +++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c @@ -749,13 +749,11 @@ static int brcm_avs_cpufreq_probe(struct platform_device *pdev) return ret; } -static int brcm_avs_cpufreq_remove(struct platform_device *pdev) +static void brcm_avs_cpufreq_remove(struct platform_device *pdev) { cpufreq_unregister_driver(&brcm_avs_driver); brcm_avs_prepare_uninit(pdev); - - return 0; } static const struct of_device_id brcm_avs_cpufreq_match[] = { @@ -770,7 +768,7 @@ static struct platform_driver brcm_avs_cpufreq_platdrv = { .of_match_table = brcm_avs_cpufreq_match, }, .probe = brcm_avs_cpufreq_probe, - .remove = brcm_avs_cpufreq_remove, + .remove_new = brcm_avs_cpufreq_remove, }; module_platform_driver(brcm_avs_cpufreq_platdrv);