提交 7cdffc86 编写于 作者: D Dominik Brodowski

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: NDominik Brodowski <linux@dominikbrodowski.net>
上级 151b6a5f
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册