Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'fbdev-for-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev updates from Helge Deller:
"One potential buffer overflow fix in the framebuffer registration
function, some fixes for the imxfb, nvidiafb and simplefb drivers, and
a bunch of cleanups for fbcon, kyrofb and svgalib.

Framework fixes:
- fix potential buffer overflow in do_register_framebuffer() [Yongzhen Zhang]

Driver fixes:
- imxfb: prevent null-ptr-deref [Chenyuan Yang]
- nvidiafb: fix build on 32-bit ARCH=um [Johannes Berg]
- nvidiafb: add depends on HAS_IOPORT [Randy Dunlap]
- simplefb: Use of_reserved_mem_region_to_resource() for "memory-region" [Rob Herring]

Cleanups:
- fbcon: various code cleanups wrt blinking [Ville Syrjälä]
- kyrofb: Convert to devm_*() functions [Giovanni Di Santi]
- svgalib: Coding style cleanups [Darshan R.]
- Fix typo in Kconfig text for FB_DEVICE [Daniel Palmer]"

* tag 'fbdev-for-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
fbcon: Use 'bool' where appopriate
fbcon: Introduce get_{fg,bg}_color()
fbcon: fbcon_is_inactive() -> fbcon_is_active()
fbcon: fbcon_cursor_noblink -> fbcon_cursor_blink
fbdev: Fix typo in Kconfig text for FB_DEVICE
fbdev: imxfb: Check fb_add_videomode to prevent null-ptr-deref
fbdev: svgalib: Clean up coding style
fbdev: kyro: Use devm_ioremap_wc() for screen mem
fbdev: kyro: Use devm_ioremap() for mmio registers
fbdev: kyro: Add missing PCI memory region request
fbdev: simplefb: Use of_reserved_mem_region_to_resource() for "memory-region"
fbdev: fix potential buffer overflow in do_register_framebuffer()
fbdev: nvidiafb: add depends on HAS_IOPORT
fbdev: nvidiafb: fix build on 32-bit ARCH=um

