mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
[OPENPROM]: Use pci_device_to_OF_node().
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d297c31fd1
commit
fa449bd602
1 changed files with 8 additions and 10 deletions
|
@ -44,7 +44,6 @@
|
||||||
#include <asm/openpromio.h>
|
#include <asm/openpromio.h>
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
#include <asm/pbm.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MODULE_AUTHOR("Thomas K. Dyas (tdyas@noc.rutgers.edu) and Eddie C. Dost (ecd@skynet.be)");
|
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)) {
|
if (bufsize >= 2*sizeof(int)) {
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
struct pci_dev *pdev;
|
struct pci_dev *pdev;
|
||||||
struct pcidev_cookie *pcp;
|
struct device_node *dp;
|
||||||
|
|
||||||
pdev = pci_get_bus_and_slot (((int *) op->oprom_array)[0],
|
pdev = pci_get_bus_and_slot (((int *) op->oprom_array)[0],
|
||||||
((int *) op->oprom_array)[1]);
|
((int *) op->oprom_array)[1]);
|
||||||
|
|
||||||
pcp = pdev->sysdata;
|
dp = pci_device_to_OF_node(pdev);
|
||||||
if (pcp != NULL) {
|
data->current_node = dp;
|
||||||
dp = pcp->prom_node;
|
*((int *)op->oprom_array) = dp->node;
|
||||||
data->current_node = dp;
|
op->oprom_size = sizeof(int);
|
||||||
*((int *)op->oprom_array) = dp->node;
|
err = copyout(argp, op, bufsize + sizeof(int));
|
||||||
op->oprom_size = sizeof(int);
|
|
||||||
err = copyout(argp, op, bufsize + sizeof(int));
|
|
||||||
}
|
|
||||||
pci_dev_put(pdev);
|
pci_dev_put(pdev);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue