mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[PATCH] pci and yenta: pcibios_bus_to_resource
In yenta_socket, we default to using the resource setting of the CardBus bridge. However, this is a PCI-bus-centric view of resources and thus needs to be converted to generic resources first. Therefore, add a call to pcibios_bus_to_resource() call in between. This function is a mere wrapper on x86 and friends, however on some others it already exists, is added in this patch (alpha, arm, ppc, ppc64) or still needs to be provided (parisc -- where is its pcibios_resource_to_bus() ?). Signed-off-by: Dominik Brodowski <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
fec59a711e
commit
43c3473552
11 changed files with 101 additions and 9 deletions
|
|
@ -605,9 +605,8 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res,
|
|||
|
||||
static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end)
|
||||
{
|
||||
struct pci_bus *bus;
|
||||
struct resource *root, *res;
|
||||
u32 start, end;
|
||||
struct pci_bus_region region;
|
||||
unsigned mask;
|
||||
|
||||
res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr;
|
||||
|
|
@ -620,15 +619,13 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ
|
|||
if (type & IORESOURCE_IO)
|
||||
mask = ~3;
|
||||
|
||||
bus = socket->dev->subordinate;
|
||||
res->name = bus->name;
|
||||
res->name = socket->dev->subordinate->name;
|
||||
res->flags = type;
|
||||
|
||||
start = config_readl(socket, addr_start) & mask;
|
||||
end = config_readl(socket, addr_end) | ~mask;
|
||||
if (start && end > start && !override_bios) {
|
||||
res->start = start;
|
||||
res->end = end;
|
||||
region.start = config_readl(socket, addr_start) & mask;
|
||||
region.end = config_readl(socket, addr_end) | ~mask;
|
||||
if (region.start && region.end > region.start && !override_bios) {
|
||||
pcibios_bus_to_resource(socket->dev, res, ®ion);
|
||||
root = pci_find_parent_resource(socket->dev, res);
|
||||
if (root && (request_resource(root, res) == 0))
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue