From patchwork Wed Jul 26 03:59:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13327422 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F372C00528 for ; Wed, 26 Jul 2023 04:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0PMUwGYkEKhi1gyynW+rXvAujgXDga934Imb0yL8Frc=; b=Q5TgoeNqrkJvHJpwtd0ysZuVm/ ZX7F5ecDDf6x+13JAjZBCvKikD2eFoEz4b0ujqAZPDayLBrrSYmZ+2HRbYMMCfXNInz9l8HjqQP9x b4unZ3PvD8rtDebraCkTXENYV8AwFAYZbQ/A0FzBBzCrtyudKpPZF1/gOrb0+bzN91VPkC6Qe+YFr HdtxnCOdvVn1fUQ1mSY7951oxeWdDKD53Pg/BT/LwVyjANkn+0kZq4t7sv3Ld/DKshy4GyEI/bQtf oQhG+b6aDMZ/h16ZK9nTShpXpd0ArWMcWQhGmoDLqdGHynfDNVF8LjYZzsmshnJbOwMZgLn0OzvrQ hsRxGpZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOViG-0093tI-0w; Wed, 26 Jul 2023 04:01:24 +0000 Received: from mail-sgaapc01on2072e.outbound.protection.outlook.com ([2a01:111:f400:feab::72e] helo=APC01-SG2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOVi6-0093pP-27; Wed, 26 Jul 2023 04:01:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CIZNJ2dmw1kuwuXxsa/wsxWmteNuj1oA435azdHPwkdUp46zcf4YeXosHmwNmCtIVW69UEjEr6sU05q+rkGJLQNagyha53EmWxUNh5H4ASvDLonhDrknfbXQ/cMAq3YLeEyNboe7bqMjPgtetHjJ0tDFXsF6MfdGjxFTyg5QMtAOsGWri2M1PIsrxRfSHND5KzIE8QnjXwW6mltyVwQ5naUgm/s5d9uVUQJRMZofiQODjWPQ3O0VDc+nenO5Op3r9wNb1VrZE5JxWqBzUo4ceofJbGHVx9XV4ltFzarD+1jUmZ9gOZeGrKdeq2+N1bkn9g+SQFHZdIfDLj/8C0J1DQ== 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=0PMUwGYkEKhi1gyynW+rXvAujgXDga934Imb0yL8Frc=; b=A0Str+HIRj1Ju405oRMRbeE/fFh5eHZ0Cc9CoKw6FXr9rvBm+DlQLtgdbN0kV6H7QaD47xOlxpIVA+yHqUoQAmWIpbnx2awt1976r2Yw5HKCocMMdfJwN5akhVeHnk14DO0I+0oFxkfaesp9BPi3DSpmxb4jTfKdcI1ong63VnH9lNJvdvXg9cFiuvt4k7uhdH67kltO51zBr0uI2ndnEN+fOwlpfHFlrEIwTrUWrpomh0YHT93t9D4XJNYG1hljUUkBVoclbTkJnluwiNA0ckV3Bsyb0hiZlLUFXMqpJ5wUtR1sy4szawl0ILU5YmrXGQg/genEiKEHQqDs4oODew== 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=0PMUwGYkEKhi1gyynW+rXvAujgXDga934Imb0yL8Frc=; b=pQB+MZ/hUNndkc0XceidJ8s5uhNTr7KbDSYxvS/iUlwtLqwQoU61F7vIxKOaJ7WyIahZSIIsFYBza0vuffcadysU/VhLDxJ4uZ1l+zYzrvU+Q7Pv3hff6e7EU804KGhSUFCi3y+GIx8XbaihBkrMFzTkuojHbvdZnBqy3TZ9yYYBrQUe4cyXEJTcN/C4gzRMOdVnzAwmbOxeWjcJomFV8iyPmpMpN5iou73IFqsxakX4PggpBQb8OubEy+EFLV3uxEULvYaeRexGpdWOrjbuZWPNzxVUZ+x51qUuPYivI8W/RNTOCs/m5u7JZbJMOWGenZLHuFmj7em7N9U008S45Q== 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:01:06 +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:06 +0000 From: Yangtao Li To: Chaotian Jing , Ulf Hansson , Matthias Brugger , AngeloGioacchino Del Regno Cc: Yangtao Li , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2 05/61] mmc: mtk-sd: Convert to platform remove callback returning void Date: Wed, 26 Jul 2023 11:59:45 +0800 Message-Id: <20230726040041.26267-5-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: 1d643e5c-2e1d-401c-85a2-08db8d8cefc6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HaOqApf+ukmv648gwx0JxCMO0Yh/BL5daVNCa3kOr/LUviSCceKs+V86zPSkOvbs5XHtEWnnO7lOoIQjmjUJtZorF20BngoE96i2qdfUZhIFx8mdwOAPQU4mClRRuC1kpGuedg14oLlcSkOu9Vm0njuodtcsg7RaMQ1pUg5rJTT5epcBDi9OIvZ1cjBdWoh/ZTV4LiNcgL1M88Eai8F8YZbKJeGumtxIDeMFuhh9OF7A9Z69YcrmFRKLJdJknpiVc129Yg0aSgQl7Fe3xNN8nndr6GDpFSaKf6dGfNG5JLD6UAtvn0X2KIjWnETh3PegQAdtwU3OSB1tzZ7euOzGdq/1TgUYXK74ki5ZPYQ6ptzW6e6xzc6uFKTgGIzDgRhwxje0tNYC2lGIK6cmOIByYF/z4tw9B9YRNkF5GWN7T4M/hpMN/Q27K3DL0nDvMuVbuNddtpeikS48RVukB8J0oZkt69qEmPC/5bG6/K6oavi4R6XprR3GQHovOWjOmiExAvpi1D3XBea7Lawkb/hxilt1dfyxK90uv+o19KRaElkRpwoyFQTCT/WPd+a1O14CeJjiFHE5ePWjCU3sb1zAckqlkkZHK7WlvZjO8RUUUtOojHQeGeZpSX+j8KaNbSPC 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)(6666004)(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?Ct4L4dFDx9k3AUL0f2k1Kzil2RQg?= =?utf-8?q?tuEu/5wSt5ZS8j3Bpk/Z8nUDLyYNMrJti5yll8vbBAnbS0YpgNJWFJCAfLq3aXrAL?= =?utf-8?q?x65PO8SEDVRROgXEs+JR+KyrnHbLEIMZOhZFVTzPrFwlhE50nq0853thYJXJP+ObQ?= =?utf-8?q?EndxTi2Ff5YO3vtRuDu7ncWI5qEhmjCRt3MfXZleZcFoq3cAUqTcCuF0b8fJRrK+C?= =?utf-8?q?4OKkCuMRIW750UAjt/Q8FKyB8YkBM9vsGeoYQ1m/lrvaNmxcrKzHFTNTg2oHwQdye?= =?utf-8?q?VBT6yAU2vUw3ZpawoaNYyFqsvyTTl6B/1Iskv4YfGpZqLJvLp+pkQZPJB6MOhNErJ?= =?utf-8?q?BmsIT/OkiJLUYDwIzbSNzSGhVGZ7wGlUde5SS2xTvt4ItWzsvnqXUd7hu7IJ5eArJ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XSdF8/ooX?= =?utf-8?q?s3ba6RT1hMGSDJCevYl1Y8yuHIaQqqi5n6voUf7jEX+v3fQzjRcO1PVYtpyIse7Lc?= =?utf-8?q?77AKHNp3+9yckQYc8KwyhWEdUwvMokdKW1CshDJ/vvbexPIHfPXjtiMyy2sSR9q2Q?= =?utf-8?q?XrKhCRaOXXoNcDOEnYa6g/Ds+AbzgylsYZMQ+rVwbYkB3cq1QKEvxkVn2W0Ld6zOu?= =?utf-8?q?qxAJUXoX3alghOhwBqNByCVMSD9FT9vXyfRlsRPIAijr2Kh3m1Cpn2e1RW3gEOmgM?= =?utf-8?q?YngDMw8GEB/6?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d643e5c-2e1d-401c-85a2-08db8d8cefc6 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:06.1981 (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: fBKvOtL1ahBw1U8E2FSAEu4ZeyAnIikVrqxYA6VSG2+YPWbzb8TuKLq4foqcTY2jn4uDOJaO1EB/3oQOEyYJFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB5463 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230725_210114_701358_860E9E36 X-CRM114-Status: GOOD ( 16.08 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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: AngeloGioacchino Del Regno --- drivers/mmc/host/mtk-sd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 02403ff99e0d..9e2debd1edbe 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2887,7 +2887,7 @@ static int msdc_drv_probe(struct platform_device *pdev) return ret; } -static int msdc_drv_remove(struct platform_device *pdev) +static void msdc_drv_remove(struct platform_device *pdev) { struct mmc_host *mmc; struct msdc_host *host; @@ -2911,8 +2911,6 @@ static int msdc_drv_remove(struct platform_device *pdev) host->dma.bd, host->dma.bd_addr); mmc_free_host(mmc); - - return 0; } static void msdc_save_reg(struct msdc_host *host) @@ -3054,7 +3052,7 @@ static const struct dev_pm_ops msdc_dev_pm_ops = { static struct platform_driver mt_msdc_driver = { .probe = msdc_drv_probe, - .remove = msdc_drv_remove, + .remove_new = msdc_drv_remove, .driver = { .name = "mtk-msdc", .probe_type = PROBE_PREFER_ASYNCHRONOUS,