Skip to content

Commit

Permalink
[OPENPROM]: Use pci_device_to_OF_node().
Browse files Browse the repository at this point in the history
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
David S. Miller committed Apr 26, 2007
1 parent d297c31 commit fa449bd
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions drivers/sbus/char/openprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([email protected]) and Eddie C. Dost ([email protected])");
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit fa449bd

Please sign in to comment.