From patchwork Wed Jul 12 09:33:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13309933 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 630D9EB64D9 for ; Wed, 12 Jul 2023 09:34:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233266AbjGLJeN (ORCPT ); Wed, 12 Jul 2023 05:34:13 -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 ); 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 To: Markus Mayer , Broadcom internal kernel review list , "Rafael J. Wysocki" , Viresh Kumar , Florian Fainelli Cc: Yangtao Li , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , 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> 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?CnBdmGsfnBkcVo5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JBL8be7KSgZszXHMZRTErkOa9EpT+RgyuQ8pQa/TpfJ1XmEjeOQGyQ2TCWY+?= =?utf-8?q?tu2U4Ruc0lbeatSW+Xy4kohMoTUQD6zLEdws1kmYW1jmM4jDzAcEPWjZuLKQ5CZGR?= =?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 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: Florian Fainelli --- drivers/cpufreq/brcmstb-avs-cpufreq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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);