aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sbus/char/openprom.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-27 12:29:04 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-27 12:29:04 -0400
commit0278ef8b484a71917bd4f03a763285cdaac10954 (patch)
tree8f6f7bf2e2a85b4643dfe3d0475811ce858fb4fc /drivers/sbus/char/openprom.c
parent15c54033964a943de7b0763efd3bd0ede7326395 (diff)
parentcd9ad58d4061494e7fdd70ded7bcf2418daf356a (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: (67 commits) [SCSI] SUNESP: Complete driver rewrite to version 2.0 [SPARC64]: Convert PCI over to generic struct iommu/strbuf. [SPARC]: device_node name constification fallout [SPARC64]: Convert SBUS over to generic iommu/strbuf structs. [SPARC64]: Add generic iommu and strbuf structs to iommu.h [SPARC64]: Consolidate {sbus,pci}_iommu_arena. [SPARC]: Make device_node name and type const [SPARC64]: constify some paramaters of OF routines [TIGON3]: of_get_property() returns const. [SPARC64]: Fix PCI rework to adhere to of_get_property() const return. [SPARC64]: Document and fix calculation of pages_avail. [SPARC64]: Make sure pbm->prom_node is setup easly enough in psycho.c [SPARC64]: Use bootmem_bootmap_pages() in choose_bootmap_pfn(). [SPARC64]: Add proper header file extern for cmdline_memory_size. [SPARC64]: Kill sparc_ultra_dump_{i,d}tlb() [SPARC64]: Use DECLARE_BITMAP and BITS_TO_LONGS in mm/init.c [SPARC64]: Give move verbose show_mem() output just like i386. [SPARC64]: Mark show_mem() printk's with KERN_INFO. [SPARC64]: Kill kvaddr_to_phys() and friends. [SPARC64]: Privatize sun4u_get_pte() and fix name. ...
Diffstat (limited to 'drivers/sbus/char/openprom.c')
-rw-r--r--drivers/sbus/char/openprom.c22
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
50MODULE_AUTHOR("Thomas K. Dyas (tdyas@noc.rutgers.edu) and Eddie C. Dost (ecd@skynet.be)"); 49MODULE_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
142static int opromgetprop(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize) 141static 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)))