fbdev/bw2: Use initializer macro for struct fb_ops
authorThomas Zimmermann <tzimmermann@suse.de>
Sun, 6 Aug 2023 11:58:55 +0000 (13:58 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 28 Aug 2023 07:43:56 +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-5-tzimmermann@suse.de
drivers/video/fbdev/Kconfig
drivers/video/fbdev/bw2.c

index fd5bd28..7e4710d 100644 (file)
@@ -527,9 +527,7 @@ config FB_SBUS_HELPERS
 config FB_BW2
        bool "BWtwo support"
        depends on (FB = y) && (SPARC && 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 BWtwo frame buffer.
 
index 6da2204..95ee91f 100644 (file)
@@ -30,8 +30,8 @@
 
 static int bw2_blank(int, struct fb_info *);
 
-static int bw2_mmap(struct fb_info *, struct vm_area_struct *);
-static int bw2_ioctl(struct fb_info *, unsigned int, unsigned long);
+static int bw2_sbusfb_mmap(struct fb_info *info, struct vm_area_struct *vma);
+static int bw2_sbusfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg);
 
 /*
  *  Frame buffer operations
@@ -39,15 +39,8 @@ static int bw2_ioctl(struct fb_info *, unsigned int, unsigned long);
 
 static const struct fb_ops bw2_ops = {
        .owner                  = THIS_MODULE,
+       FB_DEFAULT_SBUS_OPS(bw2),
        .fb_blank               = bw2_blank,
-       .fb_fillrect            = cfb_fillrect,
-       .fb_copyarea            = cfb_copyarea,
-       .fb_imageblit           = cfb_imageblit,
-       .fb_mmap                = bw2_mmap,
-       .fb_ioctl               = bw2_ioctl,
-#ifdef CONFIG_COMPAT
-       .fb_compat_ioctl        = sbusfb_compat_ioctl,
-#endif
 };
 
 /* OBio addresses for the bwtwo registers */
@@ -160,7 +153,7 @@ static struct sbus_mmap_map bw2_mmap_map[] = {
        { .size = 0 }
 };
 
-static int bw2_mmap(struct fb_info *info, struct vm_area_struct *vma)
+static int bw2_sbusfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
        struct bw2_par *par = (struct bw2_par *)info->par;
 
@@ -170,7 +163,7 @@ static int bw2_mmap(struct fb_info *info, struct vm_area_struct *vma)
                                  vma);
 }
 
-static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
+static int bw2_sbusfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
 {
        return sbusfb_ioctl_helper(cmd, arg, info,
                                   FBTYPE_SUN2BW, 1, info->fix.smem_len);