aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/yenta_socket.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-08-04 21:06:21 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-05 00:32:46 -0400
commit43c34735524d5b1c9b9e5d63b49dd4c1b394bde4 (patch)
treea61c11d4075f149be9c0aae6b6c0a935c94571af /drivers/pcmcia/yenta_socket.c
parentfec59a711eef002d4ef9eb8de09dd0a26986eb77 (diff)
[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 <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pcmcia/yenta_socket.c')
-rw-r--r--drivers/pcmcia/yenta_socket.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 91e7457d5b04..62fd705203fb 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -605,9 +605,8 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res,
605 605
606static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end) 606static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end)
607{ 607{
608 struct pci_bus *bus;
609 struct resource *root, *res; 608 struct resource *root, *res;
610 u32 start, end; 609 struct pci_bus_region region;
611 unsigned mask; 610 unsigned mask;
612 611
613 res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr; 612 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
620 if (type & IORESOURCE_IO) 619 if (type & IORESOURCE_IO)
621 mask = ~3; 620 mask = ~3;
622 621
623 bus = socket->dev->subordinate; 622 res->name = socket->dev->subordinate->name;
624 res->name = bus->name;
625 res->flags = type; 623 res->flags = type;
626 624
627 start = config_readl(socket, addr_start) & mask; 625 region.start = config_readl(socket, addr_start) & mask;
628 end = config_readl(socket, addr_end) | ~mask; 626 region.end = config_readl(socket, addr_end) | ~mask;
629 if (start && end > start && !override_bios) { 627 if (region.start && region.end > region.start && !override_bios) {
630 res->start = start; 628 pcibios_bus_to_resource(socket->dev, res, &region);
631 res->end = end;
632 root = pci_find_parent_resource(socket->dev, res); 629 root = pci_find_parent_resource(socket->dev, res);
633 if (root && (request_resource(root, res) == 0)) 630 if (root && (request_resource(root, res) == 0))
634 return; 631 return;