Message ID | 20230726040041.26267-23-frank.li@vivo.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-mmc-owner@vger.kernel.org> 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 4F0AEC001DE for <linux-mmc@archiver.kernel.org>; Wed, 26 Jul 2023 04:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231672AbjGZEFc (ORCPT <rfc822;linux-mmc@archiver.kernel.org>); Wed, 26 Jul 2023 00:05:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231671AbjGZEEn (ORCPT <rfc822;linux-mmc@vger.kernel.org>); Wed, 26 Jul 2023 00:04:43 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2120.outbound.protection.outlook.com [40.107.117.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2101D469C; Tue, 25 Jul 2023 21:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fLfu9+Qs/BNPffXQB/Dp3MMPWkVYDSDbojNbyWJqyS/ajwWlLXsTD9NDINuNH3raoPTkuOePmUoHeciG2UWeCGWQ7cmLjMwXN0//9TzOSpQoNGza1ppozw0RZzQj+TRMlaHRuxzoIX2J56Nh6+S+eonPTTM362+iyAaRQkF7lRgH4F8FwDWxj6qic2Y694XCZF3mxWTvizHCweJWIeDpZ3sD4ICVzZy76gNT2yViKQQ84MfUk0wl1tSa4LWIzvHORkm1SIpR2VEt/+1kOuZWD/hIcJrN4Ccpv09N/wzClh02LxwqqnOMkOFJ0jdaELrCBqNwTBBGYPhm321xTb7FHg== 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=9QwyjiAPoUwvuuL+fTQzivWNofmwHauOj0YWTiKbAgA=; b=PkH+X9z7iwL26R28YXdG16DtJ1d5+jzCrK44jy9TjvIpq3GRDXzkfiAiNw8Xj8ike+RZgq7Dk1RdpFc4I/ZGIQzP4fVDPYWQVlA4mTRiNBbjsPkObKPr9FcZ6wvC+MDW60ws+1VIMFD4zvXm0Y9zH2RsY+0QnvyIl5oVmWDVzfOK1VdkuLg9CcHAKy8VkVqN1gda2kug1bSWMLMIffk/oweOA1JzNl79Q55FdN04BMHGH1vJhL2rSIlX3REtp2j6yH4IiEMNr/WIyUpUnuTHEIc4t+1is2rd+VupH6bBiA/OFkqm4vQnBt5K/iZ9l2BkyyrGZ1umTN/2tnKLCTceQw== 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=9QwyjiAPoUwvuuL+fTQzivWNofmwHauOj0YWTiKbAgA=; b=Q845ViZ17YoLnlQCaht+nsTaVOyqWtnXWG1VPVtYYTcRFUrTk1TafAic3gxXvibninb/Z6p1bVhCh81laf/DpmqOwJMcvRprvZFm7pdD78nwUMyZe51YVCUhGEr26nm1ZgO715Ietd5gCGOx8ERqiVBIOn9RpCub5WHPhii2vIrhbg4zSYmT9HYLRzm4N7Cf/nylsK3n/t+SyQ8sgOygYnSKJRMqIr/BKzppAKmNvyzH26GtO5TOWChB+hkK2bIhGBH5FaHnV0fOB4pN510rP1aLdlFzoZnF7MIJe8+U1Ssc/C1+QgI1I+4puv/Vxe5ZSx9J1uU+caRIG6Cje7LwLw== 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 TYZPR06MB3934.apcprd06.prod.outlook.com (2603:1096:400:7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Wed, 26 Jul 2023 04:01:38 +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:01:38 +0000 From: Yangtao Li <frank.li@vivo.com> To: Ulf Hansson <ulf.hansson@linaro.org> Cc: Yangtao Li <frank.li@vivo.com>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 23/61] mmc: rtsx_usb_sdmmc: Convert to platform remove callback returning void Date: Wed, 26 Jul 2023 12:00:03 +0800 Message-Id: <20230726040041.26267-23-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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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_|TYZPR06MB3934:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d669155-5e32-4496-70fc-08db8d8d02f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lk6DxO98cHo1SC4UIUtEU8zZsAxOxN6uVxkAlf+rnZgNmWmVA9D9j2CsL8crFDIMTTZIbJDI4hbyy7ipkJBlnj5piTC0rAjnwCPEFSHupv5YoRGgKBVOHPUNud5oC3Rkjvr7/KlikXyu1EbZ/vqyJ5Eydnbrj+JrdL/y1ljAa/WnLCiMRy+oNxiX+wogZb60R9SqYAUyq++o6PODLs+jKG4wBkRCdS/4k05Z4vZmq/lA2I1xAWzJYqYEZhBk2vZVZB00Ak6wvqR8F36Tm1UTzoDfW5MJ9vBYyZd3rBLEKvdUUrEcxv7epjPcktyIZd3mOpGVQFlqdl6hWvPYc80reUhkhR/V0tfDY6GdOF3m3jhkBmWUbu+KY4lQM4D2vLqLw8g9r4My9gRVLVddvuCzWkQPEolwjYb9+m38/viqOpOV0cZJl8Nhlerv2psf6S3HA28sypBmuGyYYJg7ZcfSU/Z585rhDd/6cnw2r3OeLTijrpk4loqRaUcF56KueGQwYdI56+dI8LlIcUXDjZa2G7F0e9TO0rvPDQmCfkaS4ebcKeFMqnKH9VTptpPW+JLr1oSe3tlgvI6MRn6eXCzywoSO34SBGEwgx5xiMzY5oG58J7YtJyOd1EXv/wgNMwcR 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)(396003)(346002)(39860400002)(366004)(136003)(451199021)(66946007)(66556008)(83380400001)(2616005)(41300700001)(38100700002)(38350700002)(86362001)(36756003)(8936002)(8676002)(5660300002)(478600001)(6486002)(52116002)(54906003)(66476007)(316002)(6916009)(4326008)(6666004)(2906002)(6512007)(1076003)(186003)(26005)(6506007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData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e9bCST8rGn3hUB9DFaxDFFRwHG7/9uetxQuNE/0pmx0Y8/rZ3?= =?utf-8?q?U8yAh/t7ejxCOQFs55/11sEvd7Ipp6Wcs4F7c3GkVVr8y/3UyTqI4SrUawutBSeD2?= =?utf-8?q?dDtn/qwCD4jvvMNYQv1BUkwDJDF43kRgerJQLercrBFaCPIpCc8jt8OB5oTkbcHW7?= =?utf-8?q?EBlE2YoK0FQgLNNYJcAAqGTNUssmZAJcZoh3+uwOUQPM3lX+fc4rILfVIcVnUHcuB?= =?utf-8?q?wVwa1qroFrczNsO2H/2CoNy437crHnvbMsM+KefRXFUyMnORAfkaJFmiOGsmtayaI?= =?utf-8?q?fkVvcNTwSzTvX+D5SJnHzPhmbTlhyKSKWgz0yeTchhnvUpYTR6yjq+KBnWWRvPWr3?= =?utf-8?q?e2ZJrY34CkyuqAglTtgaluqdoyT5C9hl1ZN2uleE1WroNl4dujRKCGrGWkGy4sdwJ?= =?utf-8?q?MXEyjQ26MAdxhrass2u0b+phUcNKulrVtmwfoMg1Kzy2xWHUDY0ibkrLwmMeQw1Ph?= =?utf-8?q?fi3WDgWUqZ2CFyapLq+09vGG2WFai+lvfV3K3tppy2dqWr8APH79kbK90WI5JkqBO?= =?utf-8?q?NqjiWb27A48g2co2AN6WwP9njwR5sLQJE8ZZ2bL+gd14C9/13RvQH4eklo5M1lwv7?= =?utf-8?q?xiFVeGkPjOqwJI518ExC1PfcZGIb73lu7wx86H4NUysr9+htgjwBdjlcOwAoyJ9cu?= =?utf-8?q?snX0BiLMtGAJ?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d669155-5e32-4496-70fc-08db8d8d02f7 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:01:38.4419 (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: 651XlgwWR74ma3d+owc5ldBzFPf9etPZI4iC4e0qSDNJ9HwD+RVQoaV68nEZRpCUZEOmG3cTpuIfiRjS/bIaig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB3934 Precedence: bulk List-ID: <linux-mmc.vger.kernel.org> X-Mailing-List: linux-mmc@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c index 2c650cd58693..ded9b6849e35 100644 --- a/drivers/mmc/host/rtsx_usb_sdmmc.c +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c @@ -1379,13 +1379,13 @@ static int rtsx_usb_sdmmc_drv_probe(struct platform_device *pdev) return 0; } -static int rtsx_usb_sdmmc_drv_remove(struct platform_device *pdev) +static void rtsx_usb_sdmmc_drv_remove(struct platform_device *pdev) { struct rtsx_usb_sdmmc *host = platform_get_drvdata(pdev); struct mmc_host *mmc; if (!host) - return 0; + return; mmc = host->mmc; host->host_removal = true; @@ -1415,8 +1415,6 @@ static int rtsx_usb_sdmmc_drv_remove(struct platform_device *pdev) dev_dbg(&(pdev->dev), ": Realtek USB SD/MMC module has been removed\n"); - - return 0; } #ifdef CONFIG_PM @@ -1455,7 +1453,7 @@ MODULE_DEVICE_TABLE(platform, rtsx_usb_sdmmc_ids); static struct platform_driver rtsx_usb_sdmmc_driver = { .probe = rtsx_usb_sdmmc_drv_probe, - .remove = rtsx_usb_sdmmc_drv_remove, + .remove_new = rtsx_usb_sdmmc_drv_remove, .id_table = rtsx_usb_sdmmc_ids, .driver = { .name = "rtsx_usb_sdmmc",
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 <u.kleine-koenig@pengutronix.de> Signed-off-by: Yangtao Li <frank.li@vivo.com> --- drivers/mmc/host/rtsx_usb_sdmmc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)