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

fbdev: bf54x-lq043fb/bfin-t350mcqb-fb: drop custom mmap() handler

The common Blackfin code implements the get_fb_unmapped_area() function,
so we no longer need to have our own mmap() handler. The common fb code
will take care of everything for us now.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Michael Hennerich and committed by
Linus Torvalds
d40f29bf 0d3580d4

-59
-30
drivers/video/bf54x-lq043fb.c
··· 82 82 unsigned char *fb_buffer; /* RGB Buffer */ 83 83 84 84 dma_addr_t dma_handle; 85 - int lq043_mmap; 86 85 int lq043_open_cnt; 87 86 int irq; 88 87 spinlock_t lock; /* lock */ ··· 315 316 spin_lock(&fbi->lock); 316 317 317 318 fbi->lq043_open_cnt--; 318 - fbi->lq043_mmap = 0; 319 319 320 320 if (fbi->lq043_open_cnt <= 0) { 321 321 ··· 372 374 return 0; 373 375 } 374 376 375 - static int bfin_bf54x_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) 376 - { 377 - 378 - struct bfin_bf54xfb_info *fbi = info->par; 379 - 380 - if (fbi->lq043_mmap) 381 - return -1; 382 - 383 - spin_lock(&fbi->lock); 384 - fbi->lq043_mmap = 1; 385 - spin_unlock(&fbi->lock); 386 - 387 - vma->vm_start = (unsigned long)(fbi->fb_buffer); 388 - 389 - vma->vm_end = vma->vm_start + info->fix.smem_len; 390 - /* For those who don't understand how mmap works, go read 391 - * Documentation/nommu-mmap.txt. 392 - * For those that do, you will know that the VM_MAYSHARE flag 393 - * must be set in the vma->vm_flags structure on noMMU 394 - * Other flags can be set, and are documented in 395 - * include/linux/mm.h 396 - */ 397 - vma->vm_flags |= VM_MAYSHARE | VM_SHARED; 398 - 399 - return 0; 400 - } 401 - 402 377 int bfin_bf54x_fb_cursor(struct fb_info *info, struct fb_cursor *cursor) 403 378 { 404 379 if (nocursor) ··· 423 452 .fb_fillrect = cfb_fillrect, 424 453 .fb_copyarea = cfb_copyarea, 425 454 .fb_imageblit = cfb_imageblit, 426 - .fb_mmap = bfin_bf54x_fb_mmap, 427 455 .fb_cursor = bfin_bf54x_fb_cursor, 428 456 .fb_setcolreg = bfin_bf54x_fb_setcolreg, 429 457 };
-29
drivers/video/bfin-t350mcqb-fb.c
··· 87 87 struct device *dev; 88 88 unsigned char *fb_buffer; /* RGB Buffer */ 89 89 dma_addr_t dma_handle; 90 - int lq043_mmap; 91 90 int lq043_open_cnt; 92 91 int irq; 93 92 spinlock_t lock; /* lock */ ··· 234 235 spin_lock(&fbi->lock); 235 236 236 237 fbi->lq043_open_cnt--; 237 - fbi->lq043_mmap = 0; 238 238 239 239 if (fbi->lq043_open_cnt <= 0) { 240 240 bfin_t350mcqb_disable_ppi(); ··· 291 293 return 0; 292 294 } 293 295 294 - static int bfin_t350mcqb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) 295 - { 296 - struct bfin_t350mcqbfb_info *fbi = info->par; 297 - 298 - if (fbi->lq043_mmap) 299 - return -1; 300 - 301 - spin_lock(&fbi->lock); 302 - fbi->lq043_mmap = 1; 303 - spin_unlock(&fbi->lock); 304 - 305 - vma->vm_start = (unsigned long)(fbi->fb_buffer + ACTIVE_VIDEO_MEM_OFFSET); 306 - 307 - vma->vm_end = vma->vm_start + info->fix.smem_len; 308 - /* For those who don't understand how mmap works, go read 309 - * Documentation/nommu-mmap.txt. 310 - * For those that do, you will know that the VM_MAYSHARE flag 311 - * must be set in the vma->vm_flags structure on noMMU 312 - * Other flags can be set, and are documented in 313 - * include/linux/mm.h 314 - */ 315 - vma->vm_flags |= VM_MAYSHARE | VM_SHARED; 316 - 317 - return 0; 318 - } 319 - 320 296 int bfin_t350mcqb_fb_cursor(struct fb_info *info, struct fb_cursor *cursor) 321 297 { 322 298 if (nocursor) ··· 342 370 .fb_fillrect = cfb_fillrect, 343 371 .fb_copyarea = cfb_copyarea, 344 372 .fb_imageblit = cfb_imageblit, 345 - .fb_mmap = bfin_t350mcqb_fb_mmap, 346 373 .fb_cursor = bfin_t350mcqb_fb_cursor, 347 374 .fb_setcolreg = bfin_t350mcqb_fb_setcolreg, 348 375 };