[OPENPROM]: Use pci_device_to_OF_node().
authorDavid S. Miller <davem@sunset.davemloft.net>
Wed, 25 Apr 2007 23:01:51 +0000 (16:01 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 08:54:59 +0000 (01:54 -0700)
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/sbus/char/openprom.c

index aec3b9f991f6dc981ab43b65c889c8c41b9e02ae..fbfeb89a6f32d148abbbe9b9c0137d5a7f0fdb10 100644 (file)
@@ -44,7 +44,6 @@
 #include <asm/openpromio.h>
 #ifdef CONFIG_PCI
 #include <linux/pci.h>
-#include <asm/pbm.h>
 #endif
 
 MODULE_AUTHOR("Thomas K. Dyas (tdyas@noc.rutgers.edu) and Eddie C. Dost  (ecd@skynet.be)");
@@ -248,18 +247,17 @@ static int oprompci2node(void __user *argp, struct device_node *dp, struct openp
        if (bufsize >= 2*sizeof(int)) {
 #ifdef CONFIG_PCI
                struct pci_dev *pdev;
-               struct pcidev_cookie *pcp;
+               struct device_node *dp;
+
                pdev = pci_get_bus_and_slot (((int *) op->oprom_array)[0],
                                      ((int *) op->oprom_array)[1]);
 
-               pcp = pdev->sysdata;
-               if (pcp != NULL) {
-                       dp = pcp->prom_node;
-                       data->current_node = dp;
-                       *((int *)op->oprom_array) = dp->node;
-                       op->oprom_size = sizeof(int);
-                       err = copyout(argp, op, bufsize + sizeof(int));
-               }
+               dp = pci_device_to_OF_node(pdev);
+               data->current_node = dp;
+               *((int *)op->oprom_array) = dp->node;
+               op->oprom_size = sizeof(int);
+               err = copyout(argp, op, bufsize + sizeof(int));
+
                pci_dev_put(pdev);
 #endif
        }