Re: linux-next: Tree for Dec 9 (ibmphp)

Bjorn Helgaas
2011-12-14T00:41:29Z

[-- Attachment #1: Type: text/plain, Size: 868 bytes --]

On Mon, Dec 12, 2011 at 10:20 AM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> On 12/09/2011 10:51 AM, Randy Dunlap wrote:
>>
>> On Thu, December 8, 2011 9:32 pm, Stephen Rothwell wrote:
>>> Hi all,
>>>
>>> Changes since 20111208:
>>
>> (This build error  was first seen in 20111208.)
>>
>>
>> ERROR: "pci_scan_bus" [drivers/pci/hotplug/ibmphp.ko] undefined!
>>
>> Full randconfig file is attached.
>
>
> Same for 20111212.

I changed pci_scan_bus() from an inline function (visible to modules)
to a normal function (by default, not visible to modules), which broke
the ibmphp.ko build.

The updated patch is attached, as well as the incremental change (just
adding "EXPORT_SYMBOL(pci_scan_bus);".

(Also available at git://github.com/bjorn-helgaas/linux.git on the "pci-scan-v6"
branch as bef4a9eefaa69dd9bc998e29d619127d1653683d)

Bjorn

[-- Attachment #2: patch.convert-pci_scan_bus --]
[-- Type: application/octet-stream, Size: 2201 bytes --]

commit 3ae4ab813b60d9c42fbdfc79473c55c53cb85447
Author: Bjorn Helgaas <bhelgaas@google.com>
Date: Thu Oct 27 11:45:38 2011 -0600

PCI: convert pci_scan_bus() to use pci_create_root_bus()

I plan to deprecate pci_scan_bus_parented(), so use pci_create_root_bus()
directly instead. pci_scan_bus() itself will be removed as soon as all
callers are gone, so this is just an interim step.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 9f4b00c..f066c9b 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1649,6 +1649,25 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
}
EXPORT_SYMBOL(pci_scan_bus_parented);

+struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops,
+ void *sysdata)
+{
+ LIST_HEAD(resources);
+ struct pci_bus *b;
+
+ pci_add_resource(&resources, &ioport_resource);
+ pci_add_resource(&resources, &iomem_resource);
+ b = pci_create_root_bus(NULL, bus, ops, sysdata, &resources);
+ if (b) {
+ b->subordinate = pci_scan_child_bus(b);
+ pci_bus_add_devices(b);
+ } else {
+ pci_free_resource_list(&resources);
+ }
+ return b;
+}
+EXPORT_SYMBOL(pci_scan_bus);
+
#ifdef CONFIG_HOTPLUG
/**
* pci_rescan_bus - scan a PCI bus for devices.
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 3237cc8..a082593 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -660,15 +660,7 @@ extern struct pci_bus *pci_find_bus(int domain, int busnr);
void pci_bus_add_devices(const struct pci_bus *bus);
struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus,
struct pci_ops *ops, void *sysdata);
-static inline struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops,
- void *sysdata)
-{
- struct pci_bus *root_bus;
- root_bus = pci_scan_bus_parented(NULL, bus, ops, sysdata);
- if (root_bus)
- pci_bus_add_devices(root_bus);
- return root_bus;
-}
+struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata);
struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
struct pci_ops *ops, void *sysdata,
struct list_head *resources);

[-- Attachment #3: patch.export --]
[-- Type: application/octet-stream, Size: 348 bytes --]

diff --git a/01c1382d3:drivers/pci/probe.c b/bef4a9eef:drivers/pci/probe.c
index 8182d69..f01a01a 100644
--- a/01c1382d3:drivers/pci/probe.c
+++ b/bef4a9eef:drivers/pci/probe.c
@@ -1658,6 +1658,7 @@ struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops,
}
return b;
}
+EXPORT_SYMBOL(pci_scan_bus);

#ifdef CONFIG_HOTPLUG
/**