From patchwork Wed Nov 30 09:28:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 27704 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp821694wrr; Wed, 30 Nov 2022 01:33:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf5uqfPeBZf/sipIMJGmCi5iR2j3ed0bcwfmspwBKe/QFhFCDXniAOGs/CqS/IMKYxeXo8Yy X-Received: by 2002:a17:907:8b93:b0:7b4:f258:6196 with SMTP id tb19-20020a1709078b9300b007b4f2586196mr37382264ejc.524.1669800804955; Wed, 30 Nov 2022 01:33:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669800804; cv=none; d=google.com; s=arc-20160816; b=z5oeADz8VBSoh3KhdIzl/2kOoi5DD7uWfg9ZOB44xbs/VYmMxegvGIegiXkZQK08V9 Rdn1b5NK4UuBQb82cx91GZGwuGl23IkaK/e6JqYYGWGMGq7fFakaamSU17kxaf8TIs0Z CANeCYF0rfjm090hVwFVL8hsLJG4O6K0ggUsEbt4RRCz/aGuHcsOPhNtWdoUrPvIaqDQ p4dbETukGAJpy3nbluUxHg7CDkLB+OHoYN/lUHUABIrwdkBT6yslHbL5SRc379AE9jDs pD2x8kZZPjFwgJehZSrT+RjoBXs4Mf50lE3FcqjwcfqN2GVwLGvhqzA90Rsgn4uVdCtf KpVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KX/qPiqEt50lr8HEdUXgiF7PFTbZrgvzFLi5UU9JZ34=; b=uOHiq9dlVlYxAXfIi6AFwoX336yP5gFyvHMCmYvaRMsefOfxAM3E1xelF0Mfgsbk0d /2i5DlR/Vcd76gs4Mn8Ol1gJjrOAvV6U7k/m97J+4MUNtwy4+jtD4twKeasK6Tyio0s0 U8bVtDB1O8SV0Xr/IREXA5A8zXQ9uOkTX2DUcIk3EGOlRgdoOh0RlJhYOVjAHM43J9Ru WA7QY0eQn3lCXYGwmgnYwbjkd7AU6ws8gK+zvu/NcNFDv4jSLn3U4JHmInwbvwHkGDOO box32LYMsvNOhucKUtfCfVYLtc5UXhW6gX0p9b4Y1oOMPrqc86BcbQJidauJ41pNVXFN fyHQ== ARC-Authentication-Results: i=1; mx.google.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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp8-20020a1709073e0800b0078d027ceb41si969014ejc.857.2022.11.30.01.33.01; Wed, 30 Nov 2022 01:33:24 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233498AbiK3J30 (ORCPT + 99 others); Wed, 30 Nov 2022 04:29:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233469AbiK3J3S (ORCPT ); Wed, 30 Nov 2022 04:29:18 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBD1B37230; Wed, 30 Nov 2022 01:29:13 -0800 (PST) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NMYj84WRzzJp4N; Wed, 30 Nov 2022 17:25:48 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 30 Nov 2022 17:29:12 +0800 Received: from thunder-town.china.huawei.com (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 30 Nov 2022 17:29:11 +0800 From: Zhen Lei To: Ulf Hansson , , CC: Zhen Lei Subject: [PATCH] mmc: core: Fix error return code in sd_read_ext_regs() Date: Wed, 30 Nov 2022 17:28:47 +0800 Message-ID: <20221130092847.2092-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.37.3.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750913049086490963?= X-GMAIL-MSGID: =?utf-8?q?1750913049086490963?= Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: c784f92769ae ("mmc: core: Read the SD function extension registers for power management") Signed-off-by: Zhen Lei --- drivers/mmc/core/sd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 3662bf5320ce56d..7b64f76f0179ca8 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1277,6 +1277,7 @@ static int sd_read_ext_regs(struct mmc_card *card) if (rev != 0 || len > 512) { pr_warn("%s: non-supported SD ext reg layout\n", mmc_hostname(card->host)); + err = -EOPNOTSUPP; goto out; }