diff options
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/S3triofb.c | 12 | ||||
-rw-r--r-- | drivers/video/aty/aty128fb.c | 18 | ||||
-rw-r--r-- | drivers/video/aty/atyfb_base.c | 18 | ||||
-rw-r--r-- | drivers/video/aty/radeon_backlight.c | 4 | ||||
-rw-r--r-- | drivers/video/aty/radeon_base.c | 8 | ||||
-rw-r--r-- | drivers/video/aty/radeon_monitor.c | 12 | ||||
-rw-r--r-- | drivers/video/aty/radeon_pm.c | 4 | ||||
-rw-r--r-- | drivers/video/console/fbcon.c | 4 | ||||
-rw-r--r-- | drivers/video/nvidia/nv_backlight.c | 18 | ||||
-rw-r--r-- | drivers/video/nvidia/nv_of.c | 12 | ||||
-rw-r--r-- | drivers/video/offb.c | 22 | ||||
-rw-r--r-- | drivers/video/riva/fbdev.c | 23 |
12 files changed, 84 insertions, 71 deletions
diff --git a/drivers/video/S3triofb.c b/drivers/video/S3triofb.c index afd146f5f683..397005eb392d 100644 --- a/drivers/video/S3triofb.c +++ b/drivers/video/S3triofb.c | |||
@@ -349,30 +349,30 @@ static void __init s3triofb_of_init(struct device_node *dp) | |||
349 | s3trio_name[sizeof(s3trio_name)-1] = '\0'; | 349 | s3trio_name[sizeof(s3trio_name)-1] = '\0'; |
350 | strcpy(fb_fix.id, s3trio_name); | 350 | strcpy(fb_fix.id, s3trio_name); |
351 | 351 | ||
352 | if((pp = (int *)get_property(dp, "vendor-id", &len)) != NULL | 352 | if((pp = get_property(dp, "vendor-id", &len)) != NULL |
353 | && *pp!=PCI_VENDOR_ID_S3) { | 353 | && *pp!=PCI_VENDOR_ID_S3) { |
354 | printk("%s: can't find S3 Trio board\n", dp->full_name); | 354 | printk("%s: can't find S3 Trio board\n", dp->full_name); |
355 | return; | 355 | return; |
356 | } | 356 | } |
357 | 357 | ||
358 | if((pp = (int *)get_property(dp, "device-id", &len)) != NULL | 358 | if((pp = get_property(dp, "device-id", &len)) != NULL |
359 | && *pp!=PCI_DEVICE_ID_S3_TRIO) { | 359 | && *pp!=PCI_DEVICE_ID_S3_TRIO) { |
360 | printk("%s: can't find S3 Trio board\n", dp->full_name); | 360 | printk("%s: can't find S3 Trio board\n", dp->full_name); |
361 | return; | 361 | return; |
362 | } | 362 | } |
363 | 363 | ||
364 | if ((pp = (int *)get_property(dp, "depth", &len)) != NULL | 364 | if ((pp = get_property(dp, "depth", &len)) != NULL |
365 | && len == sizeof(int) && *pp != 8) { | 365 | && len == sizeof(int) && *pp != 8) { |
366 | printk("%s: can't use depth = %d\n", dp->full_name, *pp); | 366 | printk("%s: can't use depth = %d\n", dp->full_name, *pp); |
367 | return; | 367 | return; |
368 | } | 368 | } |
369 | if ((pp = (int *)get_property(dp, "width", &len)) != NULL | 369 | if ((pp = get_property(dp, "width", &len)) != NULL |
370 | && len == sizeof(int)) | 370 | && len == sizeof(int)) |
371 | fb_var.xres = fb_var.xres_virtual = *pp; | 371 | fb_var.xres = fb_var.xres_virtual = *pp; |
372 | if ((pp = (int *)get_property(dp, "height", &len)) != NULL | 372 | if ((pp = get_property(dp, "height", &len)) != NULL |
373 | && len == sizeof(int)) | 373 | && len == sizeof(int)) |
374 | fb_var.yres = fb_var.yres_virtual = *pp; | 374 | fb_var.yres = fb_var.yres_virtual = *pp; |
375 | if ((pp = (int *)get_property(dp, "linebytes", &len)) != NULL | 375 | if ((pp = get_property(dp, "linebytes", &len)) != NULL |
376 | && len == sizeof(int)) | 376 | && len == sizeof(int)) |
377 | fb_fix.line_length = *pp; | 377 | fb_fix.line_length = *pp; |
378 | else | 378 | else |
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index 3e827e04a2aa..276a21530b95 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c | |||
@@ -1801,10 +1801,14 @@ static struct backlight_properties aty128_bl_data = { | |||
1801 | static void aty128_bl_set_power(struct fb_info *info, int power) | 1801 | static void aty128_bl_set_power(struct fb_info *info, int power) |
1802 | { | 1802 | { |
1803 | mutex_lock(&info->bl_mutex); | 1803 | mutex_lock(&info->bl_mutex); |
1804 | up(&info->bl_dev->sem); | 1804 | |
1805 | info->bl_dev->props->power = power; | 1805 | if (info->bl_dev) { |
1806 | __aty128_bl_update_status(info->bl_dev); | 1806 | down(&info->bl_dev->sem); |
1807 | down(&info->bl_dev->sem); | 1807 | info->bl_dev->props->power = power; |
1808 | __aty128_bl_update_status(info->bl_dev); | ||
1809 | up(&info->bl_dev->sem); | ||
1810 | } | ||
1811 | |||
1808 | mutex_unlock(&info->bl_mutex); | 1812 | mutex_unlock(&info->bl_mutex); |
1809 | } | 1813 | } |
1810 | 1814 | ||
@@ -1828,7 +1832,7 @@ static void aty128_bl_init(struct aty128fb_par *par) | |||
1828 | bd = backlight_device_register(name, par, &aty128_bl_data); | 1832 | bd = backlight_device_register(name, par, &aty128_bl_data); |
1829 | if (IS_ERR(bd)) { | 1833 | if (IS_ERR(bd)) { |
1830 | info->bl_dev = NULL; | 1834 | info->bl_dev = NULL; |
1831 | printk("aty128: Backlight registration failed\n"); | 1835 | printk(KERN_WARNING "aty128: Backlight registration failed\n"); |
1832 | goto error; | 1836 | goto error; |
1833 | } | 1837 | } |
1834 | 1838 | ||
@@ -1839,11 +1843,11 @@ static void aty128_bl_init(struct aty128fb_par *par) | |||
1839 | 219 * FB_BACKLIGHT_MAX / MAX_LEVEL); | 1843 | 219 * FB_BACKLIGHT_MAX / MAX_LEVEL); |
1840 | mutex_unlock(&info->bl_mutex); | 1844 | mutex_unlock(&info->bl_mutex); |
1841 | 1845 | ||
1842 | up(&bd->sem); | 1846 | down(&bd->sem); |
1843 | bd->props->brightness = aty128_bl_data.max_brightness; | 1847 | bd->props->brightness = aty128_bl_data.max_brightness; |
1844 | bd->props->power = FB_BLANK_UNBLANK; | 1848 | bd->props->power = FB_BLANK_UNBLANK; |
1845 | bd->props->update_status(bd); | 1849 | bd->props->update_status(bd); |
1846 | down(&bd->sem); | 1850 | up(&bd->sem); |
1847 | 1851 | ||
1848 | #ifdef CONFIG_PMAC_BACKLIGHT | 1852 | #ifdef CONFIG_PMAC_BACKLIGHT |
1849 | mutex_lock(&pmac_backlight_mutex); | 1853 | mutex_lock(&pmac_backlight_mutex); |
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 053ff63365b7..19a71f045784 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -2200,10 +2200,14 @@ static struct backlight_properties aty_bl_data = { | |||
2200 | static void aty_bl_set_power(struct fb_info *info, int power) | 2200 | static void aty_bl_set_power(struct fb_info *info, int power) |
2201 | { | 2201 | { |
2202 | mutex_lock(&info->bl_mutex); | 2202 | mutex_lock(&info->bl_mutex); |
2203 | up(&info->bl_dev->sem); | 2203 | |
2204 | info->bl_dev->props->power = power; | 2204 | if (info->bl_dev) { |
2205 | __aty_bl_update_status(info->bl_dev); | 2205 | down(&info->bl_dev->sem); |
2206 | down(&info->bl_dev->sem); | 2206 | info->bl_dev->props->power = power; |
2207 | __aty_bl_update_status(info->bl_dev); | ||
2208 | up(&info->bl_dev->sem); | ||
2209 | } | ||
2210 | |||
2207 | mutex_unlock(&info->bl_mutex); | 2211 | mutex_unlock(&info->bl_mutex); |
2208 | } | 2212 | } |
2209 | 2213 | ||
@@ -2223,7 +2227,7 @@ static void aty_bl_init(struct atyfb_par *par) | |||
2223 | bd = backlight_device_register(name, par, &aty_bl_data); | 2227 | bd = backlight_device_register(name, par, &aty_bl_data); |
2224 | if (IS_ERR(bd)) { | 2228 | if (IS_ERR(bd)) { |
2225 | info->bl_dev = NULL; | 2229 | info->bl_dev = NULL; |
2226 | printk("aty: Backlight registration failed\n"); | 2230 | printk(KERN_WARNING "aty: Backlight registration failed\n"); |
2227 | goto error; | 2231 | goto error; |
2228 | } | 2232 | } |
2229 | 2233 | ||
@@ -2234,11 +2238,11 @@ static void aty_bl_init(struct atyfb_par *par) | |||
2234 | 0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL); | 2238 | 0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL); |
2235 | mutex_unlock(&info->bl_mutex); | 2239 | mutex_unlock(&info->bl_mutex); |
2236 | 2240 | ||
2237 | up(&bd->sem); | 2241 | down(&bd->sem); |
2238 | bd->props->brightness = aty_bl_data.max_brightness; | 2242 | bd->props->brightness = aty_bl_data.max_brightness; |
2239 | bd->props->power = FB_BLANK_UNBLANK; | 2243 | bd->props->power = FB_BLANK_UNBLANK; |
2240 | bd->props->update_status(bd); | 2244 | bd->props->update_status(bd); |
2241 | down(&bd->sem); | 2245 | up(&bd->sem); |
2242 | 2246 | ||
2243 | #ifdef CONFIG_PMAC_BACKLIGHT | 2247 | #ifdef CONFIG_PMAC_BACKLIGHT |
2244 | mutex_lock(&pmac_backlight_mutex); | 2248 | mutex_lock(&pmac_backlight_mutex); |
diff --git a/drivers/video/aty/radeon_backlight.c b/drivers/video/aty/radeon_backlight.c index 1755dddf1899..585eb7b9e636 100644 --- a/drivers/video/aty/radeon_backlight.c +++ b/drivers/video/aty/radeon_backlight.c | |||
@@ -195,11 +195,11 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo) | |||
195 | 217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL); | 195 | 217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL); |
196 | mutex_unlock(&rinfo->info->bl_mutex); | 196 | mutex_unlock(&rinfo->info->bl_mutex); |
197 | 197 | ||
198 | up(&bd->sem); | 198 | down(&bd->sem); |
199 | bd->props->brightness = radeon_bl_data.max_brightness; | 199 | bd->props->brightness = radeon_bl_data.max_brightness; |
200 | bd->props->power = FB_BLANK_UNBLANK; | 200 | bd->props->power = FB_BLANK_UNBLANK; |
201 | bd->props->update_status(bd); | 201 | bd->props->update_status(bd); |
202 | down(&bd->sem); | 202 | up(&bd->sem); |
203 | 203 | ||
204 | #ifdef CONFIG_PMAC_BACKLIGHT | 204 | #ifdef CONFIG_PMAC_BACKLIGHT |
205 | mutex_lock(&pmac_backlight_mutex); | 205 | mutex_lock(&pmac_backlight_mutex); |
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c index 8e3400d5dd21..0ed577e7cc21 100644 --- a/drivers/video/aty/radeon_base.c +++ b/drivers/video/aty/radeon_base.c | |||
@@ -413,11 +413,11 @@ static int __devinit radeon_find_mem_vbios(struct radeonfb_info *rinfo) | |||
413 | static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo) | 413 | static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo) |
414 | { | 414 | { |
415 | struct device_node *dp = rinfo->of_node; | 415 | struct device_node *dp = rinfo->of_node; |
416 | u32 *val; | 416 | const u32 *val; |
417 | 417 | ||
418 | if (dp == NULL) | 418 | if (dp == NULL) |
419 | return -ENODEV; | 419 | return -ENODEV; |
420 | val = (u32 *) get_property(dp, "ATY,RefCLK", NULL); | 420 | val = get_property(dp, "ATY,RefCLK", NULL); |
421 | if (!val || !*val) { | 421 | if (!val || !*val) { |
422 | printk(KERN_WARNING "radeonfb: No ATY,RefCLK property !\n"); | 422 | printk(KERN_WARNING "radeonfb: No ATY,RefCLK property !\n"); |
423 | return -EINVAL; | 423 | return -EINVAL; |
@@ -425,11 +425,11 @@ static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo) | |||
425 | 425 | ||
426 | rinfo->pll.ref_clk = (*val) / 10; | 426 | rinfo->pll.ref_clk = (*val) / 10; |
427 | 427 | ||
428 | val = (u32 *) get_property(dp, "ATY,SCLK", NULL); | 428 | val = get_property(dp, "ATY,SCLK", NULL); |
429 | if (val && *val) | 429 | if (val && *val) |
430 | rinfo->pll.sclk = (*val) / 10; | 430 | rinfo->pll.sclk = (*val) / 10; |
431 | 431 | ||
432 | val = (u32 *) get_property(dp, "ATY,MCLK", NULL); | 432 | val = get_property(dp, "ATY,MCLK", NULL); |
433 | if (val && *val) | 433 | if (val && *val) |
434 | rinfo->pll.mclk = (*val) / 10; | 434 | rinfo->pll.mclk = (*val) / 10; |
435 | 435 | ||
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 f31e606a2ded..e308ed2d249a 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c | |||
@@ -1268,7 +1268,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo) | |||
1268 | 0x21320032, 0xa1320032, 0x21320032, 0xffffffff, | 1268 | 0x21320032, 0xa1320032, 0x21320032, 0xffffffff, |
1269 | 0x31320032 }; | 1269 | 0x31320032 }; |
1270 | 1270 | ||
1271 | u32 *mrtable = default_mrtable; | 1271 | const u32 *mrtable = default_mrtable; |
1272 | int i, mrtable_size = ARRAY_SIZE(default_mrtable); | 1272 | int i, mrtable_size = ARRAY_SIZE(default_mrtable); |
1273 | 1273 | ||
1274 | mdelay(30); | 1274 | mdelay(30); |
@@ -1287,7 +1287,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo) | |||
1287 | if (rinfo->of_node != NULL) { | 1287 | if (rinfo->of_node != NULL) { |
1288 | int size; | 1288 | int size; |
1289 | 1289 | ||
1290 | mrtable = (u32 *)get_property(rinfo->of_node, "ATY,MRT", &size); | 1290 | mrtable = get_property(rinfo->of_node, "ATY,MRT", &size); |
1291 | if (mrtable) | 1291 | if (mrtable) |
1292 | mrtable_size = size >> 2; | 1292 | mrtable_size = size >> 2; |
1293 | else | 1293 | else |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 390439b3d899..1b4f75d1f8a9 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -3197,11 +3197,11 @@ static void fbcon_exit(void) | |||
3197 | return; | 3197 | return; |
3198 | 3198 | ||
3199 | #ifdef CONFIG_ATARI | 3199 | #ifdef CONFIG_ATARI |
3200 | free_irq(IRQ_AUTO_4, fbcon_vbl_handler); | 3200 | free_irq(IRQ_AUTO_4, fb_vbl_handler); |
3201 | #endif | 3201 | #endif |
3202 | #ifdef CONFIG_MAC | 3202 | #ifdef CONFIG_MAC |
3203 | if (MACH_IS_MAC && vbl_detected) | 3203 | if (MACH_IS_MAC && vbl_detected) |
3204 | free_irq(IRQ_MAC_VBL, fbcon_vbl_handler); | 3204 | free_irq(IRQ_MAC_VBL, fb_vbl_handler); |
3205 | #endif | 3205 | #endif |
3206 | 3206 | ||
3207 | kfree((void *)softback_buf); | 3207 | kfree((void *)softback_buf); |
diff --git a/drivers/video/nvidia/nv_backlight.c b/drivers/video/nvidia/nv_backlight.c index b45f577094ac..5b75ae4e9457 100644 --- a/drivers/video/nvidia/nv_backlight.c +++ b/drivers/video/nvidia/nv_backlight.c | |||
@@ -113,10 +113,14 @@ static struct backlight_properties nvidia_bl_data = { | |||
113 | void nvidia_bl_set_power(struct fb_info *info, int power) | 113 | void nvidia_bl_set_power(struct fb_info *info, int power) |
114 | { | 114 | { |
115 | mutex_lock(&info->bl_mutex); | 115 | mutex_lock(&info->bl_mutex); |
116 | up(&info->bl_dev->sem); | 116 | |
117 | info->bl_dev->props->power = power; | 117 | if (info->bl_dev) { |
118 | __nvidia_bl_update_status(info->bl_dev); | 118 | down(&info->bl_dev->sem); |
119 | down(&info->bl_dev->sem); | 119 | info->bl_dev->props->power = power; |
120 | __nvidia_bl_update_status(info->bl_dev); | ||
121 | up(&info->bl_dev->sem); | ||
122 | } | ||
123 | |||
120 | mutex_unlock(&info->bl_mutex); | 124 | mutex_unlock(&info->bl_mutex); |
121 | } | 125 | } |
122 | 126 | ||
@@ -140,7 +144,7 @@ void nvidia_bl_init(struct nvidia_par *par) | |||
140 | bd = backlight_device_register(name, par, &nvidia_bl_data); | 144 | bd = backlight_device_register(name, par, &nvidia_bl_data); |
141 | if (IS_ERR(bd)) { | 145 | if (IS_ERR(bd)) { |
142 | info->bl_dev = NULL; | 146 | info->bl_dev = NULL; |
143 | printk("nvidia: Backlight registration failed\n"); | 147 | printk(KERN_WARNING "nvidia: Backlight registration failed\n"); |
144 | goto error; | 148 | goto error; |
145 | } | 149 | } |
146 | 150 | ||
@@ -151,11 +155,11 @@ void nvidia_bl_init(struct nvidia_par *par) | |||
151 | 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); | 155 | 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); |
152 | mutex_unlock(&info->bl_mutex); | 156 | mutex_unlock(&info->bl_mutex); |
153 | 157 | ||
154 | up(&bd->sem); | 158 | down(&bd->sem); |
155 | bd->props->brightness = nvidia_bl_data.max_brightness; | 159 | bd->props->brightness = nvidia_bl_data.max_brightness; |
156 | bd->props->power = FB_BLANK_UNBLANK; | 160 | bd->props->power = FB_BLANK_UNBLANK; |
157 | bd->props->update_status(bd); | 161 | bd->props->update_status(bd); |
158 | down(&bd->sem); | 162 | up(&bd->sem); |
159 | 163 | ||
160 | #ifdef CONFIG_PMAC_BACKLIGHT | 164 | #ifdef CONFIG_PMAC_BACKLIGHT |
161 | mutex_lock(&pmac_backlight_mutex); | 165 | mutex_lock(&pmac_backlight_mutex); |
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 0013311e0564..bad0e98fb3b6 100644 --- a/drivers/video/offb.c +++ b/drivers/video/offb.c | |||
@@ -409,30 +409,30 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node) | |||
409 | unsigned int flags, rsize, addr_prop = 0; | 409 | unsigned int flags, rsize, addr_prop = 0; |
410 | unsigned long max_size = 0; | 410 | unsigned long max_size = 0; |
411 | u64 rstart, address = OF_BAD_ADDR; | 411 | u64 rstart, address = OF_BAD_ADDR; |
412 | u32 *pp, *addrp, *up; | 412 | const u32 *pp, *addrp, *up; |
413 | u64 asize; | 413 | u64 asize; |
414 | 414 | ||
415 | pp = (u32 *)get_property(dp, "linux,bootx-depth", &len); | 415 | pp = get_property(dp, "linux,bootx-depth", &len); |
416 | if (pp == NULL) | 416 | if (pp == NULL) |
417 | pp = (u32 *)get_property(dp, "depth", &len); | 417 | pp = get_property(dp, "depth", &len); |
418 | if (pp && len == sizeof(u32)) | 418 | if (pp && len == sizeof(u32)) |
419 | depth = *pp; | 419 | depth = *pp; |
420 | 420 | ||
421 | pp = (u32 *)get_property(dp, "linux,bootx-width", &len); | 421 | pp = get_property(dp, "linux,bootx-width", &len); |
422 | if (pp == NULL) | 422 | if (pp == NULL) |
423 | pp = (u32 *)get_property(dp, "width", &len); | 423 | pp = get_property(dp, "width", &len); |
424 | if (pp && len == sizeof(u32)) | 424 | if (pp && len == sizeof(u32)) |
425 | width = *pp; | 425 | width = *pp; |
426 | 426 | ||
427 | pp = (u32 *)get_property(dp, "linux,bootx-height", &len); | 427 | pp = get_property(dp, "linux,bootx-height", &len); |
428 | if (pp == NULL) | 428 | if (pp == NULL) |
429 | pp = (u32 *)get_property(dp, "height", &len); | 429 | pp = get_property(dp, "height", &len); |
430 | if (pp && len == sizeof(u32)) | 430 | if (pp && len == sizeof(u32)) |
431 | height = *pp; | 431 | height = *pp; |
432 | 432 | ||
433 | pp = (u32 *)get_property(dp, "linux,bootx-linebytes", &len); | 433 | pp = get_property(dp, "linux,bootx-linebytes", &len); |
434 | if (pp == NULL) | 434 | if (pp == NULL) |
435 | pp = (u32 *)get_property(dp, "linebytes", &len); | 435 | pp = get_property(dp, "linebytes", &len); |
436 | if (pp && len == sizeof(u32)) | 436 | if (pp && len == sizeof(u32)) |
437 | pitch = *pp; | 437 | pitch = *pp; |
438 | else | 438 | else |
@@ -450,9 +450,9 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node) | |||
450 | * ranges and pick one that is both big enough and if possible encloses | 450 | * ranges and pick one that is both big enough and if possible encloses |
451 | * the "address" property. If none match, we pick the biggest | 451 | * the "address" property. If none match, we pick the biggest |
452 | */ | 452 | */ |
453 | up = (u32 *)get_property(dp, "linux,bootx-addr", &len); | 453 | up = get_property(dp, "linux,bootx-addr", &len); |
454 | if (up == NULL) | 454 | if (up == NULL) |
455 | up = (u32 *)get_property(dp, "address", &len); | 455 | up = get_property(dp, "address", &len); |
456 | if (up && len == sizeof(u32)) | 456 | if (up && len == sizeof(u32)) |
457 | addr_prop = *up; | 457 | addr_prop = *up; |
458 | 458 | ||
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c index 76fc9d355eb7..67d1e1c8813d 100644 --- a/drivers/video/riva/fbdev.c +++ b/drivers/video/riva/fbdev.c | |||
@@ -355,10 +355,14 @@ static struct backlight_properties riva_bl_data = { | |||
355 | static void riva_bl_set_power(struct fb_info *info, int power) | 355 | static void riva_bl_set_power(struct fb_info *info, int power) |
356 | { | 356 | { |
357 | mutex_lock(&info->bl_mutex); | 357 | mutex_lock(&info->bl_mutex); |
358 | up(&info->bl_dev->sem); | 358 | |
359 | info->bl_dev->props->power = power; | 359 | if (info->bl_dev) { |
360 | __riva_bl_update_status(info->bl_dev); | 360 | down(&info->bl_dev->sem); |
361 | down(&info->bl_dev->sem); | 361 | info->bl_dev->props->power = power; |
362 | __riva_bl_update_status(info->bl_dev); | ||
363 | up(&info->bl_dev->sem); | ||
364 | } | ||
365 | |||
362 | mutex_unlock(&info->bl_mutex); | 366 | mutex_unlock(&info->bl_mutex); |
363 | } | 367 | } |
364 | 368 | ||
@@ -382,7 +386,7 @@ static void riva_bl_init(struct riva_par *par) | |||
382 | bd = backlight_device_register(name, par, &riva_bl_data); | 386 | bd = backlight_device_register(name, par, &riva_bl_data); |
383 | if (IS_ERR(bd)) { | 387 | if (IS_ERR(bd)) { |
384 | info->bl_dev = NULL; | 388 | info->bl_dev = NULL; |
385 | printk("riva: Backlight registration failed\n"); | 389 | printk(KERN_WARNING "riva: Backlight registration failed\n"); |
386 | goto error; | 390 | goto error; |
387 | } | 391 | } |
388 | 392 | ||
@@ -393,11 +397,11 @@ static void riva_bl_init(struct riva_par *par) | |||
393 | 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); | 397 | 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); |
394 | mutex_unlock(&info->bl_mutex); | 398 | mutex_unlock(&info->bl_mutex); |
395 | 399 | ||
396 | up(&bd->sem); | 400 | down(&bd->sem); |
397 | bd->props->brightness = riva_bl_data.max_brightness; | 401 | bd->props->brightness = riva_bl_data.max_brightness; |
398 | bd->props->power = FB_BLANK_UNBLANK; | 402 | bd->props->power = FB_BLANK_UNBLANK; |
399 | bd->props->update_status(bd); | 403 | bd->props->update_status(bd); |
400 | down(&bd->sem); | 404 | up(&bd->sem); |
401 | 405 | ||
402 | #ifdef CONFIG_PMAC_BACKLIGHT | 406 | #ifdef CONFIG_PMAC_BACKLIGHT |
403 | mutex_lock(&pmac_backlight_mutex); | 407 | mutex_lock(&pmac_backlight_mutex); |
@@ -1831,14 +1835,13 @@ static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd) | |||
1831 | NVTRACE_ENTER(); | 1835 | NVTRACE_ENTER(); |
1832 | dp = pci_device_to_OF_node(pd); | 1836 | dp = pci_device_to_OF_node(pd); |
1833 | for (; dp != NULL; dp = dp->child) { | 1837 | for (; dp != NULL; dp = dp->child) { |
1834 | disptype = (unsigned char *)get_property(dp, "display-type", NULL); | 1838 | disptype = get_property(dp, "display-type", NULL); |
1835 | if (disptype == NULL) | 1839 | if (disptype == NULL) |
1836 | continue; | 1840 | continue; |
1837 | if (strncmp(disptype, "LCD", 3) != 0) | 1841 | if (strncmp(disptype, "LCD", 3) != 0) |
1838 | continue; | 1842 | continue; |
1839 | for (i = 0; propnames[i] != NULL; ++i) { | 1843 | for (i = 0; propnames[i] != NULL; ++i) { |
1840 | pedid = (unsigned char *) | 1844 | pedid = get_property(dp, propnames[i], NULL); |
1841 | get_property(dp, propnames[i], NULL); | ||
1842 | if (pedid != NULL) { | 1845 | if (pedid != NULL) { |
1843 | par->EDID = pedid; | 1846 | par->EDID = pedid; |
1844 | NVTRACE("LCD found.\n"); | 1847 | NVTRACE("LCD found.\n"); |