summaryrefslogtreecommitdiff
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-09-18 10:19:13 +0200
committerDominik Brodowski <linux@dominikbrodowski.net>2010-09-18 16:30:18 +0200
commit7cdffc86528ec9c55c83c649b6d64cadeb558136 (patch)
tree7c802dba05b0c2c9f784452ff73d816469413c8c /drivers/pcmcia
parent151b6a5f1d4c547c92ec67a5a6fedc16f435956e (diff)
downloadlwn-7cdffc86528ec9c55c83c649b6d64cadeb558136.tar.gz
lwn-7cdffc86528ec9c55c83c649b6d64cadeb558136.zip
pcmcia: preserve configuration information if request_io fails partly
If pcmcia_request_io() only fails partly -- for the second of two requested resources -- preserve the configuration settings for the first one. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/pcmcia_resource.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index a5c176598d95..9ba4dade69a4 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -595,7 +595,13 @@ int pcmcia_request_io(struct pcmcia_device *p_dev)
if (c->io[1].end) {
ret = alloc_io_space(s, &c->io[1], p_dev->io_lines);
if (ret) {
+ struct resource tmp = c->io[0];
+ /* release the previously allocated resource */
release_io_space(s, &c->io[0]);
+ /* but preserve the settings, for they worked... */
+ c->io[0].end = resource_size(&tmp);
+ c->io[0].start = tmp.start;
+ c->io[0].flags = tmp.flags;
goto out;
}
} else