lock_wrlock(&ioresource_lock)
failed = 0;
for (i = 0; i < 6; i++) {
pci->resource_allocated[i] = NULL;
if (pci->resource[i].end) {
if (pci->resource[i].flags & IORESOURCE_IOPORT)
pci->resource_allocated[i] = __request_region(&ioport_resource, pci->resource[i].start,
pci->resource[i].end-pci->resource[i].start+1);
else
pci->resource_allocated[i] = __request_region ....
if (!pci->resource_allocated[i]) {
failed = 1;
break;
}
}
}
if (failed) { for ( ; i >= 0; i--) {
if (pci->resource_allocated[i]) release_resource(dummy[i]);
pci->resource_allocated[i] = NULL;
} }
lock_unlock(&ioresource_lock);
return failed ? -ENXIO : 0;
It is common case that you need allocate whole device, preferrably
as atomic operation.
Petr Vandrovec
vandrove@vc.cvut.cz
P.S.: And if we are talking about PIIX4 IDE - should not we add its ioports
into resource[] during pci fixups? Other (promise) do have these resources
listed in config space (I see no reason why we must have mapping resource <->
pci base_address region 1:1, if drivers know about it)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/