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: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
Dominik Brodowski 2010-02-17 14:35:33 +01:00
parent d801c1409e
commit f309cb3e4f

View file

@ -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;
}