fbdev/p9100: Use initializer macro for struct fb_ops
authorThomas Zimmermann <tzimmermann@suse.de>
Sun, 6 Aug 2023 11:59:01 +0000 (13:59 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 28 Aug 2023 07:44:17 +0000 (09:44 +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-11-tzimmermann@suse.de
drivers/video/fbdev/Kconfig
drivers/video/fbdev/p9100.c

index 3bade062ac3f0d40ce6e0d2d576410abf84e9454..ae2b0c07223f2c2ac1fa88531ec77c4ae3562d12 100644 (file)
@@ -577,9 +577,7 @@ config FB_CG14
 config FB_P9100
        bool "P9100 (Sparcbook 3 only) 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 P9100 card
          supported on Sparcbook 3 machines.
index 41d124862a007b967b3886fdde0c192d8493aced..c2da811a906b8a58e30efd84319fb953d1c9b1ae 100644 (file)
@@ -30,8 +30,8 @@ static int p9100_setcolreg(unsigned, unsigned, unsigned, unsigned,
                           unsigned, struct fb_info *);
 static int p9100_blank(int, struct fb_info *);
 
-static int p9100_mmap(struct fb_info *, struct vm_area_struct *);
-static int p9100_ioctl(struct fb_info *, unsigned int, unsigned long);
+static int p9100_sbusfb_mmap(struct fb_info *info, struct vm_area_struct *vma);
+static int p9100_sbusfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg);
 
 /*
  *  Frame buffer operations
@@ -39,16 +39,9 @@ static int p9100_ioctl(struct fb_info *, unsigned int, unsigned long);
 
 static const struct fb_ops p9100_ops = {
        .owner                  = THIS_MODULE,
+       FB_DEFAULT_SBUS_OPS(p9100),
        .fb_setcolreg           = p9100_setcolreg,
        .fb_blank               = p9100_blank,
-       .fb_fillrect            = cfb_fillrect,
-       .fb_copyarea            = cfb_copyarea,
-       .fb_imageblit           = cfb_imageblit,
-       .fb_mmap                = p9100_mmap,
-       .fb_ioctl               = p9100_ioctl,
-#ifdef CONFIG_COMPAT
-       .fb_compat_ioctl        = sbusfb_compat_ioctl,
-#endif
 };
 
 /* P9100 control registers */
@@ -217,7 +210,7 @@ static struct sbus_mmap_map p9100_mmap_map[] = {
        { 0,                    0,              0                   }
 };
 
-static int p9100_mmap(struct fb_info *info, struct vm_area_struct *vma)
+static int p9100_sbusfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
        struct p9100_par *par = (struct p9100_par *)info->par;
 
@@ -226,8 +219,7 @@ static int p9100_mmap(struct fb_info *info, struct vm_area_struct *vma)
                                  par->which_io, vma);
 }
 
-static int p9100_ioctl(struct fb_info *info, unsigned int cmd,
-                      unsigned long arg)
+static int p9100_sbusfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
 {
        /* Make it look like a cg3. */
        return sbusfb_ioctl_helper(cmd, arg, info,