From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
Robert Jarzmik <robert.jarzmik@free.fr>
Subject: [PATCH] mmc: pxamci: fix the device-tree probe deferral path
Date: Wed, 3 Feb 2016 23:19:52 +0100 [thread overview]
Message-ID: <1454537992-15839-1-git-send-email-robert.jarzmik@free.fr> (raw)
When the gpio driver is probed after the mmc one, the read/write gpio
and card detection one return -EPROBE_DEFER. Unfortunately, the memory
region remains requested, and upon the next probe, the probe will fail
anyway with -EBUSY.
Fix this by releasing the memory resource upon probe failure.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
drivers/mmc/host/pxamci.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index 28a057fae0a1..405ec339a1b8 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -657,7 +657,7 @@ static int pxamci_probe(struct platform_device *pdev)
if (!r || irq < 0)
return -ENXIO;
- r = request_mem_region(r->start, SZ_4K, DRIVER_NAME);
+ r = devm_request_mem_region(&pdev->dev, r->start, SZ_4K, DRIVER_NAME);
if (!r)
return -EBUSY;
@@ -840,7 +840,6 @@ out:
}
if (mmc)
mmc_free_host(mmc);
- release_resource(r);
return ret;
}
--
2.1.4
next reply other threads:[~2016-02-03 22:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-03 22:19 Robert Jarzmik [this message]
2016-02-04 11:11 ` [PATCH] mmc: pxamci: fix the device-tree probe deferral path Ulf Hansson
2016-02-04 20:28 ` Robert Jarzmik
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=1454537992-15839-1-git-send-email-robert.jarzmik@free.fr \
--to=robert.jarzmik@free.fr \
--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