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

staging/sm750fb: Initialize fb_ops with fbdev macros

Initialize all instances of struct fb_ops with fbdev initializer
macros for framebuffers in I/O address space. Set the read/write,
draw and mmap callbacks to the correct implementation and avoid
implicit defaults. Also select the necessary helpers in Kconfig.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default I/O-memory-based implementation to be invoked; hence
requiring the I/O helpers to be built in any case. Setting all
callbacks in all drivers explicitly will allow to make the I/O
helpers optional. This benefits systems that do not use these
functions.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231127131655.4020-27-tzimmermann@suse.de

+6 -6
+6 -6
drivers/staging/sm750fb/sm750.c
··· 665 665 666 666 static const struct fb_ops lynxfb_ops = { 667 667 .owner = THIS_MODULE, 668 + FB_DEFAULT_IOMEM_OPS, 668 669 .fb_check_var = lynxfb_ops_check_var, 669 670 .fb_set_par = lynxfb_ops_set_par, 670 671 .fb_setcolreg = lynxfb_ops_setcolreg, 671 672 .fb_blank = lynxfb_ops_blank, 672 673 .fb_pan_display = lynxfb_ops_pan_display, 673 - .fb_fillrect = cfb_fillrect, 674 - .fb_imageblit = cfb_imageblit, 675 - .fb_copyarea = cfb_copyarea, 676 674 }; 677 675 678 676 static const struct fb_ops lynxfb_ops_with_cursor = { 679 677 .owner = THIS_MODULE, 678 + FB_DEFAULT_IOMEM_OPS, 680 679 .fb_check_var = lynxfb_ops_check_var, 681 680 .fb_set_par = lynxfb_ops_set_par, 682 681 .fb_setcolreg = lynxfb_ops_setcolreg, 683 682 .fb_blank = lynxfb_ops_blank, 684 683 .fb_pan_display = lynxfb_ops_pan_display, 685 - .fb_fillrect = cfb_fillrect, 686 - .fb_copyarea = cfb_copyarea, 687 - .fb_imageblit = cfb_imageblit, 688 684 .fb_cursor = lynxfb_ops_cursor, 689 685 }; 690 686 691 687 static const struct fb_ops lynxfb_ops_accel = { 692 688 .owner = THIS_MODULE, 689 + __FB_DEFAULT_IOMEM_OPS_RDWR, 693 690 .fb_check_var = lynxfb_ops_check_var, 694 691 .fb_set_par = lynxfb_ops_set_par, 695 692 .fb_setcolreg = lynxfb_ops_setcolreg, ··· 695 698 .fb_fillrect = lynxfb_ops_fillrect, 696 699 .fb_copyarea = lynxfb_ops_copyarea, 697 700 .fb_imageblit = lynxfb_ops_imageblit, 701 + __FB_DEFAULT_IOMEM_OPS_MMAP, 698 702 }; 699 703 700 704 static const struct fb_ops lynxfb_ops_accel_with_cursor = { 701 705 .owner = THIS_MODULE, 706 + __FB_DEFAULT_IOMEM_OPS_RDWR, 702 707 .fb_check_var = lynxfb_ops_check_var, 703 708 .fb_set_par = lynxfb_ops_set_par, 704 709 .fb_setcolreg = lynxfb_ops_setcolreg, ··· 710 711 .fb_copyarea = lynxfb_ops_copyarea, 711 712 .fb_imageblit = lynxfb_ops_imageblit, 712 713 .fb_cursor = lynxfb_ops_cursor, 714 + __FB_DEFAULT_IOMEM_OPS_MMAP, 713 715 }; 714 716 715 717 static int lynxfb_set_fbinfo(struct fb_info *info, int index)