Commit f309cb3e authored by Dominik Brodowski's avatar Dominik Brodowski

pcmcia: allow for extension of resource interval

If a new interval overlaps or extends an existing interval in
add_interval(), do not fail, but extend the existing interval.
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent d801c140
......@@ -124,8 +124,10 @@ static int add_interval(struct resource_map *map, u_long base, u_long num)
struct resource_map *p, *q;
for (p = map; ; p = p->next) {
if ((p != map) && (p->base+p->num-1 >= base))
return -1;
if ((p != map) && (p->base+p->num >= base)) {
p->num = max(num + base - p->base, p->num);
return 0;
}
if ((p->next == map) || (p->next->base > base+num-1))
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment