Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp38031320rwd; Wed, 12 Jul 2023 01:52:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlFVOyCGF2OAJnCTQ75lupJf01A/y6ZSTmCX7QLML8rwX2S50WsBubTsvD38vPg0bOMMZTZf X-Received: by 2002:a17:902:b18f:b0:1b8:9044:b8ae with SMTP id s15-20020a170902b18f00b001b89044b8aemr12463027plr.11.1689151952655; Wed, 12 Jul 2023 01:52:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689151952; cv=pass; d=google.com; s=arc-20160816; b=x4joa9RvXSb5GyuezqopU2CLNBxH6oixMHSMlLwgaZnQ13wcAikklhRBwUJP/4YdhI yh8uTFSi7Q0VlPNNu3ArO4TWjJHP07HN2TDl7HsxWrE2nvu7YwEN+TF2GyztE73tb9hY ADcOHLtYmXLY6PuE4fpzvQPC6Eg6Ja8i58o0bBUvB24hvcEmYWjz3EcaClxrF6JMM69F hJ4tgcMJyBTZbyqrv7kfyd2CbrAIVEB2RvQPFeEG27RS3rzYrnr3/9S+HF8bytRu9ofH n0191+tnKFL/mkUQM1a72IsQavPzXB6fFz6e/NWZFJKa4p+tgdDwjZvR+Bjr83bNdkt+ AeGQ== 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=TNvjmd9xpoD3cwxwNpAAcC7ffsnPu39nlxJUxUcHiFw=; fh=/+YfUBGFURRbgMZs1WWqXVi6bqlIw7Ev7Ycddjs/2qc=; b=kfxO4ks5u9m1GYeGG+2r7Wi/9IIRID48iQxGvEBi8Z6nPk5ywBbirQ0GfHEErqsW03 GwnJsmQlsX4LqdLVcKRcBcnHppunvSR8C+okiLUhpCRKw12Flap4nCsyQVuyPfzJyLpU i+o8h8G+pk47elEdsCCcJ2VJfz6BhUZThvrJiNxIDRTrjG1hvQfEYuwJGuOdNqAjnpv3 K6ih+UJmRgGdETPw1zvemaHio3yYCiIWp/SUfWP14P4yRog5bVZYIwNr94zSHcsVNbgP FJvvG3ekObU7C2yTeThlW8kqvfDKKUWfIUGpduCMfIxi+wLOG6xLOfjFPBfbpIqeCie3 KU0g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=nizB2NtW; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a170902f54500b001aafea6f85esi3085340plf.435.2023.07.12.01.52.20; Wed, 12 Jul 2023 01:52:32 -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=nizB2NtW; 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 S232483AbjGLITi (ORCPT + 99 others); Wed, 12 Jul 2023 04:19:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232261AbjGLISr (ORCPT ); Wed, 12 Jul 2023 04:18:47 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2090.outbound.protection.outlook.com [40.107.215.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42FE526AE; Wed, 12 Jul 2023 01:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QlWwXf/8dT5EtOA683eEblNmUo1ZtlEuz+lE04ZHKWl+XWHV7FG3MLFivs9LI21rbYWiN9I7pzm2QqGn27yOOcHnjDFAHyHRG5wZ0EpNrSC1bu0xvmydS1WojoqZ1ESwbQgWkX15234ksCnro1egZ2HZX6h/YHsoeKyerDXE4ktBSb4YPbylgnoUxcpvSiw/V1BzoYYkd3FZpNbwXRAsY70KORfMHBwh42uDyTWLoVBS04dXIkN3merEHsfg89D8AuPNZX8XpNPW/apuCNvzWPCfWt+8s+zIav0aUYfIx7re0NUykJNJxsqmLA8Mnf4RdHnhaZEw09gFxID4pypG7g== 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=TNvjmd9xpoD3cwxwNpAAcC7ffsnPu39nlxJUxUcHiFw=; b=B9cYnCtw8QIkNvTpBJPEiAcbNubYrxuvao/xWv72mhMOutknj7iil9cAETv5l/C1U971BfpIZrxfal2J2gEhr4cig3XBevDN0cUmGZY3n2IRmzhgZHUh54FpxYaWskJ9cDYsT4tBZ3EjKq+slhwDGYpn1/qG/aksnLli6BDvFSat1WYv7/8nU5H3PJFy5/PO/DGR8pgmDw96OoI0ucnmf7i775WORPSTPwTeCCGlRU9aQSgUxqnu4kjAUsKoFgTLox+d5jqKn0FBp7skwjPhbEZQlL7cqfVMSAJQVeCsDafBTzWgWws6GbC/ZrPPiyDj+T/G0H9ptrziPf9hxDi5cA== 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=TNvjmd9xpoD3cwxwNpAAcC7ffsnPu39nlxJUxUcHiFw=; b=nizB2NtW0n8Gdq9M9GwvYz3veDjnFOQG/ZRHKBYUP8l8+xW+Qat8AfTOrTigKYDwskb/lvnu5fb0ItSwrArHOXYfUhTv7WCFD5B5n0LFYC/2cSvXa8I2C33w+Qm+miu0Mt2537qdOfwfIagJTYNeHrWf+biqaFU/DmeWmp/VBdVcxVNve8+lQTtS+TavLQSk4TmPIgVcU2vZpJtDuW3jkxkn9JoLVTuQ6LqOoD3bTDPp2T0DmN8lpQs5z7xK0P9Q2l39cB5Pqab56+MEfasTedXb5C4U+absnEetan1Z3lAe6WiQndWX3Z8YqKBL3IXnQx4PNsbn0AYsWhvTY2HEkw== 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:33 +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:33 +0000 From: Yangtao Li To: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Maxime Coquelin , Alexandre Torgue Cc: Yangtao Li , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-pm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 23/27] thermal/drivers/stm: Convert to platform remove callback returning void Date: Wed, 12 Jul 2023 16:12:54 +0800 Message-Id: <20230712081258.29254-23-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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: 27b486b0-7e43-4a13-054e-08db82b0066f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c8DS4tOMH8XHisE0YYw3lrNVFmQaLbMvdP1761dYBUi5Luo0t8OTsjPfB89yFEZx3mt2RZOgMwnMhy8FbSozK7yBOFvB6WFZ38rdsQuHAMO5DqaZaAZRaO2vQ75i3Pv8EcpUWPn1DpSqnjHrl6rw3yCjQWfbTo3Qdr53WCFk4rUi9Om/h9QIz4Ich+A7h25Yd8z7jVIDahgmSU+1oO2KP8a9KNS6tMR4f1FqdrQq+AbUez6CrIupp70c7aVSnp0ZNEWx0DYWFuzrdEpqhKFdEgEhxOucPeFc/hiOkx9GgxZmCV+qBBqoGS8LZQ5qv8DUD2NCs+YFdna7Ydyxf1D1odgpRWv/r4ai0dCjWGW3s7omMn4v0lzp5lZ8DhWklgchagbl9jUpaPRSO1fCSd9AVholzmmVpi8w5bBFcpZCS/316Waeh/rDnYTJRKNbhhGR9HII4bEkjvSSi9aEaT7DUk7l2XqU7imICwOh5Q8W8/Xw+UzP+C2lmVqkqUbuY4NWgtquyNc27+hcp1AANFx8UzrD3UtuJqyOtbl4V3w5GtOr0LEJP8mY4pt5s7HzObcT6gunhW4r6BjcffeJcrmpHqRftsufEy16JezNb8jtpzFf2Jv+tLShrntCSohqckav 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)(7416002)(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?B?b2dxTlNVaVVOU1dCbE5yWlNRcjRRM0dZeUFKN1MvUGt3eFZhNlZWdUtlTVpN?= =?utf-8?B?aUdITE83N2hMdFVGaTJGdTI4NFJJU0YyMWtjUTVhb05TNEs3d1hmR2U4L2Qy?= =?utf-8?B?VjVGOEQ5NEF6QzRBVWdObDZyemhqNXZtZzRzM3pHRFQwRDNESGEwTVkzcFNy?= =?utf-8?B?SHBHQkxleElxdlJhaThJV1pxdDlqNFBPZjRLTyt6dlZZdmRUbng5WFdXWGc0?= =?utf-8?B?SzF5NVhYZnFWS2tmTXpVd2YxOTBOb3llRWpSVG5xc05ObnRxT0h3Q0phMDUv?= =?utf-8?B?S050TWlBZ2ZkY3F5TmRWQlJJZ1c4MEZBUC8ybWxkQjhUMVorMkN5S2JsYlJD?= =?utf-8?B?WTYyM2dkWTlPYlJKRUU1Ny9qV2NHUHhVcERORlF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Tenant-Network-Message-Id: 27b486b0-7e43-4a13-054e-08db82b0066f 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:33.8278 (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: FZ8vk1G/h3HSFfMkGQQVO0ZNey1/SRHAJLLqdy++h+qQLa7SxsiqQq6AS++JXSaGUXJD1CbtgWZT9Pm+zodeJg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB6524 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_NONE, 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: X-Mailing-List: linux-kernel@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/st/stm_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c index 903fcf1763f1..da6a25ce4469 100644 --- a/drivers/thermal/st/stm_thermal.c +++ b/drivers/thermal/st/stm_thermal.c @@ -571,14 +571,12 @@ static int stm_thermal_probe(struct platform_device *pdev) return ret; } -static int stm_thermal_remove(struct platform_device *pdev) +static void stm_thermal_remove(struct platform_device *pdev) { struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev); stm_thermal_sensor_off(sensor); thermal_remove_hwmon_sysfs(sensor->th_dev); - - return 0; } static struct platform_driver stm_thermal_driver = { @@ -588,7 +586,7 @@ static struct platform_driver stm_thermal_driver = { .of_match_table = stm_thermal_of_match, }, .probe = stm_thermal_probe, - .remove = stm_thermal_remove, + .remove_new = stm_thermal_remove, }; module_platform_driver(stm_thermal_driver); -- 2.39.0