From patchwork Thu Jul 27 07:00:48 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: 126716 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp914608vqo; Thu, 27 Jul 2023 00:21:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlHD6JmqUa4w4/Hp/sJQhD190zMW4dJPqzd1MPoS2SSeWyjh+M/HaRqSDarilDAB4R4jXS+N X-Received: by 2002:a05:6358:c12:b0:133:6c9:c43 with SMTP id f18-20020a0563580c1200b0013306c90c43mr2097634rwj.30.1690442515567; Thu, 27 Jul 2023 00:21:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690442515; cv=pass; d=google.com; s=arc-20160816; b=QIUUx02hj79wiB6rWXHt1HwmYFIFYnQYi1KoKSaxGH+YghaaP3km/uZwnX9Ss+RYOs I6qSGFPGqVqAyWch4R1dHHhM29kWIBS0I7ofodplSOu36z9OmFvZtZdF414cwKIc3I29 RXNZKS9S704FSNJwU9oWx0xYgiepOFIcgK6e9BxQ+xD4kE7QeUOSJL7afQuWoESN2m6c 8tmG6t/8k0uocIpcp1EYcmFp5Xyvhut9NpjA3Bmm8M65eQQQQPrcPhUq2vNEvts2wQsM Su1jFGnds0K2lEleV/LC4BegjwynztcMpxyYQbtEYbYp6v4of9LoK0V3JFVvXGlChKKm NN/w== 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=9Wq3D3MP18gp00gViiexlDEzaE6ODfTIsN21lyfNhC4=; fh=bJZZHQZH+VGE6F+8RE90TGtTwv5nTUcl0TOIcmRPvoA=; b=Kym6DjmMUwz4SqUU0kkogxYf8JMMwpCgh6uFS51B8MkcpRlT7JcYlMR8t4WSYAuH6e synZjvkjP+N5nTs/WRa4MBqAbjwiRDMDi5LAlQBjjzas+SBQqrUGmuqmlM0d42SRTgYF RZEi3xvNIGSCPmnHVGFkiwDwuVpYjz++vxa3AIG970UAohbMxtqU3hfbm71jTxsNh2Ss zBWV5ekVL1U17OJkibDTyEeuy0SNoqYYu4YjmHolpD0TcuTQqNbg2j8/g4P+rCexxxk5 8lUK8ajO5HX36lRl/7K+mF7EHaRgtL8+ev3LgZQJr32xV+++gqXNpXGLFEMC0IE1M04/ ix8Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=iDNb0JaU; 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 p26-20020a63741a000000b005578c6a7689si843454pgc.91.2023.07.27.00.21.42; Thu, 27 Jul 2023 00:21:55 -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=iDNb0JaU; 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 S232635AbjG0HIo (ORCPT + 99 others); Thu, 27 Jul 2023 03:08:44 -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 ); 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 To: Adrian Hunter , Ulf Hansson Cc: Yangtao Li , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , 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> 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 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?kldXSR59jXEm7X/hZAaLWnUT6wde?= =?utf-8?q?PqBZDYYt5TkCD8OKNf6cD/TFDz2f2jljr+C+wRzjKeBCM1DhkYiUBw88BU6XnblcX?= =?utf-8?q?HWyC47xgSI/6iPEgmt4tzw3/OhjyD3CnRjLrrGRMmh8QbYTD7OpP1ps5KiZfsTk3V?= =?utf-8?q?1E9UvMW27IhR2fpZ70wiufFTV391SFffMvjBzGGLoGKI5mLhaW9SL1UHfKbJYRv6w?= =?utf-8?q?e1QoVAdC56qs+vdTG2g/E6DVr/Vs4Y/iJfBKKr60uG9o0179BVNHD5pjrFR0ONi+O?= =?utf-8?q?ylZku3L2TUeVc7U+4vV2Cox2/CQXrOTJDDzSMP4fzxF2u63F3LKxoM9a8kNVOKgC4?= =?utf-8?q?mC2adeuxr+q4WBPM5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8tOapPlGuLrv8FjTmBUXMqf+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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: 1772557451272170092 X-GMAIL-MSGID: 1772557451272170092 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 Signed-off-by: Yangtao Li Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci_am654.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; }