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:
parent
d801c1409e
commit
f309cb3e4f
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue