From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc <linux-mmc@vger.kernel.org>
Subject: [PATCH V2 1/2] mmc: sdio: Tidy error path in mmc_attach_sdio()
Date: Fri, 9 Jun 2017 15:27:17 +0300 [thread overview]
Message-ID: <1497011238-9573-2-git-send-email-adrian.hunter@intel.com> (raw)
In-Reply-To: <1497011238-9573-1-git-send-email-adrian.hunter@intel.com>
The error path deletes the device by calling mmc_sdio_remove() which must
be called without the host claimed. Simplify the error path so it does just
that and add a comment about why we don't disable runtime PM.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/core/sdio.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index fae732c870a9..f077fc8219d0 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -1159,15 +1159,14 @@ int mmc_attach_sdio(struct mmc_host *host)
return 0;
-remove_added:
- /* Remove without lock if the device has been added. */
- mmc_sdio_remove(host);
- mmc_claim_host(host);
remove:
- /* And with lock if it hasn't been added. */
mmc_release_host(host);
- if (host->card)
- mmc_sdio_remove(host);
+remove_added:
+ /*
+ * The devices are being deleted so it is not necessary to disable
+ * runtime PM.
+ */
+ mmc_sdio_remove(host);
mmc_claim_host(host);
err:
mmc_detach_bus(host);
--
1.9.1
next prev parent reply other threads:[~2017-06-09 12:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-09 12:27 [PATCH V2 0/2] mmc: sdio: Keep card runtime resumed while adding function devices Adrian Hunter
2017-06-09 12:27 ` Adrian Hunter [this message]
2017-06-09 12:27 ` [PATCH V2 2/2] " Adrian Hunter
2017-06-09 13:29 ` [PATCH V2 0/2] " 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=1497011238-9573-2-git-send-email-adrian.hunter@intel.com \
--to=adrian.hunter@intel.com \
--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