From 4d33b63735e94aa986d5e840165cb9beea89e781 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Sat, 2 Feb 2013 13:18:54 +0000 Subject: [PATCH] --- yaml --- r: 360081 b: refs/heads/master c: 222831787704c9ad9215f6b56f975b233968607c h: refs/heads/master i: 360079: 980930fcf3c70612bd367c10acfb63e7040a921f v: v3 --- [refs] | 2 +- trunk/arch/mips/pci/pci.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 57e941852733..2ba05dd9b3ba 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6e783865b4e60f2ecf7708f8ea24db5c5ea07ced +refs/heads/master: 222831787704c9ad9215f6b56f975b233968607c diff --git a/trunk/arch/mips/pci/pci.c b/trunk/arch/mips/pci/pci.c index a1843448fad3..eb653994a2f1 100644 --- a/trunk/arch/mips/pci/pci.c +++ b/trunk/arch/mips/pci/pci.c @@ -175,9 +175,20 @@ static DEFINE_MUTEX(pci_scan_mutex); void register_pci_controller(struct pci_controller *hose) { - if (request_resource(&iomem_resource, hose->mem_resource) < 0) + struct resource *parent; + + parent = hose->mem_resource->parent; + if (!parent) + parent = &iomem_resource; + + if (request_resource(parent, hose->mem_resource) < 0) goto out; - if (request_resource(&ioport_resource, hose->io_resource) < 0) { + + parent = hose->io_resource->parent; + if (!parent) + parent = &ioport_resource; + + if (request_resource(parent, hose->io_resource) < 0) { release_resource(hose->mem_resource); goto out; }