From patchwork Wed Jul 12 09:33:13 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: 702130 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 5F27FC001B0 for ; Wed, 12 Jul 2023 09:34:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233232AbjGLJe1 (ORCPT ); Wed, 12 Jul 2023 05:34:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233272AbjGLJd7 (ORCPT ); Wed, 12 Jul 2023 05:33:59 -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 A9AD119A0; Wed, 12 Jul 2023 02:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GcvMKRIXzEVZwyH6FN2emI5iSmvNsQ8DztwmSaKDwwkcEX9X5GLOieRPMH9CqmffaTBVYjGCxsuZBVYGKXrU+kTJRuSN5cBU+QsmiILj9UsTPDcvsRYrZ5Fn0PGDYxGQE2eaJHScc72dvi+qHXNyLjBSVqJbEPIWnriB70QvDIdlizYubeGKIGTIMMPhyDbShNBTAGodfrAzgAmFyT1/BDJfB6/R+HIPjt0Yw/F990deAEuEwr72jDVsXzDqNGGmmI2V6KQcFfaF2bsrTznxWp7Hv1Z1tM9gU7acQdFudRCcYPvlaT7fOlLQzHBVYkBqZxHrZz0n4jPGxxpB2vN4AQ== 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=C+IWyyTdI+3JNaPeR5z5dkNulc/M/Z1sGW+d58kuBYw=; b=O9guvuIeHI4wtCwYLdyxx/6OKb4aio3nHjMnGx1SavJA4Vsxz/oJGDe1ZCviskwxnZQV0DjD/nUA3ioiRYUeZ2P563iUgl8ORKLwT56Rf6tfJPkQh9TTZQAt7bhylylhatnkhd9JCH+XqvlrVIS7NwdEno/FjU4fLe4fAiymxQBjXI3SN/QQTV/fqMc2LHZdv5vDShwL22razErN0VM9dMNHJV9UihygkqgdJCP38x/pREiEDjC9w6H6t9bwhHuBsbegzW/jfiFM3+m+1yUKO1YIkdIrFMsxZu6XG0U8wQ+ngHU+EWXjGgv6IqFi9fkSW0bG6Htl/oXDRZOMGQZChQ== 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=C+IWyyTdI+3JNaPeR5z5dkNulc/M/Z1sGW+d58kuBYw=; b=oqhemZW5WRABsTPJ07ApY2jS8FE0ih5yT1huvWTOElYWTKANHEPsNpEIskbBDK7zNAbmeU+sA3QXJnRYSI3aLSyncdJn80YE2msL5Dqis40ai8nNfH/9WuHKZNI730SEcWm/evt0+63WJW9DJ4dwMoyxF5ld5mVyr8QLWTc18BX1SCW4w0+uwxY2HcWyCOBL24GOCc5HrYgbtA8k8UCGdzkNgwfIw8LmssICvbrF/5aQMO13zI0LmzSgSAo+Y0teM4YjQnMk00C1vU2gno3xqWo1pFKG8HYl058xsacitHb9f/VwM0wmRh/SnzCnFk1FzyehVk4NUqOQtn4nDPZSGA== 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:51 +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:51 +0000 From: Yangtao Li To: "Rafael J. Wysocki" , Viresh Kumar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team 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 10/19] cpufreq: imx-cpufreq-dt: Convert to platform remove callback returning void Date: Wed, 12 Jul 2023 17:33:13 +0800 Message-Id: <20230712093322.37322-10-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: 6bbb9c65-1ff5-4573-12a9-08db82bb1a40 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MpceXVcx25I1doBJ175W1Bvvqa6tUhZ1Z3FIuP5D5zcWw0SCo/qGGAAaX9lw0qunVtUjYb4BwuqNTjXpe24jGsmtuyufrxnXb/IKkSrdFhl78zryvonBOWNOkbJKrsJwLmTArylrSOHonh9POCH033WsZg5XsfI6KGTxPdKRtJifCPHtdkX4AqVeWwU7GiIp4ZyZkBNMDr9WxG/T5r5LYuM20uR0LeItmIdIqIjK4ClFx7RAvQZsC3eJNKvdw1GbQGDQZw9U1HFM86BoVSS/EmQ0jJ26ztcyv90knU/8u1g3Q7Y5hEM4aK0aabcjjC9wfMZd2pWCPPPt0Hsf3zKgkh+kiCmdDorrk9y7xR3sorR49QXiGzWX25rKWCxBQu4dYFBYOa+CsME2oNpi9wgu8UsV35eaTTBo4ubMesd1DZKE23u264n8NkgJtJWQhfdVKGWBGTodd6PzAqeMfagZ2UGPCf0HV9Y10AavB5WBr8RtTavH0qRjIN3Pld57Lb0RUQAya7fZP3iZIFpQ0z2XYaoemj7ypovqkvYWWnVgLR9ZxUEg8/zDCV9bPHvtQUmmrRftpaKb3hLp+E96yzHmCAZbskihID90+RiBA06eEnmG6srSj0klj6VinLauvID4 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?9sSZ46VyUGCjeRUx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g52+?= =?utf-8?q?El/ilOBJTXSPVqE8tebYMcHTJTwwOWgudtqiqe3ITiFc5f8I4Q3hkVtpgJpi4xOBT?= =?utf-8?q?75Y9dteqQmJfanjXoWLSdACXm1nGy8Y3iU96r7JrqlZpmSz9luYTgoQSoriUBfqd4?= =?utf-8?q?wx2M9vabA0PHc9ISJRmwFNXfTGDtGCySm3XRkMiHOchcffi6GNFm94QYWMCTQ4G+m?= =?utf-8?q?PI5LmYdGhESIFcb1fBoVQyeoECf5IK+3uA8JmC8ipYakdbHIlIyR4lb0X2noG6kxL?= =?utf-8?q?I4BV/HBImYK162NfTgzt3hKcKW+ROTSHxOume2mX0ExHpo5S11cESCpYWy6HHsVzp?= =?utf-8?q?18ZT0C66TDJldQcnt8IslPAmIbaEZ8JhqJTjOSSyFsBw04XFMx2jThizhsWqrQZhW?= =?utf-8?q?CocRIZPM2HxyXN/PrFhG7CbJR4ymSVRRguoremh3ICahNpCy4Krcbx6JxbuNCefjj?= =?utf-8?q?PWjGCPWzhWgDyK2baKJV9+SZc8e2t9Y3bAlrDF1OJcDLME5g6rlv4cJdK3OX7921l?= =?utf-8?q?sgKXUGFOLNu3jYafcBlePv/Oz4bSmtVB/ZG2zisTSCUns8wSnCezvPYdvVWZ5vSJ0?= =?utf-8?q?HTx025ecCfJFASa9WRjPGgUl7SgxZPQFMNlhJZgNP4ZJVyxGjzbBCQcpr5AYu+VXm?= =?utf-8?q?0YnLS/rVLcIx?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bbb9c65-1ff5-4573-12a9-08db82bb1a40 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:51.5357 (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: XmqQVDvEVxDYXAeXN6hLs7bMbwBQB9NpDChTM9uiTELkaZS8HVq8sPesvTz4VIcQRLJz9l918fFXmNgEcoR3TA== 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/imx-cpufreq-dt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c index 535867a7dfdd..577bb9e2f112 100644 --- a/drivers/cpufreq/imx-cpufreq-dt.c +++ b/drivers/cpufreq/imx-cpufreq-dt.c @@ -172,20 +172,18 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev) return 0; } -static int imx_cpufreq_dt_remove(struct platform_device *pdev) +static void imx_cpufreq_dt_remove(struct platform_device *pdev) { platform_device_unregister(cpufreq_dt_pdev); if (!of_machine_is_compatible("fsl,imx7ulp")) dev_pm_opp_put_supported_hw(cpufreq_opp_token); else clk_bulk_put(ARRAY_SIZE(imx7ulp_clks), imx7ulp_clks); - - return 0; } static struct platform_driver imx_cpufreq_dt_driver = { .probe = imx_cpufreq_dt_probe, - .remove = imx_cpufreq_dt_remove, + .remove_new = imx_cpufreq_dt_remove, .driver = { .name = "imx-cpufreq-dt", },