fbdev/cg14: Use initializer macro for struct fb_ops
authorThomas Zimmermann <tzimmermann@suse.de>
Sun, 6 Aug 2023 11:58:56 +0000 (13:58 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 28 Aug 2023 07:43:59 +0000 (09:43 +0200)
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 <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-6-tzimmermann@suse.de
drivers/video/fbdev/Kconfig
drivers/video/fbdev/cg14.c

index 7e4710defc327e4c844e74cbeec843b03978af78..02f1639846797a4c2b5a0d36b5ffbfc846870398 100644 (file)
@@ -571,9 +571,7 @@ config FB_TCX
 config FB_CG14
        bool "CGfourteen (SX) 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 CGfourteen frame
          buffer on Desktop SPARCsystems with the SX graphics option.
index b2ecd9ff2a61507695a6628994a85ed1edb40b1a..06bdafbeed93f44c69c1cb94aebd4c352efaa5ad 100644 (file)
 
 static int cg14_setcolreg(unsigned, unsigned, unsigned, unsigned,
                         unsigned, struct fb_info *);
-
-static int cg14_mmap(struct fb_info *, struct vm_area_struct *);
-static int cg14_ioctl(struct fb_info *, unsigned int, unsigned long);
 static int cg14_pan_display(struct fb_var_screeninfo *, struct fb_info *);
 
+static int cg14_sbusfb_mmap(struct fb_info *info, struct vm_area_struct *vma);
+static int cg14_sbusfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg);
+
 /*
  *  Frame buffer operations
  */
 
 static const struct fb_ops cg14_ops = {
        .owner                  = THIS_MODULE,
+       FB_DEFAULT_SBUS_OPS(cg14),
        .fb_setcolreg           = cg14_setcolreg,
        .fb_pan_display         = cg14_pan_display,
-       .fb_fillrect            = cfb_fillrect,
-       .fb_copyarea            = cfb_copyarea,
-       .fb_imageblit           = cfb_imageblit,
-       .fb_mmap                = cg14_mmap,
-       .fb_ioctl               = cg14_ioctl,
-#ifdef CONFIG_COMPAT
-       .fb_compat_ioctl        = sbusfb_compat_ioctl,
-#endif
 };
 
 #define CG14_MCR_INTENABLE_SHIFT       7
@@ -264,7 +257,7 @@ static int cg14_setcolreg(unsigned regno,
        return 0;
 }
 
-static int cg14_mmap(struct fb_info *info, struct vm_area_struct *vma)
+static int cg14_sbusfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
        struct cg14_par *par = (struct cg14_par *) info->par;
 
@@ -273,7 +266,7 @@ static int cg14_mmap(struct fb_info *info, struct vm_area_struct *vma)
                                  par->iospace, vma);
 }
 
-static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
+static int cg14_sbusfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
 {
        struct cg14_par *par = (struct cg14_par *) info->par;
        struct cg14_regs __iomem *regs = par->regs;