From patchwork Wed Jul 12 08:12:54 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: 118956 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1007801vqm; Wed, 12 Jul 2023 01:56:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlG8sU00A4URIfwUiBC0C3uSKvUuwBtGItZoUMCpTeUR5Kn4UFo4awmCOu8lvdKnnV4XSRt4 X-Received: by 2002:a17:902:e811:b0:1b3:d4aa:461 with SMTP id u17-20020a170902e81100b001b3d4aa0461mr15554457plg.44.1689152169403; Wed, 12 Jul 2023 01:56:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689152169; cv=pass; d=google.com; s=arc-20160816; b=hUsTwsURrN5eqXChD3CDkaZzZFt/OhsyNJbdSwv8IkBK36Y9zKogCCwWa3cx64BANI X8Z5/CYdMo/EhoQ47n7XumDqE+6V/MLciySjjUh1Ev90HgU/ZDNW411TwLAlcFCoe8jB NgvXybp9ptVarHCwx5CoKx4XAt1SacINtX8rwWPqvC4TEhAZbJXgFDPwZejpBzkg9Vju nAoTu9GaryZAijVCM5alXnGCJ6pQIoTAs4Fx1T1/XFUfw3wvg5tqTITKfgDPCMLidiG0 ht/QSTvBPyACRpF3/jiA/EYxPwMDkhTVmTXA+KTs1vUMSk9O2Q40MCIkjbSO4+yZNVGd C8KQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020a170903234300b001b8b2865f38si3158990plh.170.2023.07.12.01.55.55; Wed, 12 Jul 2023 01:56:09 -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 S232484AbjGLITi (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_Kleine-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> 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?q?ogqNSUiUNSWBlNrZSQr4Q3GYyAJ7?= =?utf-8?q?S/PkwxVa6VVuKeMZMiGHLO77hLtUFi2Fu284RISF21kcQ5aoNS4K7wXfGe8/d2V5F?= =?utf-8?q?8D94AzC4AUgNl6rzhj5vmg4s3zGDT0D3DHa0MY3pSrHpGBLexIqvRai8IWZqt9j4P?= =?utf-8?q?Of4KO+zvVYvdTnx9XWWXg4K1y5XXfqVKkfMzUwf190NoyeEjRTnqsNNntqOHwCJa0?= =?utf-8?q?5/KNtMiAgfdcqyNdVBRIgW80FAP/2mldB8T1Z+2CyKblbRCY623gdY9ObRJEE57/j?= =?utf-8?q?WcGPxUpDNFQGOBlclyJ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iEV/0/x934+5pLLWOyrOG26r/g11wr0UwnitKnd?= =?utf-8?q?JBy8rWiPbaTyW1xgxD+TeCc2ub2O9KiRQjR7bO3KxxlZOVr9oPi8GlSyKMFuZCTU/?= =?utf-8?q?0K6Uc/y/3gf3gl3jhdRG9noBIQvZuWCDB68zMz6WFt64Fu1zK7I4tl4YPnIyOAh5D?= =?utf-8?q?DZ4zz/xjbWEhKw9Zdd4ZBlUYz3xJylKwpo/ME71Zhaq/HyXN9vi3wxKSfOrgkDWHJ?= =?utf-8?q?MWtOt2dorHmRhhIcKfu8OjYSDR0alF1/am/XdxIJmJnHW16s+ozeXNPfUIWrMytib?= =?utf-8?q?a3ZU1nM3yJfyEtAzBkWdhYh7y08agFCnj+56yWxRuKsiLmEC/pmeJQ/jBFcNF3T/e?= =?utf-8?q?6mNE3MW9+pfl?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771204425200510889 X-GMAIL-MSGID: 1771204425200510889 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);