From patchwork Wed Jul 12 08:12:40 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: 118931 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp995819vqm; Wed, 12 Jul 2023 01:28:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlE4dAy2RZbaqZBQa4ca6kR6wg21asCv0cvW/RwBeYjwHwpeLIwqXhDrGugxd0PX40RRcOoV X-Received: by 2002:a17:906:1401:b0:98d:f062:8503 with SMTP id p1-20020a170906140100b0098df0628503mr13728851ejc.77.1689150492316; Wed, 12 Jul 2023 01:28:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689150492; cv=pass; d=google.com; s=arc-20160816; b=UlAMUOIPMmDQW1qNjwiqWGVZgeEdr5jh4oE2CH9ynSSLgJgDfvwcLneZWOESkiqR4E plWJBojiQxiU4eDlZLcbjcOGeKAT0OHfVXvRUEoMLj4ec/8sj8+Yk+jP+eqfyZZhSU8Z 2+sQXwIIf7gp74VMUG3/9BD/VkGLR78e5YRxTP1wozvntNotMq5gC6xA/MOB9KzaXSTJ uISm6vZSpz5o5ANMa6/N8+LIulTIwAaUW41zMggSSxTyFZAH75G/PvZu8aV76JR7aK34 p/ArZHbaA6/D0JqYtc1LU6OMzZ/HjCAyltzOqs8I9BCdzWoMMbbfn20i6P82V5v7JZay pvjg== 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=qTSHy6tikfzk9mbKrw76CHlWfY85kX8JtLDPfmC6nfo=; fh=gF2itGWmtUVqnmzOcHFVFNxYnJ9SOivG91RfrScPkYQ=; b=0jjCQfTsfiYDpnZDCPC+hI44Iwi57Brxvbtx+cAnbcnNZXk2x37RnPujsq171PbFKU MhHrlFtW6sMFjMo2sVkWqndwqr9p2217i/vSg5k6+cPMUg/PLJwZlgLoU44LnuoVZcuG nSqdxcmkb7cZ/BJl/zyKzboW/9dWU+5vAjwC8u4XhKvsPjwNISwGWQx9woySB6eKxDOG oXNjN4pddu7EEXvf4VLuydAGLi7nPVBIfssgDBtuPOHqsv6x7uipO77EOzNJdXRNj6xH 7h4r3apBtUoXQH1uKLVc0qaC+OtE89YQv3TmgRoh6nP9xbu5ye+A/Umq2HAXfhE/0vS6 Av2Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=TH3uZKxe; 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 c25-20020a170906529900b0099332d4ed30si4033597ejm.677.2023.07.12.01.27.49; Wed, 12 Jul 2023 01:28:12 -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=TH3uZKxe; 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 S231588AbjGLIOp (ORCPT + 99 others); Wed, 12 Jul 2023 04:14:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232255AbjGLIOP (ORCPT ); Wed, 12 Jul 2023 04:14:15 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2116.outbound.protection.outlook.com [40.107.215.116]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F17A19BA; Wed, 12 Jul 2023 01:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jtE3fiTXW+95h7NrZq+ag+b6kSkTUdhGbCS/RNjpcEBXC5+o0q7kZxwROjIvBfnmzPgpm/aYGNPsLdA6fA76mgCMG5x/RY5iOMVleeP82KjgAYR+FhYKabmkZl498ohVIK8wpxU1WOFuAfQY2c0FeZI+bMEYenVMtZ56v0d787e/iXR9QmgxAMkAbXr1y9SYIg4Mh7PK6aEPNR8Ik3JF474fo+KJbDMRP5Y4ZmFR4rrB6vBfZnCrNxmd6hNJHs/cm3Z0k3HXPrsOS48+bgYyhoux8qTDLHlno91xYFowF+bqkgfxMyo1n6sqevgaa5oxwtHhwkIBtsRxJFZr3LGa6g== 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=qTSHy6tikfzk9mbKrw76CHlWfY85kX8JtLDPfmC6nfo=; b=NkP1psMVF69JIyq3JKpVLsgA/ZjPVw7tQmBWXMuSRz42lB2oCKQrISBGMYOklMyB9+1kDlPRw0kmXGT3NFY6JBGEsFVgl0KdhNxKRUovS0eprZvFAhz+WuxHuLTW5bB43vxpe+gatT5RsozN1c3/JCcP/oO70yQqT8Y2EYqsjCyOOocNVcnVxlkU0oEjob1Q3ysFqt0Uj86DkemOscc6b3qejUrvoJUMyc/P9eq3sGyduYuPFdYCKa2rqjW1WlZyY4HgCqxWTKEukFtq9pRaJQQOtqgFpctXK20geyfARqPNDnN0cmSNApIn3ixkieB1z86oA5KMRTAm2Io+kYXnhA== 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=qTSHy6tikfzk9mbKrw76CHlWfY85kX8JtLDPfmC6nfo=; b=TH3uZKxeRknU/OIyzjleKp2MZ6u94UATSyVRXm4PaajmwPuh5DI6lfef6ZgSfOUxfXpWa5omu40ReeaPlQcvuL2xCR6lvH3oiAgGB3BXzlrnmzn1jyKbuCXLl89jiDgZC/kenpyTCZCnz3tex2TlkKnsHJo8NgqlUuinVK86/mjyMOsTjZ3c1BuaYsq0CP+AqEp5XdAiN82+FSGYvLWyZ4l5H1bZUdlxTYfQEcNAzj4rcnlCQDvu8YYObapQEqAP68ULpQ2PWHTAIgwzXea2p6Kk7g4C7SdMtScXv6pbgq9PO6KpVO/twHvw/z0VVp/aRLpGi+Dsgwlz9hhhUblc6w== 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 SG2PR06MB5382.apcprd06.prod.outlook.com (2603:1096:4:1d5::14) 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 08:14:06 +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:06 +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 09/27] thermal/drivers/spear: Convert to platform remove callback returning void Date: Wed, 12 Jul 2023 16:12:40 +0800 Message-Id: <20230712081258.29254-9-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_|SG2PR06MB5382:EE_ X-MS-Office365-Filtering-Correlation-Id: e3ad1a3d-2f46-4668-680a-08db82aff62f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jh4N8cd1C0cb89OHY3/acIUzGasKd6FkgqlmWqMHXT2/ccQuivct2vF4ppfoHIW8Mm0gKMToOP0Y1j4VSlUBzWg8w+dDl+Crmr6EH/FUjwRkrzDJ0Hklg52dbpffcI7jS+j/Wnx59sSy7S6u1CS5rWUvCpGEjALBUDALvh2XBCrdLxa5QlQE7bPYkV/M6nSOnQbhJd0DTs/BTbBOtZfTFlUpJHJqA/k4sXsZqLS0ZYCL/9jDbyHMTqF1VUDroMXXvAOeZoi6+yRiTDcuVLezO9odCuw3EMXTLljqxaZOrQpwsZAV+CigCfZuXP9KObMaF/dG05pshwTprj27dqO90dy79AgLF/VXy7QLVCeIlaZjiwADHEyZ39c0XUe8sGdpBLXNdJfr4RFJff0hd8x0DFvy0KicYmUpuE9hrpUszT4nLDsd1fG+Ihu/b1VmuBO5VbDpg3RO44UtSSrBoxGBQEBLQEO4HsxdjQmaRJyu5+6LJJfrusrbxdpgNZV1ehppO2rKVgEWGRZOR2nYzNH1NA8WsjxIdNbQ+eUwi+cRnNAhBKd6O5/NJK+HHAqNf1V++4rwgGMdkSh5uhuZYNsGpPkz11WEA62yUMsNwWEMXIYIXKfNhLKFiGYWHj9nW+GZ 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)(366004)(136003)(376002)(346002)(39860400002)(451199021)(6666004)(52116002)(6486002)(478600001)(54906003)(110136005)(6506007)(1076003)(26005)(186003)(6512007)(2906002)(66946007)(41300700001)(66476007)(316002)(8936002)(66556008)(4326008)(5660300002)(38100700002)(38350700002)(8676002)(86362001)(36756003)(2616005)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?m3jtXAhC3tTgtE7d4TaM1UKQjUr5?= =?utf-8?q?DZT/7BMNEVEFvrSQ0TN92zOpKcfcQJ2gAq7/1s35PmXyFQvyR9j3TmjX/n9A7miE5?= =?utf-8?q?I2UNKpqBKUGjF2U5U29DRQVHVsAzG/aj3zBoLtlb78bahLuAc1zBwJlbCsINEkU94?= =?utf-8?q?mmqMtSceDVh2RZxJeqwXVi6ZRZ/bqyH0ED7h7soWiHDwsmZHZTe6QX5KuG9BU8D3X?= =?utf-8?q?sX3/EqFyUUvxQqMUkd0BVr/KmQ8xPpJrKqzDnCZTfORrX6sK+tpEgiiYevLuARC5s?= =?utf-8?q?k3RBtpjH+wRtiIDD9McrM7h+dNCVfCNXjmSvmW+pNa7+URTDc8AoOQlfOlb4io7gn?= =?utf-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9+DuMCkqnQe1cbfx7/GIODL5YPvaQbjdPZxvS75iifBl4JfY8zlCjnOmcAr?= =?utf-8?q?XTRlA4/TRbvfNi7IE37VOJ69s5S6RVHmGn0RmedRKbdyGyP3M3Sr6yXN3dqKQ7Bri?= =?utf-8?q?zkyKJUe+27aJpRT2qNFDOS0QNNu+cObPxwaDt0Q5R9TP3EuzSCW32900LscJnZxCY?= =?utf-8?q?l+3anwb4S3WeH/ZWjMhsX80JjAjXBzBNVcXhNeJ5HPsX1yKL1P0om6drmPDV4fON6?= =?utf-8?q?XsqxT/q2MO+KrEDb+IiNed16i99mpcBLsBoQKW4gkaJAnhP4EnsG2b6KAgTzRH9lA?= =?utf-8?q?76DJ2S4CvzDG?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3ad1a3d-2f46-4668-680a-08db82aff62f 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:06.5568 (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: HjIWdBJEGpkWuSHNx85MubFtVDRsAzON1Y8Kd8VcHiqA95e8e0qK6g0vXezoKF3yBomwM3MZmsdvgp8mkyAmFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5382 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: 1771202666698152672 X-GMAIL-MSGID: 1771202666698152672 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/spear_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c index 6e78616a576e..843fa5c8e7c8 100644 --- a/drivers/thermal/spear_thermal.c +++ b/drivers/thermal/spear_thermal.c @@ -150,7 +150,7 @@ static int spear_thermal_probe(struct platform_device *pdev) return ret; } -static int spear_thermal_exit(struct platform_device *pdev) +static void spear_thermal_exit(struct platform_device *pdev) { unsigned int actual_mask = 0; struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev); @@ -163,8 +163,6 @@ static int spear_thermal_exit(struct platform_device *pdev) writel_relaxed(actual_mask & ~stdev->flags, stdev->thermal_base); clk_disable(stdev->clk); - - return 0; } static const struct of_device_id spear_thermal_id_table[] = { @@ -175,7 +173,7 @@ MODULE_DEVICE_TABLE(of, spear_thermal_id_table); static struct platform_driver spear_thermal_driver = { .probe = spear_thermal_probe, - .remove = spear_thermal_exit, + .remove_new = spear_thermal_exit, .driver = { .name = "spear_thermal", .pm = &spear_thermal_pm_ops,