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: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 126086 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp177365vqo; Tue, 25 Jul 2023 21:55:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlG4612K/p82d/j8nFbOCoUCGrTecYm4H5YqitwFFQffkSXCg24yhULGD5ZY4GJ6xeGJZ3Q0 X-Received: by 2002:a05:6512:1106:b0:4fb:89f5:f6d2 with SMTP id l6-20020a056512110600b004fb89f5f6d2mr746191lfg.47.1690347322133; Tue, 25 Jul 2023 21:55:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690347322; cv=pass; d=google.com; s=arc-20160816; b=A3SuaDQybzwvFm1ob0iz9HRTd0oG5G4/xtkksRb1EfixLYkFofPo3BU/xcWuR84r8Y GqnCQ0YcIadKwtsLTkRrEGv4MItw5KfytMcouYAl6hLaJVM9mzHga8fFoCSYYALEsXKy Nq80PkZppNMjSEuOJif8y7BrvtsK5GpGvegyDv4WbptpdosRRJKkoV3/sLpCrYBvaBjJ rW4r16D4YkuI7lt+o2D632BYJLfSMlBb7Ke0fhhmH4X3wAYktJ9otcY1sb+XlrP9PQyK S0K1V9lwbcPIOsCorTIzr+Hd+vyBjnzn4bIEMc2svMLhSj83QFAceVG/lV4ektmcV7oR dZmQ== 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=jiMupy/2gpTgAg4IecGGpHWMYbsCUu9rI2DrKBUHpxE=; fh=qaoyuzCS9Qfot0ptYzM89NjDvwtd+S0K0JfQxr5yr94=; b=PRpkFYyCnNCyEK1Mtm80IRiVrvMjzvf95T4urad94aBwL2T7gyu5oX3X/r5D0SZjMy lwF9viNpt6dG6x02+6pxL7h0uunm/PblGTslp6wyplIW1/MYXvFRCh9ZVA/y3rSytkzn /cL3sk2jOSkHCe5VC8hJQ+OxYpi1/MFvwq7dEQ8xwhfCtFmNsP0qEV1bF+7S0maBZ8HO gT5F4ZHAxT3fKxlNSZtafWXa1WuM9d1bMmGvawKq1ZyQpgRapSpf6fA9gG++gQxNCMYs /2f9L0rCKY5RGfbp9LHKnYAMZsQBb745v+D5BgIwg4U0xPYMzst/HqrJpqGAeda6IyPx QlLw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=ftkvdvKQ; 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 e4-20020a056402088400b0052256c7633asi1418433edy.9.2023.07.25.21.54.58; Tue, 25 Jul 2023 21:55:22 -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=ftkvdvKQ; 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 S231561AbjGZELZ (ORCPT + 99 others); Wed, 26 Jul 2023 00:11:25 -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?DCFplmQQYaZFv+dYQbPyIZLYKQPKhvfhHQhJDdIGle3wsFf8fBjLz0bJOfhVKOcWA?= =?utf-8?q?wg15ea20CCT1oL1WutnJ2/W2PQGulWnWf7y8nRKc8cp7F7yfOZGRuD3o8KQnYhJgK?= =?utf-8?q?U3pFCc514Dx0QDzIe7trIdAYgTSrPDpwDAUewL1BR2oCi9s7XKdr4ar/Dj8xMsQji?= =?utf-8?q?CrDfO/TRqDrEZvCU2qU2JEh+67GwqVr0ZgWEAm3LagywBcd5t4Fqc+qgDhkdKv1Un?= =?utf-8?q?baJIadQXZlXLVQBL+tdD3oP3xq9B6cOHmXPIuq1xH/5Mukln97Zt8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N?= =?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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: 1772457633700099296 X-GMAIL-MSGID: 1772457633700099296 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);