From 10ff3e6c8dbb9f1f47eefee842803a7661fd25ee Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Sun, 6 Aug 2023 13:59:00 +0200 Subject: [PATCH] fbdev/leo: Use initializer macro for struct fb_ops Initialize struct fb_ops to the correct default values with the macro FB_DEFAULT_SBUS_OPS(). Rename the ioctl and mmap callbacks to use the infix _sbusfb_. This makes them fit the SBUS helpers' naming pattern. Also make the driver depend on FB_SBUS_HELPERS, which selects the correct modules. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-10-tzimmermann@suse.de --- drivers/video/fbdev/Kconfig | 4 +--- drivers/video/fbdev/leo.c | 19 ++++++------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index dfc601db65a4c..3bade062ac3f0 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -587,9 +587,7 @@ config FB_P9100 config FB_LEO bool "Leo (ZX) support" depends on FB_SBUS - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT + select FB_SBUS_HELPERS help This is the frame buffer device driver for the SBUS-based Sun ZX (leo) frame buffer cards. diff --git a/drivers/video/fbdev/leo.c b/drivers/video/fbdev/leo.c index a1a40ea3b22a5..a50178bcb2d1a 100644 --- a/drivers/video/fbdev/leo.c +++ b/drivers/video/fbdev/leo.c @@ -30,28 +30,21 @@ static int leo_setcolreg(unsigned, unsigned, unsigned, unsigned, unsigned, struct fb_info *); static int leo_blank(int, struct fb_info *); - -static int leo_mmap(struct fb_info *, struct vm_area_struct *); -static int leo_ioctl(struct fb_info *, unsigned int, unsigned long); static int leo_pan_display(struct fb_var_screeninfo *, struct fb_info *); +static int leo_sbusfb_mmap(struct fb_info *info, struct vm_area_struct *vma); +static int leo_sbusfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg); + /* * Frame buffer operations */ static const struct fb_ops leo_ops = { .owner = THIS_MODULE, + FB_DEFAULT_SBUS_OPS(leo), .fb_setcolreg = leo_setcolreg, .fb_blank = leo_blank, .fb_pan_display = leo_pan_display, - .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, - .fb_mmap = leo_mmap, - .fb_ioctl = leo_ioctl, -#ifdef CONFIG_COMPAT - .fb_compat_ioctl = sbusfb_compat_ioctl, -#endif }; #define LEO_OFF_LC_SS0_KRN 0x00200000UL @@ -413,7 +406,7 @@ static struct sbus_mmap_map leo_mmap_map[] = { { .size = 0 } }; -static int leo_mmap(struct fb_info *info, struct vm_area_struct *vma) +static int leo_sbusfb_mmap(struct fb_info *info, struct vm_area_struct *vma) { struct leo_par *par = (struct leo_par *)info->par; @@ -422,7 +415,7 @@ static int leo_mmap(struct fb_info *info, struct vm_area_struct *vma) par->which_io, vma); } -static int leo_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) +static int leo_sbusfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { return sbusfb_ioctl_helper(cmd, arg, info, FBTYPE_SUNLEO, 32, info->fix.smem_len); -- 2.30.2