diff options
Diffstat (limited to 'drivers/sbus/char/openprom.c')
-rw-r--r-- | drivers/sbus/char/openprom.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index 5041c9dfbe3b..fbfeb89a6f32 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c | |||
@@ -44,7 +44,6 @@ | |||
44 | #include <asm/openpromio.h> | 44 | #include <asm/openpromio.h> |
45 | #ifdef CONFIG_PCI | 45 | #ifdef CONFIG_PCI |
46 | #include <linux/pci.h> | 46 | #include <linux/pci.h> |
47 | #include <asm/pbm.h> | ||
48 | #endif | 47 | #endif |
49 | 48 | ||
50 | MODULE_AUTHOR("Thomas K. Dyas (tdyas@noc.rutgers.edu) and Eddie C. Dost (ecd@skynet.be)"); | 49 | MODULE_AUTHOR("Thomas K. Dyas (tdyas@noc.rutgers.edu) and Eddie C. Dost (ecd@skynet.be)"); |
@@ -141,7 +140,7 @@ static int copyout(void __user *info, struct openpromio *opp, int len) | |||
141 | 140 | ||
142 | static int opromgetprop(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize) | 141 | static int opromgetprop(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize) |
143 | { | 142 | { |
144 | void *pval; | 143 | const void *pval; |
145 | int len; | 144 | int len; |
146 | 145 | ||
147 | if (!dp || | 146 | if (!dp || |
@@ -248,18 +247,17 @@ static int oprompci2node(void __user *argp, struct device_node *dp, struct openp | |||
248 | if (bufsize >= 2*sizeof(int)) { | 247 | if (bufsize >= 2*sizeof(int)) { |
249 | #ifdef CONFIG_PCI | 248 | #ifdef CONFIG_PCI |
250 | struct pci_dev *pdev; | 249 | struct pci_dev *pdev; |
251 | struct pcidev_cookie *pcp; | 250 | struct device_node *dp; |
251 | |||
252 | pdev = pci_get_bus_and_slot (((int *) op->oprom_array)[0], | 252 | pdev = pci_get_bus_and_slot (((int *) op->oprom_array)[0], |
253 | ((int *) op->oprom_array)[1]); | 253 | ((int *) op->oprom_array)[1]); |
254 | 254 | ||
255 | pcp = pdev->sysdata; | 255 | dp = pci_device_to_OF_node(pdev); |
256 | if (pcp != NULL) { | 256 | data->current_node = dp; |
257 | dp = pcp->prom_node; | 257 | *((int *)op->oprom_array) = dp->node; |
258 | data->current_node = dp; | 258 | op->oprom_size = sizeof(int); |
259 | *((int *)op->oprom_array) = dp->node; | 259 | err = copyout(argp, op, bufsize + sizeof(int)); |
260 | op->oprom_size = sizeof(int); | 260 | |
261 | err = copyout(argp, op, bufsize + sizeof(int)); | ||
262 | } | ||
263 | pci_dev_put(pdev); | 261 | pci_dev_put(pdev); |
264 | #endif | 262 | #endif |
265 | } | 263 | } |
@@ -410,7 +408,7 @@ static int opiocget(void __user *argp, DATA *data) | |||
410 | struct opiocdesc op; | 408 | struct opiocdesc op; |
411 | struct device_node *dp; | 409 | struct device_node *dp; |
412 | char *str; | 410 | char *str; |
413 | void *pval; | 411 | const void *pval; |
414 | int err, len; | 412 | int err, len; |
415 | 413 | ||
416 | if (copy_from_user(&op, argp, sizeof(op))) | 414 | if (copy_from_user(&op, argp, sizeof(op))) |