video: fbdev: mb862xx: modify the static fb_ops directly
authorJani Nikula <jani.nikula@intel.com>
Tue, 3 Dec 2019 16:38:44 +0000 (18:38 +0200)
committerJani Nikula <jani.nikula@intel.com>
Thu, 5 Dec 2019 08:57:22 +0000 (10:57 +0200)
Avoid modifying the fb_ops via info->fbops to let us make the pointer
const in the future. Drop the unnecessary EXPORT_SYMBOL() while at it.

Cc: linux-fbdev@vger.kernel.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/51f55c02ea4057cc46335ca5c447b92a55383f77.1575390740.git.jani.nikula@intel.com
drivers/video/fbdev/mb862xx/mb862xxfb.h
drivers/video/fbdev/mb862xx/mb862xxfb_accel.c
drivers/video/fbdev/mb862xx/mb862xxfbdrv.c

index 50bc9b584ca141c7d9f5a5121cdd07cf04db58f3..52a77ea4e849e5f659301b087d8821771c8247a8 100644 (file)
@@ -89,7 +89,7 @@ struct mb862xxfb_par {
        u32                     pseudo_palette[16];
 };
 
-extern void mb862xxfb_init_accel(struct fb_info *info, int xres);
+extern void mb862xxfb_init_accel(struct fb_info *info, struct fb_ops *fbops, int xres);
 #ifdef CONFIG_FB_MB862XX_I2C
 extern int mb862xx_i2c_init(struct mb862xxfb_par *par);
 extern void mb862xx_i2c_exit(struct mb862xxfb_par *par);
index f58ff900e82aa4c681c208dd1cb2ded014cf66d0..42569264801fcc6d9798c3c45593348a42154287 100644 (file)
@@ -303,19 +303,19 @@ static void mb86290fb_fillrect(struct fb_info *info,
        mb862xxfb_write_fifo(7, cmd, info);
 }
 
-void mb862xxfb_init_accel(struct fb_info *info, int xres)
+void mb862xxfb_init_accel(struct fb_info *info, struct fb_ops *fbops, int xres)
 {
        struct mb862xxfb_par *par = info->par;
 
        if (info->var.bits_per_pixel == 32) {
-               info->fbops->fb_fillrect = cfb_fillrect;
-               info->fbops->fb_copyarea = cfb_copyarea;
-               info->fbops->fb_imageblit = cfb_imageblit;
+               fbops->fb_fillrect = cfb_fillrect;
+               fbops->fb_copyarea = cfb_copyarea;
+               fbops->fb_imageblit = cfb_imageblit;
        } else {
                outreg(disp, GC_L0EM, 3);
-               info->fbops->fb_fillrect = mb86290fb_fillrect;
-               info->fbops->fb_copyarea = mb86290fb_copyarea;
-               info->fbops->fb_imageblit = mb86290fb_imageblit;
+               fbops->fb_fillrect = mb86290fb_fillrect;
+               fbops->fb_copyarea = mb86290fb_copyarea;
+               fbops->fb_imageblit = mb86290fb_imageblit;
        }
        outreg(draw, GDC_REG_DRAW_BASE, 0);
        outreg(draw, GDC_REG_MODE_MISC, 0x8000);
@@ -326,6 +326,5 @@ void mb862xxfb_init_accel(struct fb_info *info, int xres)
            FBINFO_HWACCEL_IMAGEBLIT;
        info->fix.accel = 0xff; /*FIXME: add right define */
 }
-EXPORT_SYMBOL(mb862xxfb_init_accel);
 
 MODULE_LICENSE("GPL v2");
index 962c0171d2711f24607d4cccafb376edbd708e91..52755b591c1489f1aaad848e5496ee84367d6aca 100644 (file)
@@ -194,6 +194,8 @@ static int mb862xxfb_check_var(struct fb_var_screeninfo *var,
        return 0;
 }
 
+static struct fb_ops mb862xxfb_ops;
+
 /*
  * set display parameters
  */
@@ -204,7 +206,7 @@ static int mb862xxfb_set_par(struct fb_info *fbi)
 
        dev_dbg(par->dev, "%s\n", __func__);
        if (par->type == BT_CORALP)
-               mb862xxfb_init_accel(fbi, fbi->var.xres);
+               mb862xxfb_init_accel(fbi, &mb862xxfb_ops, fbi->var.xres);
 
        if (par->pre_init)
                return 0;