From patchwork Wed Jul 12 08:12:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13309733 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 2FC5EEB64DD for ; Wed, 12 Jul 2023 08:14:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232160AbjGLIN5 (ORCPT ); Wed, 12 Jul 2023 04:13:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232173AbjGLINx (ORCPT ); Wed, 12 Jul 2023 04:13:53 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2107.outbound.protection.outlook.com [40.107.117.107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B40A51981; Wed, 12 Jul 2023 01:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UMq9JekGXvDoSmVOx56UkbGy8wx/W+le4mSAHkt+6VB4eNmLi/HITFaDGTzAk6G88U6aKz77BKAohZECbdJG0v6tQgvjEFvnk9cyavvxTdk/e3R/DN/69Cv3TFO9DMw4JE+1NCKTcL8KcJoP6XZH6hIxcM80Pm88asOInIHkmAHnGsbGp+2Yw0OUsv1zq6wFP3g0oEJAF5PJOBEG5v2wVmolAv7EY1Gj3xHUPZxOlFp2lq/tZt+skOtocjpGh1Octbhp9RNneT5n742A5iFVXhU7bkVrO2zyogw2cOFiISoGg+gr0HvjAAecG8vwc6afjvEfs/uQy4G7tWTmbfp70g== 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=hpZMshgUnhl1a1NRIEAw9FoWwWlGONyeujolIieNF5s=; b=fKxN9NncDeyHewf2r4+VcvnlMqjNA12/wNPqZnnuhy24G8JBpql6SP/O0GCwsZ0I1cwXMiB0/fsWEKj5s03RVSJL7tbVqojmdgeUbBAIMh/Dr78LNMlzQvJ7HXjRLQ9J5nxZR5GhZ5h285mzCSVyNMToJukFI2BvvnjDzktFiZNU1VN6rZoRt6iUfyQ3AFXt50aI4FP71/bQO1YfoG9K7jahWbtkbZtKWQrjKsIWDt+2Cazl3/F4b+siVtQ68TisbxIiYihMHmyff7b7f7+F/LTl6TXoNTc3oyjdW1JJ+WzLA6irHsgIQi/S5/3GJZpkQaA2qwNAUGrSCuqbxhJ0Ng== 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=hpZMshgUnhl1a1NRIEAw9FoWwWlGONyeujolIieNF5s=; b=YouXT0nfwyIPN63x5wCih/7tP/H+0Rt1DDqER1dX/Th8eZAtxwJbm6N528VhnmTEFC/6EipCRWBT08/6LIdnljzK+Q30LfSFzwX8PI7ugnPD6PhVNYwOuhs1DE7BK7uNU3wMZC4NFMNOo4uFafR6MJcNFmx3HouEuwmYxMNUjvA2lVPrO7vX8N4+t1OjEa+ouCOJPFIeQUe7YieAhK6KWcze8mvpCf5XZ8JW/Y2XgJO5Y6sR+i1CDgwQ98lMdoPoAO3vQt5as5nif/GS3Oml1D6067PFNLASvRaginj5DCb5YxWGPsqJKlnGr5iiSdbQa2ld0YgKE3kJ8CysL9tjJg== 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:13:47 +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:13:47 +0000 From: Yangtao Li To: Miquel Raynal , "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 02/27] thermal/drivers/armada: Convert to platform remove callback returning void Date: Wed, 12 Jul 2023 16:12:33 +0800 Message-Id: <20230712081258.29254-2-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: 061e9397-d4c6-4c5a-7eff-08db82afeaaf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TU+mu0z4wCrDRKxcHWfmczo0DABagI5/nANMCyAGUVlTBVuWIXSdYFpakU957C1Utx8RGVbBaIXp/im2yo5xr/ukKY4YavW/n0qXOcxxQpRKIEvWBaR/5Nl8AWbYJHDUgjv5zCXfvaSVxPEpCIutTyDpZ3WfoahLu/Yg2cIbreOiid65NkpxZadoxdBZKmnyfJM/AIDmUOos1+iGSV4GHoq569umcezpVbcooBvic49BtmHXvU9eQiB+w27nIoVGcJVyQWjkuhksWLp7bCv/OZTYYw8zQUdN/DDOtS/VhcwKbLq9rdYB7AJMgIZO3dp8QUTLdtetIexSySMJslVxYftwz/yWmQLFYROaEZea+9wSttrHS688LYJUZdObhLgRNzlIRqrxHhSVKjf00WvyTPFAvosy9tCXqso5L5qAExeqObP3nuAwpS5D2WG0eIK9pVu8Ps89LDILggtKcXStwO/VMb6Cuid4T+pocfZGepYjy02mG8AziJmykLGNjSaZ0R7Ke3P4NeHNcR9B6eIpbepb/jGR1tUZ3A/Naz0nbmd8z6GIry2ZBTOXEWIm8lQLBl9JXeI4MmR+gtFQh/ph0eJUEf/lC2voIMjt4Jl8X9aLPU/cJeGdmUrolCcneUny 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?r+wHfRZcEGKlB2Cvg2d4goInCjbB?= =?utf-8?q?voolnNSuAiQB4JGX7u0OLVJULBIvbdYrIQFI5FwA1UHNwnSA0rqtJKpkdvGAdPL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q?KdfrfY/HDEtQtowQ8D0kLPwBzkmMbQnFhxU1A8BmYO/JAmiPOCigG8kbmCTr+qGcc?= =?utf-8?q?zD8Kr549zcQAjmgTtnBYNmVLDuo8+2Rfa54CHL1t2lShCfixZQBZaRt5RR1DAW6s0?= =?utf-8?q?3rKnmW5kmWTXAWnG4AFnQ6rOOYXRVJCs+/uPOhIogvLlk9xFrAPBBKJkkD7u491YG?= =?utf-8?q?Phz44v9KZtehsj0B8a5xLCI3ypKBdvp6ZGfOooxPmfoGMxN8tJnXsN3cm35QAGGyq?= =?utf-8?q?2ZrgBPm1lXOG/4Hs1Ku3BIzfkJge1uOoqRtzwZvng4BDWR3NS7IfvwphIpui6Vf+X?= =?utf-8?q?O7AerqOyzc99zowBg8ekcbUFiIGgVTKimM3e1Poa6n9P0Qqf5sIbatU0NpCOY9L0I?= =?utf-8?q?7scxM9jwBbunDutyCnClqVo8Li1ai/jX8boDOIrJqLCrHGZoJjt6d0AYBkQsY7SO7?= =?utf-8?q?yBK22tCWxx/kP4pSI7FPXjG3DQaJzCiPYjZJMPqpHndpiZsFh+C4y7MmuYzdC8gPM?= =?utf-8?q?Mf/7YkR+n0AQXDRCRG+iwUA36RtL3GNh4GQYGcTFE81aRwKnXhwB0QLrvC1gIrX2H?= =?utf-8?q?4yY3o9GqRBv/?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 061e9397-d4c6-4c5a-7eff-08db82afeaaf 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:13:47.2866 (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: xiTTdfSaBFHk+pg7qQZUKYsNbYI7DXEF3vw8hzDD1/6Gvrqtj2I+nzzh58nP0/l929CQ3Yo4X0YnDIAAf6SzUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5382 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 Acked-by: Miquel Raynal Reviewed-by: Uwe Kleine-König --- drivers/thermal/armada_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index 9f6dc4fc9112..94783e374d37 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -964,19 +964,17 @@ static int armada_thermal_probe(struct platform_device *pdev) return 0; } -static int armada_thermal_exit(struct platform_device *pdev) +static void armada_thermal_exit(struct platform_device *pdev) { struct armada_drvdata *drvdata = platform_get_drvdata(pdev); if (drvdata->type == LEGACY) thermal_zone_device_unregister(drvdata->data.tz); - - return 0; } static struct platform_driver armada_thermal_driver = { .probe = armada_thermal_probe, - .remove = armada_thermal_exit, + .remove_new = armada_thermal_exit, .driver = { .name = "armada_thermal", .of_match_table = armada_thermal_id_table,