From patchwork Wed Jul 12 08:12:49 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: 702139 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 370D0EB64D9 for ; Wed, 12 Jul 2023 08:17:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232330AbjGLIR3 (ORCPT ); Wed, 12 Jul 2023 04:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231179AbjGLIQk (ORCPT ); Wed, 12 Jul 2023 04:16:40 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2137.outbound.protection.outlook.com [40.107.215.137]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49C801FC3; Wed, 12 Jul 2023 01:15:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GYhzeHDpQbEq190LouZNXvuHMvlW1J2Yur4UwpQP1+fr8x2By4ya1kwIlkmhyqrWNF2Ia/sMHawgzQ8ryJCREk+R47ZSmHON2nLdC44wq4b19h9PqEn5WFp0pN+NcfBXOZPoPjA85QsbXUroQ0mvNhUfOMDYCYwo+0nVoUM7jel0rj01K2cAP8j70GFIF2bM4lRJlXyDSy6rbKycYvZgW877MBdgNZ3sOeEZe1w8AN0MnBh5w18MQwDhqFv4ldGh5t3MFjOHlxeTY5sntrIZ3ZY1gGQmD4d21cK7s3dZ6Pe/6VQRvrBFahiQu3Fo1PAEL1mrmAHI59zYWI1967FefA== 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=xFgJBXXEtiM5Mp8+y5LGgXWr+IbVRZHIo9JtSR+Nias=; b=eNxCydeL8thsHi14Oe83QC9nQN+7vK42om7Z38aRmNmvWFw/gOAb1+t5no40U8MDdmMxM8rntvQhCmRQHbwCDjTt5qzjbcSSpN05Cpte0kwNmhW/0k0rkI4YxwRrbU/enNSmpUNl338AKM7aaQy3uIB8humiucPoXPNzwbj3etlGQVAFHjRxzfKdIppb66zxui51LXFlB9DIg+62rTaXXpHo3NwEIA2i99FzCrIt7bkOu3fYsXs2Y/hQwWRfA3aaLGVIaCLUdm0PDyu/2b44JvsD/UsmfukfbWyei/DXmLl4fNp1rAKe1sv+DkWDXa6mX/2GCwta4is9naLEo+Q4IQ== 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=xFgJBXXEtiM5Mp8+y5LGgXWr+IbVRZHIo9JtSR+Nias=; b=LnSLxCOjj8hK5dw2J2sG5jTZ9PQGQefCMdgtgViAFn1GQZ5UM8tZZiaVw6lS43+nigeAOEpgf6kbawR9QfyTu/s6Mw2AUxEObvz7KjLgFu1tMm5mh2PiQyAv9BW2Ibdx+LYVmI21PG7rIh4OCCvaEfiT9jZV8i//EGMnzxnEewSglN61WDp8NTMyWoc03hJdt66bSN5+ThFXQ4FUoIZzKP8ZzM5wZSEiqREQnRiCkvxAtWA2u8CcgHDeJxl6/IzzU46NT0hJ0ZsvL559EXR+vpXLT+HtubxM7hbgR0enwAgSsfu38pSGyKJzdUe4JaRsw+cxR3gRdRoD7VnBW7UzoQ== 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 SEYPR06MB6524.apcprd06.prod.outlook.com (2603:1096:101:171::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Wed, 12 Jul 2023 08:14:23 +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 08:14:23 +0000 From: Yangtao Li To: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui Cc: Yangtao Li , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/27] thermal/drivers/rzg2l: Convert to platform remove callback returning void Date: Wed, 12 Jul 2023 16:12:49 +0800 Message-Id: <20230712081258.29254-18-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230712081258.29254-1-frank.li@vivo.com> References: <20230712081258.29254-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR04CA0208.apcprd04.prod.outlook.com (2603:1096:4:187::10) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB6524:EE_ X-MS-Office365-Filtering-Correlation-Id: 92ad5278-6fd8-447b-35e0-08db82b0005f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JSO9DzMTqEI4GNwbdWHyUxwf4JZGV7nW731QrczKEKteejxr5yJa3ap3k8DOi7kqAytBbCm6RaHLxPJ3gFsoKUEQN+ThlHpvSY3FW7e+214k1d9AQsSS1bxA9l94aeHX/fOpOGdtAbJBGa3h22TOS/wC1dLpIlN815TIxytU9hg3nMBAWcC9WMFIEwitkHyhOVyoqu7j/dqp5duKhv1e33GP4MzCLVgtoN7bkSitS7YpVA3H5v9DSz7KSXProq6wT8LmIB+L4vGFlfNvAiVm1z+gIv/sTb6NKeYvG786uYcdyt6Rf6kEN/Av/OI62TiQn1Anam0xhpI7laQXUi4XDhl3j5uddsc4LC2UB+8x+yiNdBbgrAW81gZ8yd4yYacwFxqarFL0pd2XleRsFBgu3Pq2gcmVIUW/x1s70dLk2XFdI9H3Vv/xAeHMtMm0ExjpqN4rVkDKnRxSg6TAREgsvpY6LLwbDVkSFraOeFZiy8A9u4IRViAH9JGMesM6Xc2yG/ezyiPxQsC4sfAi2aEYmPbeDKeO37K4eoECg5XcNfZBdA5TIqL7rF8vlhEMh03r3tO69UdiP978oLxTgx/2ZKXVdFfyLh1e6Yi71uORsTK/9wFk86YrG+eyT2UqdP1c 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)(376002)(346002)(366004)(136003)(39860400002)(396003)(451199021)(8676002)(8936002)(5660300002)(186003)(2616005)(83380400001)(6506007)(26005)(86362001)(41300700001)(1076003)(6666004)(6486002)(52116002)(316002)(6512007)(66476007)(36756003)(2906002)(66946007)(66556008)(54906003)(478600001)(110136005)(4326008)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?EAY3R+qddLqf5VMmFGl+R41mkt5e?= =?utf-8?q?oNHp4TohEkFNLz3nWjITtU9AtALeOonMKPFYuJ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T/Lue5EVdq4i/ZJlfAJ1HHMrMdOHh44yq4uLzXq?= =?utf-8?q?FiYklxIMj4IGvnquQv4YcI+ALPlNkYDVe9Dj3cza+Xp4AzgGyXt9DLOs4u9/d0EdO?= =?utf-8?q?3E0wUrGN11GepMLZqoLMlN3eHTEYJTZ7WwrmwvPyxUUDsVhkEYuRG+oFVQpuPqDt6?= =?utf-8?q?pJ3ZhQGHr+s5M4X/ya7XfDoOevvqCq7EzoA563OEy0wvtXU/0Pp73qi5FC7/A98vy?= =?utf-8?q?r990vOrfdEGEJfKSZnv0lAte7wDHH1OHdfUd+D9NZRMY8HB9J6/27wojYJsxJtGmI?= =?utf-8?q?M1DJzN1qVsyB8VOLzG2+wppEeYUOtg/gNg+uHwECobd2waJp3OjGVNb9CEqVLH7Ad?= =?utf-8?q?6HJC/Zu6mdjTRGqOVULEc3LGr4dnPAqWp/zM0TfRF7sJZ7oL6HGa3qX2UGEjdqPUs?= =?utf-8?q?sPYn6UvnW/CksX22q1k8vaSB8tPRq7pPVLnVSr2BRxModEbghisicerNnEm8SK6Au?= =?utf-8?q?CwzqtUC5PZuTOkI77L+ldppfJFSI5PiIGVfJCjOEw+ZpfGuXBPIPfWH8+ZlgkjmXp?= =?utf-8?q?4YjKpncPMtmu3EGrkH1p3X0UG+B1+5X6oLzkn5+3WAg4UMMG86Td04h5mtZdi+2ZJ?= =?utf-8?q?pk/mLhk6Rkk2?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92ad5278-6fd8-447b-35e0-08db82b0005f X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 08:14:23.6654 (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: 5jFGA806Yco2Kmd8217AMOmg+rIKcNGdI8TjwWUp1srW8tHJdpdK/r8y67+6JC755dKJsiRtaoCjt3vjnsR9eQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB6524 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/thermal/rzg2l_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rzg2l_thermal.c b/drivers/thermal/rzg2l_thermal.c index b56981f85306..a723eaff78e5 100644 --- a/drivers/thermal/rzg2l_thermal.c +++ b/drivers/thermal/rzg2l_thermal.c @@ -150,14 +150,12 @@ static void rzg2l_thermal_reset_assert_pm_disable_put(struct platform_device *pd reset_control_assert(priv->rstc); } -static int rzg2l_thermal_remove(struct platform_device *pdev) +static void rzg2l_thermal_remove(struct platform_device *pdev) { struct rzg2l_thermal_priv *priv = dev_get_drvdata(&pdev->dev); thermal_remove_hwmon_sysfs(priv->zone); rzg2l_thermal_reset_assert_pm_disable_put(pdev); - - return 0; } static int rzg2l_thermal_probe(struct platform_device *pdev) @@ -242,7 +240,7 @@ static struct platform_driver rzg2l_thermal_driver = { .of_match_table = rzg2l_thermal_dt_ids, }, .probe = rzg2l_thermal_probe, - .remove = rzg2l_thermal_remove, + .remove_new = rzg2l_thermal_remove, }; module_platform_driver(rzg2l_thermal_driver);