Message ID | 20230726040041.26267-60-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp179782vqo; Tue, 25 Jul 2023 22:02:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlHQ3yFojbJromfaUE+P30sRkYmKip5JWGXTVCj3n+PCKi/MDGUQiyHu5M4qHA1Irv+VzZdx X-Received: by 2002:a17:906:304e:b0:99b:caba:b029 with SMTP id d14-20020a170906304e00b0099bcabab029mr138225ejd.3.1690347757675; Tue, 25 Jul 2023 22:02:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690347757; cv=pass; d=google.com; s=arc-20160816; b=na25YR+Dd6/qZhhMcNmcRLsxzsFDTM3nEwg72bh8ZSnRxTIshLVaoeuLPKyPI/SPiJ RZ95Odhdow2NxY4luLRIs77f2Hm9BAMEoES7EmBIhWVXtpFE7+KMCHb7y3kzfTqIx47B +Yct5PPBCMLLkkj0bEYLBHep3EIJJWJ4XGjwE2hyttyVXBzC3lj/EQvGuHt41/O55bIT m1KxVXLhybxe1PEOabV0jeIxKhk8RoWUJuTDR2UuA7wtPtiLjsoSg5vamdPz8t5BwM0Q DoF7WS6lkYzGajvZqv9vekl8qGVLOXThOEhck303uKWvC1s8m6lQl9P/NMoV0P/OJhDr 2enQ== 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=E5kSZGu3d+Pk6TuHZ/mAu3D5XOULVl2/U1CyZRthij0=; fh=bJZZHQZH+VGE6F+8RE90TGtTwv5nTUcl0TOIcmRPvoA=; b=PBrPcwUh3tYboagYQ+cNtYKxm9F2/gnnB4B6YmpHCyrjNSX7i9G4P0WIjbX/owTLxJ Xj6ma54yTk7EpBqmp+fUUghXerFE/Ggrb5ehqJ3ennfq08rTCugutG798+UMub355fvp sri29HHSiaGSMFb99isuvGVsik35mQxglHMkcmqXXjzNkV9Scv9ISZRyohbMBEXzvOpS 2oIKXJmlmj5NNiYN5GnGyCxw+Ysb52DF4xHhln+WylZWQhVtbxrpaqoFOa7f5g8TRlqc mPH6pqy9Z8+VKWkT+HBe77Eu5QK8xq1RUoHjQj+LUZtEWVhm6Mravus2fXK9RmWKhOI4 H5/Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=OcfGKrzD; 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 a23-20020a170906369700b0099396546ffesi8590041ejc.768.2023.07.25.22.02.14; Tue, 25 Jul 2023 22:02:37 -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=OcfGKrzD; 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 S231837AbjGZEMA (ORCPT <rfc822;kautuk.consul.80@gmail.com> + 99 others); Wed, 26 Jul 2023 00:12:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231672AbjGZELS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Jul 2023 00:11:18 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on20726.outbound.protection.outlook.com [IPv6:2a01:111:f400:feab::726]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 206B22723; Tue, 25 Jul 2023 21:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LZzz2k23tY9E9DkzcFRmbjaNpQrBOTGkJRenj75ZDKzKnDndjCmTNKIVU7/4XAbD6eFXQwut8qnbDrRokFHPaZW1zfKD/+/1ykS0Nt2y2Fc5zvcbqGdZhuhFKseMvlC4vhS+ENQXD2yEeZW4j94XDEidEM8tkYfKdH9EGksnCSWOPga04iLO2QRZZOSL4UgSBr3nKzr/wbbCae2QcoWu3MYaubo92NvQdo8tJhCv/9Q1hZnrIwrVIeD3rGy19YY7pAFa1pJEiRYxFmGEUuTn2woBkQacOqbS0upnMrxEFwqyRi8E/bKfFrIDKV7lLt2eewdGBDWcxWzkM1NuI+6jPg== 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=E5kSZGu3d+Pk6TuHZ/mAu3D5XOULVl2/U1CyZRthij0=; b=V3YF1yyS4ud2582uxEVjvzBC72F55wDH35VNgUix9Pvmcz4jPVryupf6LISrmNIDGBRTmSHxsnKxNLUdWtAwvJg1pHTfOSMn2k+OCLaoA49M+XXTiL64N4hG7/dnXaPW4OUwPwL9RD4X1Kod9IkDMCj1Jv/2scL5SMCRbNlxEXKcxXaraguFak2Y8XzUnibzzaI08YqXsC0wcYVnEtWHdw+FOdUyvyQlchblJDkoHHOhFY5whAgVv+P2qqXHbydL5JRGHBmC0uMLy8GHOsAoTaQ3HzeXAoShLZlV+YdpntTx9/Y7Qf+2fezeQ0wewByQavAO6qPFTEdYWe0e345ktw== 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=E5kSZGu3d+Pk6TuHZ/mAu3D5XOULVl2/U1CyZRthij0=; b=OcfGKrzDfFmG+sNI0yjO9px+fioRXDMmfy2PgFfKCu8Yhq6zCV7/bD3hl9JE6LPYTW7wyfOhMJcBU2o9Da+TGPq8hdsMbCcJc1E5jlrRQDFHGP9m617f0yksojjO0VoVhTE1AO8en1it1LG6AIDoVTEKLlvCYlEjjcmdK0SHt1KsBecEXEgqYqHLdLS74ODlIMaoiGgRmMVaOoU4k93Lk3fd5Wk2vx4yAp8H8e4FSJJ+e0NpyTC3pmqmefYORtBS7wlAjcRFCVvuDkRU1j1aXKdibJlWUU3NMqq0gqYtxB2Bkr+uOS+C/VnRURuJtWjcx9Ybgg8LGxVyu2gw5hvfnQ== 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:43 +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:43 +0000 From: Yangtao Li <frank.li@vivo.com> To: Adrian Hunter <adrian.hunter@intel.com>, 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 60/61] mmc: sdhci_am654: Properly handle failures in .remove() Date: Wed, 26 Jul 2023 12:00:40 +0800 Message-Id: <20230726040041.26267-60-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_|KL1PR0601MB5463:EE_ X-MS-Office365-Filtering-Correlation-Id: 299dbdc6-bba1-4a3a-b0e3-08db8d8d29ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BjGX8+A+3DlKQM0PJnERwdyS1WGD5sKBYnpy2C48ArFo/Zez1KoBN56+dBIFjNU1ZqSR/M0PW4vtE4GOX1QFydUcjQOq9QISNJ/wmee9dvbWX4mnDIzys3G6yBa2I/CCarwechGswChtj9X/RjhsWeBnXWyMIQ74BfIp/1LzdaiAl3Yzs5hErdsMGnhOtWr6sKE2WGPnEG+OEseDQo53bVX50Aaccuyy7ZUS14gHEgU6rfbWBAYC7uh+4ONJxgZVDCtTEnQ0HE1A+/IhcMRHdbQq+m0Niz6aHZwLfyM2cHA0p54FVoVTFRwBW+EjrFmCaBrRTI8T5R2EayDxdz6jG9DPKNAjM7+My3f7J3eRhNVsBxx3VhEELMwzQ1hceYRPb4/+p6ngk+wRIYV2dyhOEuCNG3vblxUUYQlunDp3tM/FVtmNvsqjz5CZJ5CeyONbRG+UOYvkpv/fxGhDXC3D9XVhYiWhaThxzFYN6QTADzmXVb5uwilggNFBI6jdnw9CeuYgT+ZU/8nThEF69PDaB/qmsDvWg3lu3iS2N7RcZXLt3rq0QZj0DWKWQtpZKeuarXpwhQAquZV9B3iVX0rxG9oBjkkZ6KwUQZXDT7UorMzqTQ0Z4shI/NLytFnXMvq4Xflvf4syEWDQUO+QLU61GA== 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)(4744005)(2906002)(36756003)(142923001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?vTYNiWug5Rh3swS946ANa/1ZsOdw?= =?utf-8?q?m1lqbFET3ClSQo8Ro/GSFAbovWaMMa5KL2+DRT0hkqmn0C39kA3zeRTRtZFO52I52?= =?utf-8?q?NeswSXat2nA1kyStfS4XhGvqcVoQj7RqDo0/7s4PQjQEQwcXvh272fXlvCc3PMmBV?= =?utf-8?q?l5yLa7bMjyJeZxSdxY2gODQSVFrIqBUp+z9ehdohL3e3XlRKN6q9wkN6QJ9M1+Gu+?= =?utf-8?q?YC05vSmZPBM6AdJb7RGafpUBRvE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6aAJis+Jciik0VLzlWBaLxyQGHhVsN19uLo?= =?utf-8?q?dsPa0+snX5yZPjsVKmycKkDJj75HsRJ6xA1ReeHIsNW2WLc938KsxP+9snhBouL1o?= =?utf-8?q?8r0VpcaVJPePbbFhgg3k8AXqjRyXEmwpuSOUEFUBC7epy05Aw8CBa6dktjtAm3l5Y?= =?utf-8?q?Dt3mf8cB5QcdEecOawTp80FJ85tMyRWtnQ5+r/8bCFznEfl+uawnsywBPsoScfIIz?= =?utf-8?q?3V03p3w3iTZFGc2pYG5wvNBr3hmB1AojmaxFyF4lK1iiIr6hy00C9w1MfWNOWzlJw?= =?utf-8?q?cTCB2Zt1sXthhu4/ajNCo72He2piV76aOe1/n3ldVqdHyFIyUjWF5brTMtjQPyMV6?= =?utf-8?q?7bC22L37D866Nsz7TF/i1yLJe+wzGVqduIfNruVwk8tofhapwjeEAN8bemQeWwPBA?= =?utf-8?q?I3ZUihzjT97w?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 299dbdc6-bba1-4a3a-b0e3-08db8d8d29ac 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:43.4139 (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: nzmImaRH4xntLXGWw0CUzhdvlLw31KrdFlRZ/rj7c9dTox1fVRrvKlo3NVKBaaE16qUcard734UTY14HwK+gRw== 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772458090559113637 X-GMAIL-MSGID: 1772458090559113637 |
Series |
[v2,01/61] mmc: sunxi: Convert to platform remove callback returning void
|
|
Commit Message
李扬韬
July 26, 2023, 4 a.m. UTC
Returning an error code in a platform driver's remove function is wrong
most of the time and there is an effort to make the callback return
void. To prepare this rework the function not to exit early.
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/mmc/host/sdhci_am654.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On Wed, Jul 26, 2023 at 12:00:40PM +0800, Yangtao Li wrote: > Returning an error code in a platform driver's remove function is wrong > most of the time and there is an effort to make the callback return > void. To prepare this rework the function not to exit early. > > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > Signed-off-by: Yangtao Li <frank.li@vivo.com> > --- > drivers/mmc/host/sdhci_am654.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c > index 7cdf0f54e3a5..abe83736d396 100644 > --- a/drivers/mmc/host/sdhci_am654.c > +++ b/drivers/mmc/host/sdhci_am654.c > @@ -873,8 +873,7 @@ static int sdhci_am654_remove(struct platform_device *pdev) > int ret; > > ret = pm_runtime_resume_and_get(&pdev->dev); > - if (ret < 0) > - return ret; > + WARN_ON(ret < 0); You must use pm_runtime_get_sync() instead of pm_runtime_resume_and_get() here because in the error case pm_runtime_resume_and_get() already calls pm_runtime_put_noidle() which is repeated here in this driver. Also WARN_ON is a pretty big hammer, I'd go with a dev_err() instead. Best regards Uwe
diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c index 7cdf0f54e3a5..abe83736d396 100644 --- a/drivers/mmc/host/sdhci_am654.c +++ b/drivers/mmc/host/sdhci_am654.c @@ -873,8 +873,7 @@ static int sdhci_am654_remove(struct platform_device *pdev) int ret; ret = pm_runtime_resume_and_get(&pdev->dev); - if (ret < 0) - return ret; + WARN_ON(ret < 0); sdhci_remove_host(host, true); clk_disable_unprepare(pltfm_host->clk);