From patchwork Wed Jul 12 09:33:18 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: 702127 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 B4C0AC001DD for ; Wed, 12 Jul 2023 09:35:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233289AbjGLJf1 (ORCPT ); Wed, 12 Jul 2023 05:35:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231680AbjGLJfA (ORCPT ); Wed, 12 Jul 2023 05:35:00 -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 6536519A6; Wed, 12 Jul 2023 02:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wb65ea1KTwoMX3H4i8iVbWg+vYotOuCCht7horqQdUooxMO80iKE/UXkvhCyeGnOXInb9sDKjdRN+RjIvTexP2R8Wt/yAUaeZ0tHREYpjfSnS8ifDCIe6+C03VSAUbFnVoaZ+9HALk4ctuxc9WQdFwSuOxxEGakiTfZcTTuNCpq+i9sk+5OZgEWDX4Ft8sTZyFd0dVAUF6rnYq9cJaLI9v7BtyEfji1PbJvK6iiHo/TuxyNzHU04/oxYoMekKSR+aszN5NF/Bdm5cGPIR+NpIPPwBk4IEdtAs9WQgt/rW9zULT5gy2HPeC7EFIukvZL+chZSc+fUUs6v+QRj01DUDw== 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=RDgqDKXKbMkmxHcyQAqoj0mOTiq+h3nRHhuzdeQGeGA=; b=OZskxIc1HZW6+smpZy7FV94cBrtqSClNoLDcQ+7Drze7vG9owQ2I5f6PAt0VLnQGYzFK1J4p3lb9LqTnOpB+KSMLFFes6lG8gxIRxQ9WjAKsmQcxMM4fXT2y7mBA3mEeN4YcJk7rMWLRu+aS4EkY2tgScyUjkj+IGijwoOIGjhSIqy7DdURLCA+NcQMGnDj5Uz7cpFULfsndlF3nEWxrIegfEVrd4Vvyp9VFyeakwAHrnYPXZUobJS1ZrcDJ6nyzv/AywzcDCS2rPL2NqH8ahJRf81VaGiP+dLM2x6Xv6Bzq9LzSD+FpQdDOvpxoQUsZf4QzdVgEg7SwtUAEOZONXQ== 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=RDgqDKXKbMkmxHcyQAqoj0mOTiq+h3nRHhuzdeQGeGA=; b=bYuwmQO0Xx34r7blFkOQb1BI+4l4JlYfCbDSYRio2SYlUatJoEmRabXhWBRgDiakTxKcEnVOlyi9zw85YMNMoWirzPTGj1WnX6DSK1zpOEKVVKKag9kMo0uyOrD0BLFO6YJ4THRVuPX0qERjyaS2QqUllMqgtwAJqPmVvn4CeB6K5CrwXPmN3S7u/FuuQ84pnanu3qqFUEzypO5+Wmoxb9K+cC/ykLRjTefUy+KVMS2T+O9WLT37v+wc2i3C8ex1Vqku+mScIU+NuD1RyJIs9HXcq3RZgOjgslsHgL80OE/BFD4mAsvjXR7VM0hKOFoEu49k94vfmNbOK6RdfJYDPQ== 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:59 +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:59 +0000 From: Yangtao Li To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Ilia Lin , "Rafael J. Wysocki" , Viresh Kumar Cc: Yangtao Li , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/19] cpufreq: qcom-nvmem: Convert to platform remove callback returning void Date: Wed, 12 Jul 2023 17:33:18 +0800 Message-Id: <20230712093322.37322-15-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: 6954258d-ec96-455a-621c-08db82bb1f1c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bEI8OyR4aDPoY9zQloH5nnCqdqhWZc8B+NO+BVVtHPQ4/YrjG0hE7RQPUIBXrFMhW3fISdaVzsa2nxFqJ7Pku85eUASQsXf1kYgbT+giLln8xJQ+2nsXi/KZPSMuGnEPcz2Kit1CsWbASAOO626ENdvN+wVTDAwAyvoK6EB9Lpy05mftPbAZVlFvKOSYAIPjVjTLVriUDWA0Sv1KAQ8CEQFNFgeWzQeuethDm0Be381ZrE2PBj0ct7GoAjAOo2es4JbWw5MjCVv/qRnPelfUyxO9uVAxbIa9L4uQYBKD3UqqMwAeqRBRgGJmCYEKRS3I/8KNl9B3vzNAEInJYZ5td4gXRVz1BxVkfOXl4mv6nY+Q8pYwQKbaTSqMUxUMSSoO5u4nA9AMeOuX4HSKLG81YgKbN2gj3oIQC/45png/Fe+jfnbhizmGw2Bu/e5EwsK0mpoY01jCZbSi1oVeJxlJ/gIeNZDPmUeHeyY1V6Xdiq3VkOugoxEQFJMtNSSli0LWC072EbN00OjLTynAsnB43F+wVp1lLWnSHbWw9gjD6h5v95WpLdWrLr1Gn1YTrEQ6H2xbCjqK3Dwmle6TbqrYTpM2si4xwMGQeC6ozDFlFFFi1GX46r7eNlCBVCoPVufr 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)(7416002)(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?5gsG5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WLhCe5dc9LA8EulwHUW3vuCWlmuF9Kj?= =?utf-8?q?1WgnuxGCzMgLDicVVHbZ0NMr7/YVJu2inY5RxZzXVA73DXuN6hTaGWvJWX3fQMb2y?= =?utf-8?q?L4D7Dk1GtEXu3NA348p4A6v89EUi5TLMoaR3WzRSu+PglyhWJTADceQwMjnvvBxAv?= =?utf-8?q?SVhnviupAXd9kr5Xf+1zQyc8B1u4AwZ0f01w7PVTcPcKzdGWZPaAxzLFYcprXeLIK?= =?utf-8?q?qfX2HeQO87hHMiOl9iVxwEt2Ke8p51jEJEPQcRMVvanTtD0sJPdrNtPi5Tr9N8kp2?= =?utf-8?q?tm5hSdoVKF3OssaHY8SCxP3ES4DATtgPGHBh912vxQYT3PhPO99dSm0VmZf5FfV6C?= =?utf-8?q?HOBTLNwLEotA7Zu5XMqcEtpL4hY1iTxcbdY2qw7XivrwI7Ea7Eh7Ioi2UY02vUBTf?= =?utf-8?q?LMueCZc9vgB895yzmG/FWd8ddYEL4ccIxgVNuotBBswrsrgcvFyOANXmLk8oVeKn2?= =?utf-8?q?DrMov1KYEHhkrUKUm+3ItSrJPd3XgQcKEbnZpYf2oW6FZEoN1nxUImT0ODXdlTOdf?= =?utf-8?q?pIKCzVi7WfuW1ZTl13xovL4ss84RHu2O5Ai3jWt2qJUDbzNKE7TRHMWdbX97hmXvh?= =?utf-8?q?WfJmqDhwMeJPJFgrNtt7w35ehRzH1uVfjnt0amRrAu6Lun+nR9fI5ja5vAkeb++kX?= =?utf-8?q?mCqbQtPbqoNr?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6954258d-ec96-455a-621c-08db82bb1f1c 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:59.7020 (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: W4/eyHKF1JYR5D+1fi+Q7nCtcAL7nNx2dY3GNG7sw4ZHTopTuuo+ujUZEonG7WqROXjax1VwNNB8mHGc6s4R/Q== 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 --- drivers/cpufreq/qcom-cpufreq-nvmem.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index a88b6fe5db50..3db58d5957b9 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -334,7 +334,7 @@ static int qcom_cpufreq_probe(struct platform_device *pdev) return ret; } -static int qcom_cpufreq_remove(struct platform_device *pdev) +static void qcom_cpufreq_remove(struct platform_device *pdev) { struct qcom_cpufreq_drv *drv = platform_get_drvdata(pdev); unsigned int cpu; @@ -346,13 +346,11 @@ static int qcom_cpufreq_remove(struct platform_device *pdev) kfree(drv->opp_tokens); kfree(drv); - - return 0; } static struct platform_driver qcom_cpufreq_driver = { .probe = qcom_cpufreq_probe, - .remove = qcom_cpufreq_remove, + .remove_new = qcom_cpufreq_remove, .driver = { .name = "qcom-cpufreq-nvmem", },