From: Zhen Lei <thunder.leizhen@huawei.com>
To: Ulf Hansson <ulf.hansson@linaro.org>, <linux-mmc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: Zhen Lei <thunder.leizhen@huawei.com>
Subject: [PATCH] mmc: core: Fix error return code in sd_read_ext_regs()
Date: Wed, 30 Nov 2022 17:28:47 +0800 [thread overview]
Message-ID: <20221130092847.2092-1-thunder.leizhen@huawei.com> (raw)
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 <thunder.leizhen@huawei.com>
---
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;
}
--
2.25.1
next reply other threads:[~2022-11-30 9:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 9:28 Zhen Lei [this message]
2022-11-30 10:04 ` Ulf Hansson
2022-11-30 11:18 ` Leizhen (ThunderTown)
2022-11-30 11:33 ` Ulf Hansson
2022-11-30 11:44 ` Leizhen (ThunderTown)
2022-11-30 11:51 ` Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221130092847.2092-1-thunder.leizhen@huawei.com \
--to=thunder.leizhen@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®