aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2006-07-12 01:40:40 -0400
committerPaul Mackerras <paulus@samba.org>2006-07-31 01:55:05 -0400
commitb04e3dd4ab4c7763a4ca8f751caaf69ce8dabbba (patch)
tree0224891d9ea4bfa4b1b8245d498cf2fa81737884
parent018a3d1db7cdb6127656c1622ee1d2302e16436d (diff)
[POWERPC] video & agp: Constify & voidify get_property()
Now that get_property() returns a void *, there's no need to cast its return value. Also, treat the return value as const, so we can constify get_property later. powerpc-specific video & agp driver changes. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--drivers/char/agp/uninorth-agp.c4
-rw-r--r--drivers/video/S3triofb.c12
-rw-r--r--drivers/video/aty/radeon_base.c8
-rw-r--r--drivers/video/aty/radeon_monitor.c12
-rw-r--r--drivers/video/aty/radeon_pm.c4
-rw-r--r--drivers/video/nvidia/nv_of.c12
-rw-r--r--drivers/video/offb.c22
-rw-r--r--drivers/video/riva/fbdev.c5
8 files changed, 38 insertions, 41 deletions
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index 1de1b12043bf..91b71e750ee1 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -601,8 +601,8 @@ static int __devinit agp_uninorth_probe(struct pci_dev *pdev,
601 uninorth_node = of_find_node_by_name(NULL, "u3"); 601 uninorth_node = of_find_node_by_name(NULL, "u3");
602 } 602 }
603 if (uninorth_node) { 603 if (uninorth_node) {
604 int *revprop = (int *) 604 const int *revprop = get_property(uninorth_node,
605 get_property(uninorth_node, "device-rev", NULL); 605 "device-rev", NULL);
606 if (revprop != NULL) 606 if (revprop != NULL)
607 uninorth_rev = *revprop & 0x3f; 607 uninorth_rev = *revprop & 0x3f;
608 of_node_put(uninorth_node); 608 of_node_put(uninorth_node);
diff --git a/drivers/video/S3triofb.c b/drivers/video/S3triofb.c
index e714e8449c1d..0f2ed75a681f 100644
--- a/drivers/video/S3triofb.c
+++ b/drivers/video/S3triofb.c
@@ -350,30 +350,30 @@ static void __init s3triofb_of_init(struct device_node *dp)
350 s3trio_name[sizeof(s3trio_name)-1] = '\0'; 350 s3trio_name[sizeof(s3trio_name)-1] = '\0';
351 strcpy(fb_fix.id, s3trio_name); 351 strcpy(fb_fix.id, s3trio_name);
352 352
353 if((pp = (int *)get_property(dp, "vendor-id", &len)) != NULL 353 if((pp = get_property(dp, "vendor-id", &len)) != NULL
354 && *pp!=PCI_VENDOR_ID_S3) { 354 && *pp!=PCI_VENDOR_ID_S3) {
355 printk("%s: can't find S3 Trio board\n", dp->full_name); 355 printk("%s: can't find S3 Trio board\n", dp->full_name);
356 return; 356 return;
357 } 357 }
358 358
359 if((pp = (int *)get_property(dp, "device-id", &len)) != NULL 359 if((pp = get_property(dp, "device-id", &len)) != NULL
360 && *pp!=PCI_DEVICE_ID_S3_TRIO) { 360 && *pp!=PCI_DEVICE_ID_S3_TRIO) {
361 printk("%s: can't find S3 Trio board\n", dp->full_name); 361 printk("%s: can't find S3 Trio board\n", dp->full_name);
362 return; 362 return;
363 } 363 }
364 364
365 if ((pp = (int *)get_property(dp, "depth", &len)) != NULL 365 if ((pp = get_property(dp, "depth", &len)) != NULL
366 && len == sizeof(int) && *pp != 8) { 366 && len == sizeof(int) && *pp != 8) {
367 printk("%s: can't use depth = %d\n", dp->full_name, *pp); 367 printk("%s: can't use depth = %d\n", dp->full_name, *pp);
368 return; 368 return;
369 } 369 }
370 if ((pp = (int *)get_property(dp, "width", &len)) != NULL 370 if ((pp = get_property(dp, "width", &len)) != NULL
371 && len == sizeof(int)) 371 && len == sizeof(int))
372 fb_var.xres = fb_var.xres_virtual = *pp; 372 fb_var.xres = fb_var.xres_virtual = *pp;
373 if ((pp = (int *)get_property(dp, "height", &len)) != NULL 373 if ((pp = get_property(dp, "height", &len)) != NULL
374 && len == sizeof(int)) 374 && len == sizeof(int))
375 fb_var.yres = fb_var.yres_virtual = *pp; 375 fb_var.yres = fb_var.yres_virtual = *pp;
376 if ((pp = (int *)get_property(dp, "linebytes", &len)) != NULL 376 if ((pp = get_property(dp, "linebytes", &len)) != NULL
377 && len == sizeof(int)) 377 && len == sizeof(int))
378 fb_fix.line_length = *pp; 378 fb_fix.line_length = *pp;
379 else 379 else
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 51b78f8de949..60c37add2579 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -412,11 +412,11 @@ static int __devinit radeon_find_mem_vbios(struct radeonfb_info *rinfo)
412static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo) 412static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
413{ 413{
414 struct device_node *dp = rinfo->of_node; 414 struct device_node *dp = rinfo->of_node;
415 u32 *val; 415 const u32 *val;
416 416
417 if (dp == NULL) 417 if (dp == NULL)
418 return -ENODEV; 418 return -ENODEV;
419 val = (u32 *) get_property(dp, "ATY,RefCLK", NULL); 419 val = get_property(dp, "ATY,RefCLK", NULL);
420 if (!val || !*val) { 420 if (!val || !*val) {
421 printk(KERN_WARNING "radeonfb: No ATY,RefCLK property !\n"); 421 printk(KERN_WARNING "radeonfb: No ATY,RefCLK property !\n");
422 return -EINVAL; 422 return -EINVAL;
@@ -424,11 +424,11 @@ static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
424 424
425 rinfo->pll.ref_clk = (*val) / 10; 425 rinfo->pll.ref_clk = (*val) / 10;
426 426
427 val = (u32 *) get_property(dp, "ATY,SCLK", NULL); 427 val = get_property(dp, "ATY,SCLK", NULL);
428 if (val && *val) 428 if (val && *val)
429 rinfo->pll.sclk = (*val) / 10; 429 rinfo->pll.sclk = (*val) / 10;
430 430
431 val = (u32 *) get_property(dp, "ATY,MCLK", NULL); 431 val = get_property(dp, "ATY,MCLK", NULL);
432 if (val && *val) 432 if (val && *val)
433 rinfo->pll.mclk = (*val) / 10; 433 rinfo->pll.mclk = (*val) / 10;
434 434
diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c
index 98c05bc0de44..ea531a6f45d1 100644
--- a/drivers/video/aty/radeon_monitor.c
+++ b/drivers/video/aty/radeon_monitor.c
@@ -64,13 +64,13 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
64{ 64{
65 static char *propnames[] = { "DFP,EDID", "LCD,EDID", "EDID", 65 static char *propnames[] = { "DFP,EDID", "LCD,EDID", "EDID",
66 "EDID1", "EDID2", NULL }; 66 "EDID1", "EDID2", NULL };
67 u8 *pedid = NULL; 67 const u8 *pedid = NULL;
68 u8 *pmt = NULL; 68 const u8 *pmt = NULL;
69 u8 *tmp; 69 u8 *tmp;
70 int i, mt = MT_NONE; 70 int i, mt = MT_NONE;
71 71
72 RTRACE("analyzing OF properties...\n"); 72 RTRACE("analyzing OF properties...\n");
73 pmt = (u8 *)get_property(dp, "display-type", NULL); 73 pmt = get_property(dp, "display-type", NULL);
74 if (!pmt) 74 if (!pmt)
75 return MT_NONE; 75 return MT_NONE;
76 RTRACE("display-type: %s\n", pmt); 76 RTRACE("display-type: %s\n", pmt);
@@ -89,7 +89,7 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_
89 } 89 }
90 90
91 for (i = 0; propnames[i] != NULL; ++i) { 91 for (i = 0; propnames[i] != NULL; ++i) {
92 pedid = (u8 *)get_property(dp, propnames[i], NULL); 92 pedid = get_property(dp, propnames[i], NULL);
93 if (pedid != NULL) 93 if (pedid != NULL)
94 break; 94 break;
95 } 95 }
@@ -124,14 +124,14 @@ static int __devinit radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_
124 return MT_NONE; 124 return MT_NONE;
125 125
126 if (rinfo->has_CRTC2) { 126 if (rinfo->has_CRTC2) {
127 char *pname; 127 const char *pname;
128 int len, second = 0; 128 int len, second = 0;
129 129
130 dp = dp->child; 130 dp = dp->child;
131 do { 131 do {
132 if (!dp) 132 if (!dp)
133 return MT_NONE; 133 return MT_NONE;
134 pname = (char *)get_property(dp, "name", NULL); 134 pname = get_property(dp, "name", NULL);
135 if (!pname) 135 if (!pname)
136 return MT_NONE; 136 return MT_NONE;
137 len = strlen(pname); 137 len = strlen(pname);
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index c7091761cef4..b9b9396d3bde 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -1167,7 +1167,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo)
1167 0x21320032, 0xa1320032, 0x21320032, 0xffffffff, 1167 0x21320032, 0xa1320032, 0x21320032, 0xffffffff,
1168 0x31320032 }; 1168 0x31320032 };
1169 1169
1170 u32 *mrtable = default_mrtable; 1170 const u32 *mrtable = default_mrtable;
1171 int i, mrtable_size = ARRAY_SIZE(default_mrtable); 1171 int i, mrtable_size = ARRAY_SIZE(default_mrtable);
1172 1172
1173 mdelay(30); 1173 mdelay(30);
@@ -1186,7 +1186,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo)
1186 if (rinfo->of_node != NULL) { 1186 if (rinfo->of_node != NULL) {
1187 int size; 1187 int size;
1188 1188
1189 mrtable = (u32 *)get_property(rinfo->of_node, "ATY,MRT", &size); 1189 mrtable = get_property(rinfo->of_node, "ATY,MRT", &size);
1190 if (mrtable) 1190 if (mrtable)
1191 mrtable_size = size >> 2; 1191 mrtable_size = size >> 2;
1192 else 1192 else
diff --git a/drivers/video/nvidia/nv_of.c b/drivers/video/nvidia/nv_of.c
index 8209106e26ee..d9af88c2b580 100644
--- a/drivers/video/nvidia/nv_of.c
+++ b/drivers/video/nvidia/nv_of.c
@@ -32,7 +32,7 @@ int nvidia_probe_of_connector(struct fb_info *info, int conn, u8 **out_edid)
32{ 32{
33 struct nvidia_par *par = info->par; 33 struct nvidia_par *par = info->par;
34 struct device_node *parent, *dp; 34 struct device_node *parent, *dp;
35 unsigned char *pedid = NULL; 35 const unsigned char *pedid = NULL;
36 static char *propnames[] = { 36 static char *propnames[] = {
37 "DFP,EDID", "LCD,EDID", "EDID", "EDID1", 37 "DFP,EDID", "LCD,EDID", "EDID", "EDID1",
38 "EDID,B", "EDID,A", NULL }; 38 "EDID,B", "EDID,A", NULL };
@@ -42,20 +42,19 @@ int nvidia_probe_of_connector(struct fb_info *info, int conn, u8 **out_edid)
42 if (parent == NULL) 42 if (parent == NULL)
43 return -1; 43 return -1;
44 if (par->twoHeads) { 44 if (par->twoHeads) {
45 char *pname; 45 const char *pname;
46 int len; 46 int len;
47 47
48 for (dp = NULL; 48 for (dp = NULL;
49 (dp = of_get_next_child(parent, dp)) != NULL;) { 49 (dp = of_get_next_child(parent, dp)) != NULL;) {
50 pname = (char *)get_property(dp, "name", NULL); 50 pname = get_property(dp, "name", NULL);
51 if (!pname) 51 if (!pname)
52 continue; 52 continue;
53 len = strlen(pname); 53 len = strlen(pname);
54 if ((pname[len-1] == 'A' && conn == 1) || 54 if ((pname[len-1] == 'A' && conn == 1) ||
55 (pname[len-1] == 'B' && conn == 2)) { 55 (pname[len-1] == 'B' && conn == 2)) {
56 for (i = 0; propnames[i] != NULL; ++i) { 56 for (i = 0; propnames[i] != NULL; ++i) {
57 pedid = (unsigned char *) 57 pedid = get_property(dp, propnames[i],
58 get_property(dp, propnames[i],
59 NULL); 58 NULL);
60 if (pedid != NULL) 59 if (pedid != NULL)
61 break; 60 break;
@@ -67,8 +66,7 @@ int nvidia_probe_of_connector(struct fb_info *info, int conn, u8 **out_edid)
67 } 66 }
68 if (pedid == NULL) { 67 if (pedid == NULL) {
69 for (i = 0; propnames[i] != NULL; ++i) { 68 for (i = 0; propnames[i] != NULL; ++i) {
70 pedid = (unsigned char *) 69 pedid = get_property(parent, propnames[i], NULL);
71 get_property(parent, propnames[i], NULL);
72 if (pedid != NULL) 70 if (pedid != NULL)
73 break; 71 break;
74 } 72 }
diff --git a/drivers/video/offb.c b/drivers/video/offb.c
index faba67228526..0e750a8510fc 100644
--- a/drivers/video/offb.c
+++ b/drivers/video/offb.c
@@ -410,30 +410,30 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
410 unsigned int flags, rsize, addr_prop = 0; 410 unsigned int flags, rsize, addr_prop = 0;
411 unsigned long max_size = 0; 411 unsigned long max_size = 0;
412 u64 rstart, address = OF_BAD_ADDR; 412 u64 rstart, address = OF_BAD_ADDR;
413 u32 *pp, *addrp, *up; 413 const u32 *pp, *addrp, *up;
414 u64 asize; 414 u64 asize;
415 415
416 pp = (u32 *)get_property(dp, "linux,bootx-depth", &len); 416 pp = get_property(dp, "linux,bootx-depth", &len);
417 if (pp == NULL) 417 if (pp == NULL)
418 pp = (u32 *)get_property(dp, "depth", &len); 418 pp = get_property(dp, "depth", &len);
419 if (pp && len == sizeof(u32)) 419 if (pp && len == sizeof(u32))
420 depth = *pp; 420 depth = *pp;
421 421
422 pp = (u32 *)get_property(dp, "linux,bootx-width", &len); 422 pp = get_property(dp, "linux,bootx-width", &len);
423 if (pp == NULL) 423 if (pp == NULL)
424 pp = (u32 *)get_property(dp, "width", &len); 424 pp = get_property(dp, "width", &len);
425 if (pp && len == sizeof(u32)) 425 if (pp && len == sizeof(u32))
426 width = *pp; 426 width = *pp;
427 427
428 pp = (u32 *)get_property(dp, "linux,bootx-height", &len); 428 pp = get_property(dp, "linux,bootx-height", &len);
429 if (pp == NULL) 429 if (pp == NULL)
430 pp = (u32 *)get_property(dp, "height", &len); 430 pp = get_property(dp, "height", &len);
431 if (pp && len == sizeof(u32)) 431 if (pp && len == sizeof(u32))
432 height = *pp; 432 height = *pp;
433 433
434 pp = (u32 *)get_property(dp, "linux,bootx-linebytes", &len); 434 pp = get_property(dp, "linux,bootx-linebytes", &len);
435 if (pp == NULL) 435 if (pp == NULL)
436 pp = (u32 *)get_property(dp, "linebytes", &len); 436 pp = get_property(dp, "linebytes", &len);
437 if (pp && len == sizeof(u32)) 437 if (pp && len == sizeof(u32))
438 pitch = *pp; 438 pitch = *pp;
439 else 439 else
@@ -451,9 +451,9 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
451 * ranges and pick one that is both big enough and if possible encloses 451 * ranges and pick one that is both big enough and if possible encloses
452 * the "address" property. If none match, we pick the biggest 452 * the "address" property. If none match, we pick the biggest
453 */ 453 */
454 up = (u32 *)get_property(dp, "linux,bootx-addr", &len); 454 up = get_property(dp, "linux,bootx-addr", &len);
455 if (up == NULL) 455 if (up == NULL)
456 up = (u32 *)get_property(dp, "address", &len); 456 up = get_property(dp, "address", &len);
457 if (up && len == sizeof(u32)) 457 if (up && len == sizeof(u32))
458 addr_prop = *up; 458 addr_prop = *up;
459 459
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 2788655e6e7d..6a30c0ca1de0 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -1816,14 +1816,13 @@ static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
1816 NVTRACE_ENTER(); 1816 NVTRACE_ENTER();
1817 dp = pci_device_to_OF_node(pd); 1817 dp = pci_device_to_OF_node(pd);
1818 for (; dp != NULL; dp = dp->child) { 1818 for (; dp != NULL; dp = dp->child) {
1819 disptype = (unsigned char *)get_property(dp, "display-type", NULL); 1819 disptype = get_property(dp, "display-type", NULL);
1820 if (disptype == NULL) 1820 if (disptype == NULL)
1821 continue; 1821 continue;
1822 if (strncmp(disptype, "LCD", 3) != 0) 1822 if (strncmp(disptype, "LCD", 3) != 0)
1823 continue; 1823 continue;
1824 for (i = 0; propnames[i] != NULL; ++i) { 1824 for (i = 0; propnames[i] != NULL; ++i) {
1825 pedid = (unsigned char *) 1825 pedid = get_property(dp, propnames[i], NULL);
1826 get_property(dp, propnames[i], NULL);
1827 if (pedid != NULL) { 1826 if (pedid != NULL) {
1828 par->EDID = pedid; 1827 par->EDID = pedid;
1829 NVTRACE("LCD found.\n"); 1828 NVTRACE("LCD found.\n");