+116 -115
+1 -1
drivers/video/fbdev/Kconfig
··· 660 660 661 661 config FB_NVIDIA 662 662 tristate "nVidia Framebuffer Support" 663 - depends on FB && PCI 663 + depends on FB && PCI && HAS_IOPORT 664 664 select FB_CFB_FILLRECT 665 665 select FB_CFB_COPYAREA 666 666 select FB_CFB_IMAGEBLIT
+1 -1
drivers/video/fbdev/core/Kconfig
··· 16 16 default FB 17 17 help 18 18 Say Y here if you want the legacy /dev/fb* device file and 19 - interfaces within sysfs anc procfs. It is only required if you 19 + interfaces within sysfs and procfs. It is only required if you 20 20 have userspace programs that depend on fbdev for graphics output. 21 21 This does not affect the framebuffer console. If unsure, say N. 22 22
+45 -32
drivers/video/fbdev/core/fbcon.c
··· 135 135 /* console mappings */ 136 136 static unsigned int first_fb_vc; 137 137 static unsigned int last_fb_vc = MAX_NR_CONSOLES - 1; 138 - static int fbcon_is_default = 1; 138 + static bool fbcon_is_default = true; 139 139 static int primary_device = -1; 140 - static int fbcon_has_console_bind; 140 + static bool fbcon_has_console_bind; 141 141 142 142 #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY 143 143 static int map_override; ··· 172 172 173 173 #define advance_row(p, delta) (unsigned short *)((unsigned long)(p) + (delta) * vc->vc_size_row) 174 174 175 - static int fbcon_cursor_noblink; 175 + static bool fbcon_cursor_blink = true; 176 176 177 177 #define divides(a, b) ((!(a) || (b)%(a)) ? 0 : 1) 178 178 ··· 289 289 #endif 290 290 } 291 291 292 - static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info) 292 + static inline bool fbcon_is_active(struct vc_data *vc, struct fb_info *info) 293 293 { 294 294 struct fbcon_ops *ops = info->fbcon_par; 295 295 296 - return (info->state != FBINFO_STATE_RUNNING || 297 - vc->vc_mode != KD_TEXT || ops->graphics || fbcon_skip_panic(info)); 296 + return info->state == FBINFO_STATE_RUNNING && 297 + vc->vc_mode == KD_TEXT && !ops->graphics && !fbcon_skip_panic(info); 298 298 } 299 299 300 300 static int get_color(struct vc_data *vc, struct fb_info *info, 301 - u16 c, int is_fg) 301 + u16 c, bool is_fg) 302 302 { 303 303 int depth = fb_get_color_depth(&info->var, &info->fix); 304 304 int color = 0; ··· 364 364 return color; 365 365 } 366 366 367 + static int get_fg_color(struct vc_data *vc, struct fb_info *info, u16 c) 368 + { 369 + return get_color(vc, info, c, true); 370 + } 371 + 372 + static int get_bg_color(struct vc_data *vc, struct fb_info *info, u16 c) 373 + { 374 + return get_color(vc, info, c, false); 375 + } 376 + 367 377 static void fb_flashcursor(struct work_struct *work) 368 378 { 369 379 struct fbcon_ops *ops = container_of(work, struct fbcon_ops, cursor_work.work); ··· 405 395 406 396 c = scr_readw((u16 *) vc->vc_pos); 407 397 enable = ops->cursor_flash && !ops->cursor_state.enable; 408 - ops->cursor(vc, info, enable, get_color(vc, info, c, 1), 409 - get_color(vc, info, c, 0)); 398 + ops->cursor(vc, info, enable, 399 + get_fg_color(vc, info, c), 400 + get_bg_color(vc, info, c)); 410 401 console_unlock(); 411 402 412 403 queue_delayed_work(system_power_efficient_wq, &ops->cursor_work, ··· 418 407 { 419 408 struct fbcon_ops *ops = info->fbcon_par; 420 409 421 - if (!fbcon_cursor_noblink) 410 + if (fbcon_cursor_blink) 422 411 queue_delayed_work(system_power_efficient_wq, &ops->cursor_work, 423 412 ops->cur_blink_jiffies); 424 413 } ··· 475 464 last_fb_vc = simple_strtoul(options, &options, 10) - 1; 476 465 if (last_fb_vc < first_fb_vc || last_fb_vc >= MAX_NR_CONSOLES) 477 466 last_fb_vc = MAX_NR_CONSOLES - 1; 478 - fbcon_is_default = 0; 467 + fbcon_is_default = false; 479 468 continue; 480 469 } 481 470 ··· 570 559 con2fb_map[i] = -1; 571 560 info_idx = -1; 572 561 } else { 573 - fbcon_has_console_bind = 1; 562 + fbcon_has_console_bind = true; 574 563 } 575 564 576 565 return err; ··· 1278 1267 struct fbcon_display *p = &fb_display[vc->vc_num]; 1279 1268 u_int y_break; 1280 1269 1281 - if (fbcon_is_inactive(vc, info)) 1270 + if (!fbcon_is_active(vc, info)) 1282 1271 return; 1283 1272 1284 1273 if (!height || !width) ··· 1322 1311 struct fbcon_display *p = &fb_display[vc->vc_num]; 1323 1312 struct fbcon_ops *ops = info->fbcon_par; 1324 1313 1325 - if (!fbcon_is_inactive(vc, info)) 1314 + if (fbcon_is_active(vc, info)) 1326 1315 ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, 1327 - get_color(vc, info, scr_readw(s), 1), 1328 - get_color(vc, info, scr_readw(s), 0)); 1316 + get_fg_color(vc, info, scr_readw(s)), 1317 + get_bg_color(vc, info, scr_readw(s))); 1329 1318 } 1330 1319 1331 1320 static void fbcon_clear_margins(struct vc_data *vc, int bottom_only) ··· 1333 1322 struct fb_info *info = fbcon_info_from_console(vc->vc_num); 1334 1323 struct fbcon_ops *ops = info->fbcon_par; 1335 1324 1336 - if (!fbcon_is_inactive(vc, info)) 1325 + if (fbcon_is_active(vc, info)) 1337 1326 ops->clear_margins(vc, info, margin_color, bottom_only); 1338 1327 } 1339 1328 ··· 1345 1334 1346 1335 ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms); 1347 1336 1348 - if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1) 1337 + if (!fbcon_is_active(vc, info) || vc->vc_deccm != 1) 1349 1338 return; 1350 1339 1351 1340 if (vc->vc_cursor_type & CUR_SW) ··· 1358 1347 if (!ops->cursor) 1359 1348 return; 1360 1349 1361 - ops->cursor(vc, info, enable, get_color(vc, info, c, 1), 1362 - get_color(vc, info, c, 0)); 1350 + ops->cursor(vc, info, enable, 1351 + get_fg_color(vc, info, c), 1352 + get_bg_color(vc, info, c)); 1363 1353 } 1364 1354 1365 1355 static int scrollback_phys_max = 0; ··· 1752 1740 struct fb_info *info = fbcon_info_from_console(vc->vc_num); 1753 1741 struct fbcon_display *p = &fb_display[vc->vc_num]; 1754 1742 1755 - if (fbcon_is_inactive(vc, info)) 1743 + if (!fbcon_is_active(vc, info)) 1756 1744 return; 1757 1745 1758 1746 if (!width || !height) ··· 1776 1764 struct fbcon_display *p = &fb_display[vc->vc_num]; 1777 1765 int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK; 1778 1766 1779 - if (fbcon_is_inactive(vc, info)) 1767 + if (!fbcon_is_active(vc, info)) 1780 1768 return true; 1781 1769 1782 1770 fbcon_cursor(vc, false); ··· 2160 2148 fbcon_del_cursor_work(old_info); 2161 2149 } 2162 2150 2163 - if (fbcon_is_inactive(vc, info) || 2151 + if (!fbcon_is_active(vc, info) || 2164 2152 ops->blank_state != FB_BLANK_UNBLANK) 2165 2153 fbcon_del_cursor_work(info); 2166 2154 else ··· 2200 2188 scrollback_max = 0; 2201 2189 scrollback_current = 0; 2202 2190 2203 - if (!fbcon_is_inactive(vc, info)) { 2191 + if (fbcon_is_active(vc, info)) { 2204 2192 ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; 2205 2193 ops->update_start(info); 2206 2194 } ··· 2256 2244 } 2257 2245 } 2258 2246 2259 - if (!fbcon_is_inactive(vc, info)) { 2247 + if (fbcon_is_active(vc, info)) { 2260 2248 if (ops->blank_state != blank) { 2261 2249 ops->blank_state = blank; 2262 2250 fbcon_cursor(vc, !blank); ··· 2270 2258 update_screen(vc); 2271 2259 } 2272 2260 2273 - if (mode_switch || fbcon_is_inactive(vc, info) || 2261 + if (mode_switch || !fbcon_is_active(vc, info) || 2274 2262 ops->blank_state != FB_BLANK_UNBLANK) 2275 2263 fbcon_del_cursor_work(info); 2276 2264 else ··· 2600 2588 int i, j, k, depth; 2601 2589 u8 val; 2602 2590 2603 - if (fbcon_is_inactive(vc, info)) 2591 + if (!fbcon_is_active(vc, info)) 2604 2592 return; 2605 2593 2606 2594 if (!con_is_visible(vc)) ··· 2700 2688 scrollback_max = 0; 2701 2689 scrollback_current = 0; 2702 2690 2703 - if (!fbcon_is_inactive(vc, info)) { 2691 + if (fbcon_is_active(vc, info)) { 2704 2692 ops->var.xoffset = ops->var.yoffset = p->yscroll = 0; 2705 2693 ops->update_start(info); 2706 2694 } ··· 2818 2806 fbcon_is_default); 2819 2807 2820 2808 if (!ret) 2821 - fbcon_has_console_bind = 0; 2809 + fbcon_has_console_bind = false; 2822 2810 } 2823 2811 #else 2824 2812 static inline void fbcon_unbind(void) {} ··· 3269 3257 const char *buf, size_t count) 3270 3258 { 3271 3259 struct fb_info *info; 3272 - int blink, idx; 3273 3260 char **last = NULL; 3261 + bool blink; 3262 + int idx; 3274 3263 3275 3264 console_lock(); 3276 3265 idx = con2fb_map[fg_console]; ··· 3287 3274 blink = simple_strtoul(buf, last, 0); 3288 3275 3289 3276 if (blink) { 3290 - fbcon_cursor_noblink = 0; 3277 + fbcon_cursor_blink = true; 3291 3278 fbcon_add_cursor_work(info); 3292 3279 } else { 3293 - fbcon_cursor_noblink = 1; 3280 + fbcon_cursor_blink = false; 3294 3281 fbcon_del_cursor_work(info); 3295 3282 } 3296 3283
+3
drivers/video/fbdev/core/fbmem.c
··· 449 449 if (!registered_fb[i]) 450 450 break; 451 451 452 + if (i >= FB_MAX) 453 + return -ENXIO; 454 + 452 455 if (!fb_info->modelist.prev || !fb_info->modelist.next) 453 456 INIT_LIST_HEAD(&fb_info->modelist); 454 457
+42 -53
drivers/video/fbdev/core/svgalib.c
··· 20 20 #include <asm/types.h> 21 21 #include <asm/io.h> 22 22 23 - 24 23 /* Write a CRT register value spread across multiple registers */ 25 24 void svga_wcrt_multi(void __iomem *regbase, const struct vga_regset *regset, u32 value) 26 25 { ··· 31 32 while (bitnum <= regset->highbit) { 32 33 bitval = 1 << bitnum; 33 34 regval = regval & ~bitval; 34 - if (value & 1) regval = regval | bitval; 35 - bitnum ++; 35 + if (value & 1) 36 + regval = regval | bitval; 37 + bitnum++; 36 38 value = value >> 1; 37 39 } 38 40 vga_wcrt(regbase, regset->regnum, regval); 39 - regset ++; 41 + regset++; 40 42 } 41 43 } 42 44 ··· 52 52 while (bitnum <= regset->highbit) { 53 53 bitval = 1 << bitnum; 54 54 regval = regval & ~bitval; 55 - if (value & 1) regval = regval | bitval; 56 - bitnum ++; 55 + if (value & 1) 56 + regval = regval | bitval; 57 + bitnum++; 57 58 value = value >> 1; 58 59 } 59 60 vga_wseq(regbase, regset->regnum, regval); 60 - regset ++; 61 + regset++; 61 62 } 62 63 } 63 64 ··· 68 67 69 68 while (regset->regnum != VGA_REGSET_END_VAL) { 70 69 count += regset->highbit - regset->lowbit + 1; 71 - regset ++; 70 + regset++; 72 71 } 73 72 return 1 << count; 74 73 } 75 74 76 - 77 75 /* ------------------------------------------------------------------------- */ 78 - 79 76 80 77 /* Set graphics controller registers to sane values */ 81 78 void svga_set_default_gfx_regs(void __iomem *regbase) ··· 102 103 vga_w(regbase, VGA_ATT_W, 0x00); 103 104 104 105 /* All standard ATC registers (AR00 - AR14) */ 105 - for (count = 0; count <= 0xF; count ++) 106 + for (count = 0; count <= 0xF; count++) 106 107 svga_wattr(regbase, count, count); 107 108 108 109 svga_wattr(regbase, VGA_ATC_MODE, 0x01); ··· 187 188 } 188 189 #endif /* 0 */ 189 190 190 - 191 191 /* ------------------------------------------------------------------------- */ 192 - 193 192 194 193 void svga_settile(struct fb_info *info, struct fb_tilemap *map) 195 194 { ··· 227 230 ((area->sy == area->dy) && (area->sx > area->dx))) { 228 231 src = fb + area->sx * colstride + area->sy * rowstride; 229 232 dst = fb + area->dx * colstride + area->dy * rowstride; 230 - } else { 233 + } else { 231 234 src = fb + (area->sx + area->width - 1) * colstride 232 235 + (area->sy + area->height - 1) * rowstride; 233 236 dst = fb + (area->dx + area->width - 1) * colstride ··· 235 238 236 239 colstride = -colstride; 237 240 rowstride = -rowstride; 238 - } 241 + } 239 242 240 243 for (dy = 0; dy < area->height; dy++) { 241 244 u16 __iomem *src2 = src; ··· 282 285 u8 __iomem *fb = (u8 __iomem *)info->screen_base; 283 286 fb += blit->sx * colstride + blit->sy * rowstride; 284 287 285 - i=0; 286 - for (dy=0; dy < blit->height; dy ++) { 288 + i = 0; 289 + for (dy = 0; dy < blit->height; dy++) { 287 290 u8 __iomem *fb2 = fb; 288 - for (dx = 0; dx < blit->width; dx ++) { 291 + for (dx = 0; dx < blit->width; dx++) { 289 292 fb_writeb(blit->indices[i], fb2); 290 293 fb_writeb(attr, fb2 + 1); 291 294 fb2 += colstride; 292 - i ++; 293 - if (i == blit->length) return; 295 + i++; 296 + if (i == blit->length) 297 + return; 294 298 } 295 299 fb += rowstride; 296 300 } 297 - 298 301 } 299 302 300 303 /* Set cursor in text (tileblit) mode */ ··· 306 309 + (cursor->sy + (info->var.yoffset / 16)) 307 310 * (info->var.xres_virtual / 8); 308 311 309 - if (! cursor -> mode) 312 + if (!cursor->mode) 310 313 return; 311 314 312 315 svga_wcrt_mask(regbase, 0x0A, 0x20, 0x20); /* disable cursor */ 313 316 314 - if (cursor -> shape == FB_TILE_CURSOR_NONE) 317 + if (cursor->shape == FB_TILE_CURSOR_NONE) 315 318 return; 316 319 317 - switch (cursor -> shape) { 320 + switch (cursor->shape) { 318 321 case FB_TILE_CURSOR_UNDERLINE: 319 322 cs = 0x0d; 320 323 break; ··· 372 375 373 376 /* ------------------------------------------------------------------------- */ 374 377 375 - 376 378 /* 377 379 * Compute PLL settings (M, N, R) 378 380 * F_VCO = (F_BASE * M) / N ··· 382 386 u16 am, an, ar; 383 387 u32 f_vco, f_current, delta_current, delta_best; 384 388 385 - pr_debug("fb%d: ideal frequency: %d kHz\n", node, (unsigned int) f_wanted); 389 + pr_debug("fb%d: ideal frequency: %d kHz\n", node, (unsigned int)f_wanted); 386 390 387 391 ar = pll->r_max; 388 392 f_vco = f_wanted << ar; ··· 413 417 414 418 while ((am <= pll->m_max) && (an <= pll->n_max)) { 415 419 f_current = (pll->f_base * am) / an; 416 - delta_current = abs_diff (f_current, f_vco); 420 + delta_current = abs_diff(f_current, f_vco); 417 421 418 422 if (delta_current < delta_best) { 419 423 delta_best = delta_current; ··· 421 425 *n = an; 422 426 } 423 427 424 - if (f_current <= f_vco) { 425 - am ++; 426 - } else { 427 - an ++; 428 - } 428 + if (f_current <= f_vco) 429 + am++; 430 + else 431 + an++; 429 432 } 430 433 431 434 f_current = (pll->f_base * *m) / *n; 432 - pr_debug("fb%d: found frequency: %d kHz (VCO %d kHz)\n", node, (int) (f_current >> ar), (int) f_current); 433 - pr_debug("fb%d: m = %d n = %d r = %d\n", node, (unsigned int) *m, (unsigned int) *n, (unsigned int) *r); 435 + pr_debug("fb%d: found frequency: %d kHz (VCO %d kHz)\n", node, (int)(f_current >> ar), (int)f_current); 436 + pr_debug("fb%d: m = %d n = %d r = %d\n", node, (unsigned int)*m, (unsigned int)*n, (unsigned int)*r); 434 437 return 0; 435 438 } 436 439 437 - 438 440 /* ------------------------------------------------------------------------- */ 439 - 440 441 441 442 /* Check CRT timing values */ 442 443 int svga_check_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, int node) 443 444 { 444 445 u32 value; 445 446 446 - var->xres = (var->xres+7)&~7; 447 - var->left_margin = (var->left_margin+7)&~7; 448 - var->right_margin = (var->right_margin+7)&~7; 449 - var->hsync_len = (var->hsync_len+7)&~7; 447 + var->xres = (var->xres + 7) & ~7; 448 + var->left_margin = (var->left_margin + 7) & ~7; 449 + var->right_margin = (var->right_margin + 7) & ~7; 450 + var->hsync_len = (var->hsync_len + 7) & ~7; 450 451 451 452 /* Check horizontal total */ 452 453 value = var->xres + var->left_margin + var->right_margin + var->hsync_len; 453 - if (((value / 8) - 5) >= svga_regset_size (tm->h_total_regs)) 454 + if (((value / 8) - 5) >= svga_regset_size(tm->h_total_regs)) 454 455 return -EINVAL; 455 456 456 457 /* Check horizontal display and blank start */ 457 458 value = var->xres; 458 - if (((value / 8) - 1) >= svga_regset_size (tm->h_display_regs)) 459 + if (((value / 8) - 1) >= svga_regset_size(tm->h_display_regs)) 459 460 return -EINVAL; 460 - if (((value / 8) - 1) >= svga_regset_size (tm->h_blank_start_regs)) 461 + if (((value / 8) - 1) >= svga_regset_size(tm->h_blank_start_regs)) 461 462 return -EINVAL; 462 463 463 464 /* Check horizontal sync start */ 464 465 value = var->xres + var->right_margin; 465 - if (((value / 8) - 1) >= svga_regset_size (tm->h_sync_start_regs)) 466 + if (((value / 8) - 1) >= svga_regset_size(tm->h_sync_start_regs)) 466 467 return -EINVAL; 467 468 468 469 /* Check horizontal blank end (or length) */ 469 470 value = var->left_margin + var->right_margin + var->hsync_len; 470 - if ((value == 0) || ((value / 8) >= svga_regset_size (tm->h_blank_end_regs))) 471 + if ((value == 0) || ((value / 8) >= svga_regset_size(tm->h_blank_end_regs))) 471 472 return -EINVAL; 472 473 473 474 /* Check horizontal sync end (or length) */ 474 475 value = var->hsync_len; 475 - if ((value == 0) || ((value / 8) >= svga_regset_size (tm->h_sync_end_regs))) 476 + if ((value == 0) || ((value / 8) >= svga_regset_size(tm->h_sync_end_regs))) 476 477 return -EINVAL; 477 478 478 479 /* Check vertical total */ ··· 491 498 492 499 /* Check vertical blank end (or length) */ 493 500 value = var->upper_margin + var->lower_margin + var->vsync_len; 494 - if ((value == 0) || (value >= svga_regset_size (tm->v_blank_end_regs))) 501 + if ((value == 0) || (value >= svga_regset_size(tm->v_blank_end_regs))) 495 502 return -EINVAL; 496 503 497 504 /* Check vertical sync end (or length) */ 498 505 value = var->vsync_len; 499 - if ((value == 0) || (value >= svga_regset_size (tm->v_sync_end_regs))) 506 + if ((value == 0) || (value >= svga_regset_size(tm->v_sync_end_regs))) 500 507 return -EINVAL; 501 508 502 509 return 0; ··· 590 597 vga_w(regbase, VGA_MIS_W, regval); 591 598 } 592 599 593 - 594 600 /* ------------------------------------------------------------------------- */ 595 - 596 601 597 602 static inline int match_format(const struct svga_fb_format *frm, 598 603 struct fb_var_screeninfo *var) ··· 598 607 int i = 0; 599 608 int stored = -EINVAL; 600 609 601 - while (frm->bits_per_pixel != SVGA_FORMAT_END_VAL) 602 - { 610 + while (frm->bits_per_pixel != SVGA_FORMAT_END_VAL) { 603 611 if ((var->bits_per_pixel == frm->bits_per_pixel) && 604 612 (var->red.length <= frm->red.length) && 605 613 (var->green.length <= frm->green.length) && ··· 637 647 638 648 return i; 639 649 } 640 - 641 650 642 651 EXPORT_SYMBOL(svga_wcrt_multi); 643 652 EXPORT_SYMBOL(svga_wseq_multi);
+7 -2
drivers/video/fbdev/imxfb.c
··· 996 996 info->fix.smem_start = fbi->map_dma; 997 997 998 998 INIT_LIST_HEAD(&info->modelist); 999 - for (i = 0; i < fbi->num_modes; i++) 1000 - fb_add_videomode(&fbi->mode[i].mode, &info->modelist); 999 + for (i = 0; i < fbi->num_modes; i++) { 1000 + ret = fb_add_videomode(&fbi->mode[i].mode, &info->modelist); 1001 + if (ret) { 1002 + dev_err(&pdev->dev, "Failed to add videomode\n"); 1003 + goto failed_cmap; 1004 + } 1005 + } 1001 1006 1002 1007 /* 1003 1008 * This makes sure that our colour bitfield
+12 -12
drivers/video/fbdev/kyro/fbdev.c
··· 679 679 if (err) 680 680 return err; 681 681 682 - if ((err = pci_enable_device(pdev))) { 682 + err = pcim_enable_device(pdev); 683 + if (err) { 683 684 printk(KERN_WARNING "kyrofb: Can't enable pdev: %d\n", err); 684 685 return err; 685 686 } ··· 688 687 info = framebuffer_alloc(sizeof(struct kyrofb_info), &pdev->dev); 689 688 if (!info) 690 689 return -ENOMEM; 690 + 691 + err = pcim_request_all_regions(pdev, "kyrofb"); 692 + if (err) 693 + goto out_free_fb; 691 694 692 695 currentpar = info->par; 693 696 ··· 701 696 kyro_fix.mmio_len = pci_resource_len(pdev, 1); 702 697 703 698 currentpar->regbase = deviceInfo.pSTGReg = 704 - ioremap(kyro_fix.mmio_start, kyro_fix.mmio_len); 699 + devm_ioremap(&pdev->dev, kyro_fix.mmio_start, 700 + kyro_fix.mmio_len); 705 701 if (!currentpar->regbase) 706 702 goto out_free_fb; 707 703 708 - info->screen_base = pci_ioremap_wc_bar(pdev, 0); 704 + info->screen_base = devm_ioremap_wc(&pdev->dev, kyro_fix.smem_start, 705 + kyro_fix.smem_len); 709 706 if (!info->screen_base) 710 - goto out_unmap_regs; 707 + goto out_free_fb; 711 708 712 709 if (!nomtrr) 713 710 currentpar->wc_cookie = arch_phys_wc_add(kyro_fix.smem_start, ··· 744 737 fb_memset_io(info->screen_base, 0, size); 745 738 746 739 if (register_framebuffer(info) < 0) 747 - goto out_unmap; 740 + goto out_free_fb; 748 741 749 742 fb_info(info, "%s frame buffer device, at %dx%d@%d using %ldk/%ldk of VRAM\n", 750 743 info->fix.id, ··· 755 748 756 749 return 0; 757 750 758 - out_unmap: 759 - iounmap(info->screen_base); 760 - out_unmap_regs: 761 - iounmap(currentpar->regbase); 762 751 out_free_fb: 763 752 framebuffer_release(info); 764 753 ··· 775 772 776 773 deviceInfo.ulNextFreeVidMem = 0; 777 774 deviceInfo.ulOverlayOffset = 0; 778 - 779 - iounmap(info->screen_base); 780 - iounmap(par->regbase); 781 775 782 776 arch_phys_wc_del(par->wc_cookie); 783 777
+1 -1
drivers/video/fbdev/nvidia/nv_local.h
··· 80 80 (par)->dmaFree -= ((size) + 1); \ 81 81 } 82 82 83 - #if defined(__i386__) 83 + #if defined(__i386__) && !defined(CONFIG_UML) 84 84 #define _NV_FENCE() outb(0, 0x3D0); 85 85 #else 86 86 #define _NV_FENCE() mb();
+4 -13
drivers/video/fbdev/simplefb.c
··· 21 21 #include <linux/platform_device.h> 22 22 #include <linux/clk.h> 23 23 #include <linux/of.h> 24 - #include <linux/of_address.h> 25 24 #include <linux/of_clk.h> 26 25 #include <linux/of_platform.h> 26 + #include <linux/of_reserved_mem.h> 27 27 #include <linux/parser.h> 28 28 #include <linux/pm_domain.h> 29 29 #include <linux/regulator/consumer.h> ··· 134 134 static int simplefb_parse_dt(struct platform_device *pdev, 135 135 struct simplefb_params *params) 136 136 { 137 - struct device_node *np = pdev->dev.of_node, *mem; 137 + struct device_node *np = pdev->dev.of_node; 138 138 int ret; 139 139 const char *format; 140 140 int i; ··· 174 174 return -EINVAL; 175 175 } 176 176 177 - mem = of_parse_phandle(np, "memory-region", 0); 178 - if (mem) { 179 - ret = of_address_to_resource(mem, 0, &params->memory); 180 - if (ret < 0) { 181 - dev_err(&pdev->dev, "failed to parse memory-region\n"); 182 - of_node_put(mem); 183 - return ret; 184 - } 185 - 177 + ret = of_reserved_mem_region_to_resource(np, 0, &params->memory); 178 + if (!ret) { 186 179 if (of_property_present(np, "reg")) 187 180 dev_warn(&pdev->dev, "preferring \"memory-region\" over \"reg\" property\n"); 188 - 189 - of_node_put(mem); 190 181 } else { 191 182 memset(&params->memory, 0, sizeof(params->memory)); 192 183 }