From patchwork Wed Jul 12 08:12:45 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: 118922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp994143vqm; Wed, 12 Jul 2023 01:24:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlHy291jZWOgxFigF6ZdeCm4H4VKRc1YaXfmPBqp5mwJbSrvRkrRY836dyyHCDl9N3+UMlXF X-Received: by 2002:a17:907:a410:b0:993:da5f:5a9b with SMTP id sg16-20020a170907a41000b00993da5f5a9bmr1508914ejc.8.1689150242334; Wed, 12 Jul 2023 01:24:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689150242; cv=pass; d=google.com; s=arc-20160816; b=PyGskpook4ZwnoilDNinZvnbBYHjLpYxVWvPt2eqoubSpDHCjrW25VlI5ENzBn9d7O 2wPSrG7NO1WYsppK4XqsabIl++T50O2daoAo6a7nkD0lNT2WfJlbh246NLd9qJE6rxMW EpGs6Wf/Tlz0bqijJKIxULTRm8FpYF5GpQdrfjwAdXeYikZFScHFahhrKvt5pLO5TqqW v0DHNLiAZxhmdfNvcw60zxvVVcNnxTLPcnCcOxWdgYcKOYWDwP6OvHaDTWy6R5w92/UN 18wSJZvcryg72ylVOUkmFZdPmDtok4jz+g/FCJLalZfHKCVbS8uOwB/T2+u3k6nIF1Xv D0qg== 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=7T90CmrdbjDP4sHSP0/vhp3TrV2NK3fye4IqWpjyNWQ=; fh=wmIDef7ysQHQQNTVbjXvSrgZm5zJs4FQ0EcxDGRFrC8=; b=qyNN/aYF6HoEtxkT5AhlBY5HB7mPZqUV5g71qDjgdPSTsvsIO6fnz+P7XedcDP4rWT ypyCIDc5lse9qTLNWaXaYOYiXuSn+42YL2cN4i5AgyRQZ/6PQSAhtNJn/zaFClRKGwM8 1IvfgJCwdzXvwjkXqJ8NDqohKfG6kD35pFuLWsYG9IFU0u3F0pfFcldUKXbLY25JS1dt N9cjmtu+Sgrfex2/yVzUvyeyq1CKbCDZo2SEqBabTJL4ToHur4Vp/6Q38azJ8Jh15uXn dhcYqecmMhW7BgBzHiePpZbiV33/iVHIOrm2UsftXI7Jpn8CveziuH4tyAfKTMf0xCJJ upLQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=fxHkDVDW; 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 mb8-20020a170906eb0800b0099315b29a1bsi4341015ejb.1036.2023.07.12.01.23.39; Wed, 12 Jul 2023 01:24:02 -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=fxHkDVDW; 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 S232012AbjGLIPk (ORCPT + 99 others); Wed, 12 Jul 2023 04:15:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232351AbjGLIOy (ORCPT ); Wed, 12 Jul 2023 04:14:54 -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 E1BCF2105; Wed, 12 Jul 2023 01:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VyfoD/4PEjZzruSLNJwQEmpEPUaww98g3dU0r/QWSbTbCR1OcB0bqIr1JevdSQaEBUq/E2D4CHLK4fpP848zbTTi+l9SQ3NIb6sBvuaa1RJ4pd+RAltFdPOO1Wiiw1PymFdT25GVNALtq/6z80kejPikvAN7jcOukEUxGajIBUeX2bKaWFLJQeJEHq5ux6pC+ymUR8Al3eOXcsPdMWRerQHhYZraNUsqoLmelo/ob2MaXi5lUF0MfzULlQT/AfBFeOcK0c5bdA9PNW+hu764EHY8o4Vv4zfxzl7d6KW6r+o7qRwxTmpJQFDK11o8nY+QUpVA0DbwWLKrd2OTDVuibg== 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=7T90CmrdbjDP4sHSP0/vhp3TrV2NK3fye4IqWpjyNWQ=; b=niOQeUyk+AReRF7IpFh5ZPayH/qDqWMIKkglKjxIaZA6NGXtOoFBawN9XYEg2fvLfHU+VWemNQgfnZUctU56KxocWPMezwm284Sj6R+cmxYLwb8H28Xp2E7jzxN1oN0NBoPYO2UKPoGhm5+bSagBZUsOPtwfYKoexQLueH36RYWQ8ZsCxvHXWburaN6aoWPBVx43iibp23k1rEHbePIn1hIsz8ywfjuRidBHl4Xd3WWsuta7a6IP6VOGFtEUiauKcd1Bm5qGqoYoZ6+mdfYsnuvWdBmsbqNulyP005td6X8PEX90qMcm/2yUEt5VgST5HXQq0VQUr4MzLoCLAd1b/w== 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=7T90CmrdbjDP4sHSP0/vhp3TrV2NK3fye4IqWpjyNWQ=; b=fxHkDVDWAVvovGhdQlk1G6zWguhZx71NSqv5ZxKdiUpqOW3T19bcp1/FnxPIgCwEkaUKmchIisJFwSbdYSLOt2BINZTFB6OF21ifPA9iTQI7qG2UcQh8zO6qdcsyWQwsEUzIWvN37N9lR66yQk90UpczRUFa0BSvg6TbeeWVczgv8l7HRg/3c08kh9+4AJ5Y3oUueS6m+gkThC6SrkoFw5Qa9JC6LJ0XbdUGX9hBQlCieJfYoFt/EzWMDH/d9pIfvnjqYMBSHyDRS1xNOJOkrdhMrJBkqEhSjFr5yKOoDpb770+DEeer2S6eVXJIGjd6jqG5pIfyM6BRyERR7Q5yJw== 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:16 +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:16 +0000 From: Yangtao Li To: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Thierry Reding , Jonathan Hunter Cc: Yangtao Li , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/27] thermal/drivers/tegra-bpmp: Convert to platform remove callback returning void Date: Wed, 12 Jul 2023 16:12:45 +0800 Message-Id: <20230712081258.29254-14-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: c213e313-7635-47bb-2b6e-08db82affbee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mH+JKAXuOv4rLrk1OsDmFhlLYYw0fbwa6oq6CnPYE4Ku2fTiLmmDr3i02L8gQYQ/b6KzkWInkbFwi330xy8yDW9s4tzKHABChoqCDV5QAxpj7R0wFI6gePFyVBBo3hu/qb3Z6ZGOaW/JlG5Vhhbebb5ANUUhFbJ1xHibuSGfAFSsDrIkhOcTyQFmsQrWlGRL2d9C4PqIwjHPY8bLWGMjP76ZGIoTTIeInqDQHOzP6FDSncEuM6ONbAKhKxKxkkuNjAS9c4qFohjuKXhosGValA4DsjJlL3EX6BrPfNBJgyGNn+yara0JpuNMVJhcH3K6594roaAKdyPBq1uM3RXq7s48epzGtuSIM2o8iDAvZ4yJhLOfOB4atn9WYfMe1jbxU7n+TAkEXsMEW9QMyhp8ARQPyinkfb1ojdool1f9Vflag+9QYKvXu7AEl1aFkmjMsc4AkV28hlaFHQVK6D5YSa3MSUeusz0W+TZIlSIMhljU12dcc/QrANZXiGjrtw68TJ0ewS3RGpfbnEw2myKxOS3uC1rDgY2g5n7SpzziiM+rXHeAfw+3a48w1j4nTNRsMvxG1l5Si2BUa4gZBeSDneZiPUqPy8iHmU6hdiJDd5t9pFjuWfLsr+GhHwZjEzJ2 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?PJWXEaSSGvukuZc9RBQ7SDXvTzo0?= =?utf-8?q?iFgWHwMAtxPVoGnBix1YbO+7OpZDmkIgr7YTZQig9uKuI5WaBIa9Ld5jrkYMeOtmO?= =?utf-8?q?cn9PjYVapNggF2jLqeKaD0Fussr1Y+eymXyh0xGxRbg5zJgbq6XpihuYvunKuKge+?= =?utf-8?q?5kvmHWGokgbgHaz550xFVtg+f773RfJIqsxKZ9qbYqN9GDobg7TSLG7ErRCLoqnrZ?= =?utf-8?q?cai9Eqk0W5+8/Ecf7rXiLEjI/SBzpoN1LjGqAVRcKC5NuYfFGiG+vH3C0j0UBdhTb?= =?utf-8?q?QT2YJ39VL9ksqpuE/5QtrK61f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/soG3/fvsk+WJzVWAHyTIT9lGIoJhkpi+vyq708kWoW?= =?utf-8?q?XvzC7kohOt9YyxgTYv0IKdHIBB8/UpoGiZxoXX/Y7ggXdIt8XgMrbDHtaB+2k1PzI?= =?utf-8?q?V4FH6lbGWQ+GHo2aiqHZBx/avF8of/4DI42Kw4BJPaxuNduws4aJHoWxPMGSyChTC?= =?utf-8?q?O+V/YPgWbg2o1JExAZ7YR/SyBFzQFn2e9Wn+j7FXX3jm+cbCAYSMMWmxe59XloTTC?= =?utf-8?q?fkKlLiGgL9BvWoLGb0vWCcjYgrvrme/Ptc8FpdWLuksvB1ZiBPXGGzQXf4UMkzQMZ?= =?utf-8?q?KMAr3e+zVOmzRSjwVJvKkkQ/Z7GQweQixG5lm3xUBgvObUCYkEU+5i81XDym39stK?= =?utf-8?q?eyoRrLK6yjbq?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c213e313-7635-47bb-2b6e-08db82affbee 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:16.2120 (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: qg732zlwJvsjyLXAqFAVUdSQfGSmHSkySaYMAuTYKmKNTeaAzLt85hQ6f1gP4q8Hs9lpzGBP5Sia8iUYcsfrhA== 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: 1771202404544421184 X-GMAIL-MSGID: 1771202404544421184 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/tegra/tegra-bpmp-thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/tegra/tegra-bpmp-thermal.c b/drivers/thermal/tegra/tegra-bpmp-thermal.c index a2879d624945..5a41c200deae 100644 --- a/drivers/thermal/tegra/tegra-bpmp-thermal.c +++ b/drivers/thermal/tegra/tegra-bpmp-thermal.c @@ -250,13 +250,11 @@ static int tegra_bpmp_thermal_probe(struct platform_device *pdev) return 0; } -static int tegra_bpmp_thermal_remove(struct platform_device *pdev) +static void tegra_bpmp_thermal_remove(struct platform_device *pdev) { struct tegra_bpmp_thermal *tegra = platform_get_drvdata(pdev); tegra_bpmp_free_mrq(tegra->bpmp, MRQ_THERMAL, tegra); - - return 0; } static const struct of_device_id tegra_bpmp_thermal_of_match[] = { @@ -267,7 +265,7 @@ MODULE_DEVICE_TABLE(of, tegra_bpmp_thermal_of_match); static struct platform_driver tegra_bpmp_thermal_driver = { .probe = tegra_bpmp_thermal_probe, - .remove = tegra_bpmp_thermal_remove, + .remove_new = tegra_bpmp_thermal_remove, .driver = { .name = "tegra-bpmp-thermal", .of_match_table = tegra_bpmp_thermal_of_match,