Message ID | 20230727070051.17778-59-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 B7D19C001E0 for <linux-mmc@archiver.kernel.org>; Thu, 27 Jul 2023 07:08:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231691AbjG0HIc (ORCPT <rfc822;linux-mmc@archiver.kernel.org>); Thu, 27 Jul 2023 03:08:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232101AbjG0HHq (ORCPT <rfc822;linux-mmc@vger.kernel.org>); Thu, 27 Jul 2023 03:07:46 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2090.outbound.protection.outlook.com [40.107.215.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09C69E0; Thu, 27 Jul 2023 00:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KZmCHmTEMhCbD/7vGHr9vp+LZfBMVDQ0yZT+g8Z2P2gLjnc59IWiuCamZV9YNugSzw+gU+hjSZUWrkboCfhflm0U5mgNXOU/BtsgzhWfLw7zIKt7peaW8l2HPEtu8MdMP81Xe1n+aHIF0Nj/KO3OvwEq9ud4MqMnI9a06tjYCboGaNCXTggS6qUNI72QCZGCzowIGKWpXLDzM1ALBbMXJhGbCR16AaOSaALPiKoWgbRcyguTHzpvap/OVjJbFyI7cBxOQQgOKP7cqsNb6rzLEuM22TgLAr3rGVXWLSGq+IUzJAV22nW8eOrEjaUmjuBRYn0dLmYSU/byGVORJlTCLw== 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=9Wq3D3MP18gp00gViiexlDEzaE6ODfTIsN21lyfNhC4=; b=UUZXl0TwLfLyAZ+KilbasVyAOgFFfmPpr5faEK48dk5wIo2JtUwWMyMoxkmGPECyQ04gJHGptDI9H9k2laTuxtTBc87094gREnbLHFpWPfhweQCNmWjrJeYU/BSrDbe3a5WAq6rI8Y1RvS5tEkxVVcdWoJ4qigxQDZZ8WdfixmxpFwD3TZPikbrBsCbgkeMAWi5z45haCsvYkhLFwhKRSFMCeBLPz7/Lreu52sUGz3q2LK8Ly1NZtd9bDgAxU8oB9kTU5O2APotOBIGlHldcwQB5pe5Lze8vABSLS/3AKKEVHGofoNv/YZw1wxXqft4XVaZgIHcUF/GlV9BZepG0Vw== 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=9Wq3D3MP18gp00gViiexlDEzaE6ODfTIsN21lyfNhC4=; b=iDNb0JaUjEm0NE71hxkwX13JWMSchrNaExE9DOq9ZClKM2jXmifaQWUZIva4pTjjuXTkDXEPU3wg0N2ALlJChPDu5gVkNFrfrYg/JlyXNrv/PrmMNxfGPLuw4IXGfeKqpnWqCbafyLiyen2b9tELGklHF4fSmq4q/crm3vZwS2gOo2fgTgYlmunbyIhZkfWg24pqMgoLN1ODF5dGMXRbf5XY78pMql7cepa64e8OfH5N8lyrWKtWZt2/+VSdYVwVpHL6olDxG4U6BpPyD109KV2etOk69L9eJX5KYy859wkg16Ct25PSuFhqZTV3/PZOny05wPOFnw3A+BRHBTVl7g== 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 PSAPR06MB4152.apcprd06.prod.outlook.com (2603:1096:301:34::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul 2023 07:02:46 +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; Thu, 27 Jul 2023 07:02:46 +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 v3 59/62] mmc: sdhci_am654: Properly handle failures in .remove() Date: Thu, 27 Jul 2023 15:00:48 +0800 Message-Id: <20230727070051.17778-59-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230727070051.17778-1-frank.li@vivo.com> References: <20230727070051.17778-1-frank.li@vivo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2P153CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::10) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|PSAPR06MB4152:EE_ X-MS-Office365-Filtering-Correlation-Id: afaafa2a-a1df-406b-e7c6-08db8e6f798a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZcWnBz+gIw8bqywvX1/HTp4Y21SGp1Tr8MvJ4F+brgQ06W8fQiYBfZj1/LBz/yq+Ok7i6+S4NqoeRChZo1zFBJEuJso/dZyb9NZxmhRIjLvkVM44FC+BRc2qYt7Eql2MRnSQ+mk4TVsIMICg3s9rBZ2S5oPAHFE9clznVHHJmnyIVaOMZ2v/XytLHLoQunWWEaa4wylF0tM7TKgCbiaidnEbZz7LgQz0Zpq60sb+njoTiuVF4hDKWyGQmF73jblEVl3DVLIavhhoClZecTEvTZ8LHapiWQ/yUgykcUQuSRUIoRU8Ks3CNIui9U+ghGCY1H+meZqecsWdyHrE1E1eJA965FJBXa3nFQCkBrMe52/xSgmb+vPO34Ui6FBSltrycY5/EHNFhykgOuZwb0vEIaeVtI2wHqVTzqPOKsKjK/m3TA7V2bUONVuHLG3PBdeCD5nwjRMQuJH5Gge95DWVrN3iTgFcJ7qoNneqg+tEsNMqwJAkuaemRWjCBP3Mb5TDfzH76+FsWlfrNobFQJv6T5OL/JIe3TB2tCrujCf01MOo/saiLcaoAHyJtuzIH/Ga3OwCJfnOzkFTCituf4pfKsfmszicnYaV8ypRPbqnEb0JgGWkrEHqRxcmbQtgytT/ZN0iKJhdCDjcL9ixI1w+VQ== 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)(366004)(136003)(39850400004)(346002)(376002)(451199021)(6486002)(478600001)(52116002)(83380400001)(26005)(1076003)(6506007)(6512007)(38350700002)(38100700002)(66556008)(66946007)(4326008)(54906003)(66476007)(110136005)(186003)(2616005)(5660300002)(316002)(8936002)(8676002)(2906002)(41300700001)(86362001)(36756003)(142923001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1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f-8?q?dlT0zj3PvHeCDKDaVyKVPRP/0J/h9QUi37/aWrO0yXVELwJZZJ+SqPWr7sO/I5m3R?= =?utf-8?q?/Kw+aqORANwcbmmy79KEOtyx3/1mB4wKZlYaglvYC4NIctpioycsPs0EXl2q/1WnC?= =?utf-8?q?4Xb4m9CJ8C0UnuizICRzOBL6u6SPBASwwIZqwkOGhLZvASGbvu2D3urgkRtrfxg+Y?= =?utf-8?q?kc3W6wieSRvA+HlNj4d9v0EDKlDCSi5y2mqvX3nXWCkgFE6bhux/8JgIhikWqNHzn?= =?utf-8?q?xM5n0FXuPpRVGnAuUbAQAaN6S0Lt9YMnlqfOxVE6cUkMYR7OFYxKeHO2ElVymb0Fj?= =?utf-8?q?To/ZEJGhcYxyZNos50QkPq7sfUUPd742BhpT8s0H0dnwqXXnn1DVwmYLxVgmu+tr2?= =?utf-8?q?pZX5wi8tOapPlGuLrv8FjTmBUXMqf+moIMNCKL7BNIXoAn9fuymjWJFb5wRj46syy?= =?utf-8?q?CPgugWQh+SMZwrIfSAPeUa7mekFToDvl5WukYYoXaH/kuZpnZub9J9P1pHt+kB3Qj?= =?utf-8?q?Hy3P+ZPjzkg4UA1nayo10R6sp4duF5i4IYlbC4XKUSqc7egaoY1WgaMFJXgUfCy0p?= =?utf-8?q?02Vx7p//w0cZQlPVgnNunU826vQownaWZsfW6NilZFOUXlgrfjhlbsny+3mpKaxez?= =?utf-8?q?xIJrR9Exd3keSCiGCqlIkvI//GFVxkEkSKYlLt3kwB2ddtYYsSvlzx6EaVu3d9Qfg?= =?utf-8?q?wlZUi/fh0JS2?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: afaafa2a-a1df-406b-e7c6-08db8e6f798a X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 07:02:43.6893 (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: DKFCjM3yAPKXNTcm+9+ZYdlmR4IEkMDe8J46lnS4KWVknFJv2Q8R8HROkkunF4s8ATzAWhGELBuhOTuO2z4gTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSAPR06MB4152 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/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c index 7cdf0f54e3a5..1cc84739ef2f 100644 --- a/drivers/mmc/host/sdhci_am654.c +++ b/drivers/mmc/host/sdhci_am654.c @@ -870,16 +870,17 @@ static int sdhci_am654_remove(struct platform_device *pdev) { struct sdhci_host *host = platform_get_drvdata(pdev); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct device *dev = &pdev->dev; int ret; - ret = pm_runtime_resume_and_get(&pdev->dev); + ret = pm_runtime_get_sync(dev); if (ret < 0) - return ret; + dev_err(dev, "pm_runtime_get_sync() Failed\n"); sdhci_remove_host(host, true); clk_disable_unprepare(pltfm_host->clk); - pm_runtime_disable(&pdev->dev); - pm_runtime_put_noidle(&pdev->dev); + pm_runtime_disable(dev); + pm_runtime_put_noidle(dev); sdhci_pltfm_free(pdev); return 0; }
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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)