ChangeSet 1.2231.1.30, 2005/03/28 19:24:40-08:00, [EMAIL PROTECTED]

        [PATCH] ppc64: pci_dn.c: use pSeries reconfig notifier
        
        Use the pSeries_reconfig notifier list to handle newly added pci device 
nodes.
        
        Signed-off-by: Nathan Lynch <[EMAIL PROTECTED]>
        Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 pci_dn.c |   22 ++++++++++++++++++++++
 prom.c   |   14 --------------
 2 files changed, 22 insertions(+), 14 deletions(-)


diff -Nru a/arch/ppc64/kernel/pci_dn.c b/arch/ppc64/kernel/pci_dn.c
--- a/arch/ppc64/kernel/pci_dn.c        2005-03-28 21:12:58 -08:00
+++ b/arch/ppc64/kernel/pci_dn.c        2005-03-28 21:12:58 -08:00
@@ -27,6 +27,7 @@
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
+#include <asm/pSeries_reconfig.h>
 
 #include "pci.h"
 
@@ -161,6 +162,25 @@
 }
 EXPORT_SYMBOL(fetch_dev_dn);
 
+static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long 
action, void *node)
+{
+       struct device_node *np = node;
+       int err = NOTIFY_OK;
+
+       switch (action) {
+       case PSERIES_RECONFIG_ADD:
+               update_dn_pci_info(np, np->parent->phb);
+               break;
+       default:
+               err = NOTIFY_DONE;
+               break;
+       }
+       return err;
+}
+
+static struct notifier_block pci_dn_reconfig_nb = {
+       .notifier_call = pci_dn_reconfig_notifier,
+};
 
 /*
  * Actually initialize the phbs.
@@ -173,4 +193,6 @@
        /* This must be done first so the device nodes have valid pci info! */
        list_for_each_entry_safe(phb, tmp, &hose_list, list_node)
                pci_devs_phb_init_dynamic(phb);
+
+       pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb);
 }
diff -Nru a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c
--- a/arch/ppc64/kernel/prom.c  2005-03-28 21:12:58 -08:00
+++ b/arch/ppc64/kernel/prom.c  2005-03-28 21:12:58 -08:00
@@ -1591,7 +1591,6 @@
                                  int unused3, int unused4)
 {
        struct device_node *parent = of_get_parent(node);
-       u32 *regs;
        int err = 0;
        phandle *ibm_phandle;
 
@@ -1612,19 +1611,6 @@
        /* fix up new node's linux_phandle field */
        if ((ibm_phandle = (unsigned int *)get_property(node, "ibm,phandle", 
NULL)))
                node->linux_phandle = *ibm_phandle;
-
-       /* now do the rough equivalent of update_dn_pci_info, this
-        * probably is not correct for phb's, but should work for
-        * IOAs and slots.
-        */
-
-       node->phb = parent->phb;
-
-       regs = (u32 *)get_property(node, "reg", NULL);
-       if (regs) {
-               node->busno = (regs[0] >> 16) & 0xff;
-               node->devfn = (regs[0] >> 8) & 0xff;
-       }
 
 out:
        of_node_put(parent);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to