diff options
Diffstat (limited to 'drivers/pcmcia/yenta_socket.c')
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 6837491f021c..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 | ||
606 | static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end) | 606 | static 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, ®ion); |
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; |
@@ -642,6 +639,7 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
642 | (yenta_search_res(socket, res, BRIDGE_IO_MIN))) { | 639 | (yenta_search_res(socket, res, BRIDGE_IO_MIN))) { |
643 | config_writel(socket, addr_start, res->start); | 640 | config_writel(socket, addr_start, res->start); |
644 | config_writel(socket, addr_end, res->end); | 641 | config_writel(socket, addr_end, res->end); |
642 | return; | ||
645 | } | 643 | } |
646 | } else { | 644 | } else { |
647 | if (type & IORESOURCE_PREFETCH) { | 645 | if (type & IORESOURCE_PREFETCH) { |
@@ -650,6 +648,7 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
650 | (yenta_search_res(socket, res, BRIDGE_MEM_MIN))) { | 648 | (yenta_search_res(socket, res, BRIDGE_MEM_MIN))) { |
651 | config_writel(socket, addr_start, res->start); | 649 | config_writel(socket, addr_start, res->start); |
652 | config_writel(socket, addr_end, res->end); | 650 | config_writel(socket, addr_end, res->end); |
651 | return; | ||
653 | } | 652 | } |
654 | /* Approximating prefetchable by non-prefetchable */ | 653 | /* Approximating prefetchable by non-prefetchable */ |
655 | res->flags = IORESOURCE_MEM; | 654 | res->flags = IORESOURCE_MEM; |
@@ -659,6 +658,7 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
659 | (yenta_search_res(socket, res, BRIDGE_MEM_MIN))) { | 658 | (yenta_search_res(socket, res, BRIDGE_MEM_MIN))) { |
660 | config_writel(socket, addr_start, res->start); | 659 | config_writel(socket, addr_start, res->start); |
661 | config_writel(socket, addr_end, res->end); | 660 | config_writel(socket, addr_end, res->end); |
661 | return; | ||
662 | } | 662 | } |
663 | } | 663 | } |
664 | 664 | ||