From patchwork Wed Jul 26 04:00:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13327455 X-Patchwork-Delegate: geert@linux-m68k.org 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 5E466C001DC for ; Wed, 26 Jul 2023 04:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231272AbjGZELY (ORCPT ); Wed, 26 Jul 2023 00:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231824AbjGZEKh (ORCPT ); Wed, 26 Jul 2023 00:10:37 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on20715.outbound.protection.outlook.com [IPv6:2a01:111:f400:feab::715]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA4B955AF; Tue, 25 Jul 2023 21:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RyNmThcm1kSscq25OqpvnycHq26a4Y3cv7U1pytxIQEQTlBYBUGpFTFVgBjvUOxhPZ6zxKRg6gOoxipB3ZaaehmhIS+VlZLUIT+UWXY5MuuUqKFYBoTWirN3UICCdgEhw6GeOHgQJXLRgeXBHCPWkQGnQoJk9nuK5t8QYb0X6BW5ybzZL+UA+QXAcLCMxOmemA0idqHiWnmyNLAr0Nolrjj8q/oQd6JQLcdccz5vGo77YPW/BjyYVF1/kue+nNPrCgLKWhu6jJ2s7XgywIhYdIXzsEF480z9cS3WRUgwd8NmOHmYGZ/XvaerDTuc7UjyRNFwU/h4wcF8Ubmipvw2dA== 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=jiMupy/2gpTgAg4IecGGpHWMYbsCUu9rI2DrKBUHpxE=; b=HUMc24r8VX30CIhGXXDYczYM7rBNjzX8EnvSxkreGUP28PpDxXs2lzTfRbg7Hm88qKmQcAmA2yERb8R3KM/QRR/N0hSJQo6Aw8tiqwYDbAvrLbcWKZ1sLOoahi2tX34kHFxDv4NnmU/EQPQ1gdFnmv+JGU/KQC8ptA5yT3z4/OHpwxRn/C+KVX4wlWQaJ7q8+NSSNAirWu/p8GH4fCr3/sFeBBNnnQimkhIm1pPo6yFW6ehxtWLWZYzD93scHL6KbT+VCJRQVj150dNIzsOzSB14cOOC2uWX/uHFl1L+Ipcd5886ur2otIWeNABhar5GETaRGbMWufy+FTOK9MPzBQ== 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=jiMupy/2gpTgAg4IecGGpHWMYbsCUu9rI2DrKBUHpxE=; b=ftkvdvKQHITpamX/abaxDN8AeZeZRd/b/LjYBdiCNgSoFMKUeNgjvRz+VSy/nWkQ7kic5O7yuptqnLIf9a3f4hcS2yQwprIbADPGREnofAkFZreEcgYkOzWndtzhf/JzvPRZ/w5GzXh4YxcZeLa9WqrIG/vlRjLEOSRhxNnGcpWKz9xYrPWJ2SXYpzbwGrH8hc0XgpHKJHwqq0Zsn/bc1N3l2kG75aitHOtQ2O+Bpc2n2zo3QiNCWzMHb8oXRbc7f0bp2tNXxVruvtUdyxx8FTd6s549OKu3EpQKV9pRkFDt+nFfjtt/cB7rCe+0mHtxML65S0o69eRUtyFbsKYeUQ== 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 KL1PR0601MB5463.apcprd06.prod.outlook.com (2603:1096:820:c3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.25; Wed, 26 Jul 2023 04:02:37 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::732f:ea1d:45a1:1e0b]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::732f:ea1d:45a1:1e0b%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 04:02:37 +0000 From: Yangtao Li To: Wolfram Sang , Ulf Hansson Cc: Yangtao Li , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Geert Uytterhoeven , linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 57/61] mmc: renesas_sdhi: Convert to platform remove callback returning void Date: Wed, 26 Jul 2023 12:00:37 +0800 Message-Id: <20230726040041.26267-57-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230726040041.26267-1-frank.li@vivo.com> References: <20230726040041.26267-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR02CA0093.apcprd02.prod.outlook.com (2603:1096:4:90::33) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|KL1PR0601MB5463:EE_ X-MS-Office365-Filtering-Correlation-Id: b90602b0-d6f3-4a13-875a-08db8d8d25a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QHIaRm0sT/Rt7uqWItjN+37JinUhAOict0ZUhb04EfXXhzvgUNAWzEXReDWDsSI+jkbz/hEdfV+fhLBI+dsn4/5Fa3nIAPtgdzedzrQvPvgILqmiIMUr+qd5Ocal51jZGKqC7ElPNM6d6IeiejWMTpVw6netn6sAWbIIlnSyTRP5IvK8utwWx8TP6h6smA6Cr9LAWcUmPIRJDVLhxBGatQhvJ7fShFkHd+Kb1PXBqFAN2DOxdEM9o9cq6bAuh5o3xNy8DcxsApEe3G2vpE6fR0cQknfNugB2MlEbhDlHFA2Hv/0dw9Qc+ICgCdow3rbJIMn0hsRtTJD7b53kE2HFMQbAfYd2CpQ/JKCMFstWm5sZE3l89VeKQZQgCniuLJj8xjCiRU13PXTC3VRmALfkC53V/v4+BxVTtYXYch6vUZ24O+i1vcFkvfqwpOqW3YimkprhitH9B0h3ukklLowIJhglNYObvE4OTXK+QtZfynkfzxWaMm16ZJ2VcYsuPDSEq4db3z44gPOpLO39gX5gkunyMH0OyTj2H+kdsRGH8OgyTm0pVHSs5jPFY91oSqywp/oW3gHqaam7dbcvwRNadQevooajjE5ll3yOG9co0g1PYag3eRHtctaojywio1Bh 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)(39860400002)(346002)(366004)(376002)(136003)(451199021)(110136005)(54906003)(38350700002)(6512007)(38100700002)(52116002)(6486002)(478600001)(41300700001)(5660300002)(2616005)(8936002)(8676002)(66556008)(4326008)(66476007)(66946007)(316002)(186003)(83380400001)(6506007)(26005)(1076003)(86362001)(2906002)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?dVYS3EQqBuIEHasOYNlX9NZoNFym?= =?utf-8?q?DCFplmQQ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pbzsFZiyqGoXkvNEYwyT2D+h4lb+hjVJ7kOkuMwd5uV7Lpvc3504jcklgl3LE?= =?utf-8?q?ihk0062fVP2IeUdEu80aijrn/kohC5KrpB5w+1B1FaLHrqR+GqjRejncIhKLYy25x?= =?utf-8?q?NGoRuhIMxAP04xvn5Mot5OqtcHC/O8kvdO3sLRs46EzS7yxZQLe2gLD/oUilrskQx?= =?utf-8?q?2C+tFFarKt8/ld/90iAwie2BN7FQqslAd+mv+y+YMeshpKaHDqoH/6RB43bgiWnce?= =?utf-8?q?uDtPRyDU0DF42Y1UoDBDlXeATzrELg4JR96vmxQfioqKIsYBOKJQg62c/tAPU6asN?= =?utf-8?q?iBZiL7DMuLOBWe8OSqHo8/GCo7OTqn6zHl7FalHOdnDvP+5/sIILgNtjT343cp5hZ?= =?utf-8?q?ZhRJZJILiFasJcxO0JcXyRx+QoYrMfQErQpWW97emWyKcBBNKCTr+hka1/KykdCeK?= =?utf-8?q?QjMmCg+jYl63F8HJpwEtGidHwa4oGa0baZesaOituIA6sQVBtVIU5vJJ4Qiw8ITzb?= =?utf-8?q?WBrZMxWMaMBqg/nSzg8UxmhYIqp4IPwLwRQv1fHq4WQk+b7GLz0veWZgfpeTwj137?= =?utf-8?q?/PsjkckwUprQfxla/a1+kMhubhP2k1op6FtIDPnI+UMZrXEf6sB+L/FdcVxhTxQld?= =?utf-8?q?XFf4CP10QyAK?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b90602b0-d6f3-4a13-875a-08db8d8d25a4 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 04:02:36.5731 (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: rCqGkKw497mu31AtMfQiwIG1rAYpUBc/i/GD+y7Uu346FNYLXToBlpyGCO0ELRRWl9j2NrW6Ii8b05lyh8PRiw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB5463 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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 Reviewed-by: Geert Uytterhoeven --- drivers/mmc/host/renesas_sdhi.h | 2 +- drivers/mmc/host/renesas_sdhi_core.c | 4 +--- drivers/mmc/host/renesas_sdhi_internal_dmac.c | 2 +- drivers/mmc/host/renesas_sdhi_sys_dmac.c | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h index 68da3da9e2e5..c1fb9740eab0 100644 --- a/drivers/mmc/host/renesas_sdhi.h +++ b/drivers/mmc/host/renesas_sdhi.h @@ -101,5 +101,5 @@ int renesas_sdhi_probe(struct platform_device *pdev, const struct tmio_mmc_dma_ops *dma_ops, const struct renesas_sdhi_of_data *of_data, const struct renesas_sdhi_quirks *quirks); -int renesas_sdhi_remove(struct platform_device *pdev); +void renesas_sdhi_remove(struct platform_device *pdev); #endif diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c index 10dbdb4abc93..c675dec587ef 100644 --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c @@ -1149,15 +1149,13 @@ int renesas_sdhi_probe(struct platform_device *pdev, } EXPORT_SYMBOL_GPL(renesas_sdhi_probe); -int renesas_sdhi_remove(struct platform_device *pdev) +void renesas_sdhi_remove(struct platform_device *pdev) { struct tmio_mmc_host *host = platform_get_drvdata(pdev); tmio_mmc_host_remove(host); renesas_sdhi_clk_disable(host); tmio_mmc_host_free(host); - - return 0; } EXPORT_SYMBOL_GPL(renesas_sdhi_remove); diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c index 9ab813903b2c..d8efb8035b1f 100644 --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c @@ -609,7 +609,7 @@ static struct platform_driver renesas_internal_dmac_sdhi_driver = { .of_match_table = renesas_sdhi_internal_dmac_of_match, }, .probe = renesas_sdhi_internal_dmac_probe, - .remove = renesas_sdhi_remove, + .remove_new = renesas_sdhi_remove, }; module_platform_driver(renesas_internal_dmac_sdhi_driver); diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c b/drivers/mmc/host/renesas_sdhi_sys_dmac.c index b559ad38b667..248dfeef942a 100644 --- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c +++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c @@ -470,7 +470,7 @@ static struct platform_driver renesas_sys_dmac_sdhi_driver = { .of_match_table = renesas_sdhi_sys_dmac_of_match, }, .probe = renesas_sdhi_sys_dmac_probe, - .remove = renesas_sdhi_remove, + .remove_new = renesas_sdhi_remove, }; module_platform_driver(renesas_sys_dmac_sdhi_driver);