From f597c2089da4dd55133546b1255493579a295bff Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Thu, 14 Nov 2019 13:51:06 +0100 Subject: fbdev: Unexport unlink_framebuffer() There are no external callers of unlink_framebuffer() left. Make the function an internal interface. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20191114125106.28347-4-tzimmermann@suse.de --- drivers/video/fbdev/core/fbmem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 95c32952fa8a..86b06a599f96 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1673,7 +1673,7 @@ static void unbind_console(struct fb_info *fb_info) console_unlock(); } -void unlink_framebuffer(struct fb_info *fb_info) +static void unlink_framebuffer(struct fb_info *fb_info) { int i; @@ -1692,7 +1692,6 @@ void unlink_framebuffer(struct fb_info *fb_info) fb_info->dev = NULL; } -EXPORT_SYMBOL(unlink_framebuffer); static void do_unregister_framebuffer(struct fb_info *fb_info) { -- cgit v1.2.3 From 12281c8dda5a3b47008bd6a6db6645995234b4e1 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Fri, 29 Nov 2019 12:29:31 +0200 Subject: video: fb_defio: preserve user fb_ops Modifying fb_ops directly to override fb_mmap with fb_deferred_io_mmap and then resetting it to NULL afterwards causes problems all over the place. First, it prevents making the fbops member of struct fb_info a const pointer, which means we can't make struct fb_ops const anywhere. Second, a few places have to go out of their way to restore the original fb_mmap pointer that gets reset to NULL. Since the only user of the fbops->fb_mmap hook is fb_mmap() in fbmem.c, call fb_deferred_io_mmap() directly when deferred IO is enabled, and avoid modifying fb_ops altogether. Simply use info->fbdefio to determine whether deferred IO should be used or not. This should be accurate enough for all use cases, although perhaps not pedantically correct. v2: Simplify considerably by calling fb_deferred_io_mmap() directly (Daniel, Ville) Cc: Jaya Kumar Cc: linux-fbdev@vger.kernel.org Cc: Daniel Vetter Cc: Ville Syrjälä Acked-by: Noralf Trønnes Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/022c82429da15d6450ff9ac1a897322ec3124db4.1575022735.git.jani.nikula@intel.com --- drivers/video/fbdev/core/fb_defio.c | 3 --- drivers/video/fbdev/core/fbmem.c | 15 +++++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/core/fb_defio.c b/drivers/video/fbdev/core/fb_defio.c index 82c20c6047b0..a591d291b231 100644 --- a/drivers/video/fbdev/core/fb_defio.c +++ b/drivers/video/fbdev/core/fb_defio.c @@ -171,7 +171,6 @@ int fb_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma) vma->vm_private_data = info; return 0; } -EXPORT_SYMBOL(fb_deferred_io_mmap); /* workqueue callback */ static void fb_deferred_io_work(struct work_struct *work) @@ -206,7 +205,6 @@ void fb_deferred_io_init(struct fb_info *info) BUG_ON(!fbdefio); mutex_init(&fbdefio->lock); - info->fbops->fb_mmap = fb_deferred_io_mmap; INIT_DELAYED_WORK(&info->deferred_work, fb_deferred_io_work); INIT_LIST_HEAD(&fbdefio->pagelist); if (fbdefio->delay == 0) /* set a default of 1 s */ @@ -237,7 +235,6 @@ void fb_deferred_io_cleanup(struct fb_info *info) page->mapping = NULL; } - info->fbops->fb_mmap = NULL; mutex_destroy(&fbdefio->lock); } EXPORT_SYMBOL_GPL(fb_deferred_io_cleanup); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 86b06a599f96..990550930a8e 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1332,16 +1332,23 @@ static int fb_mmap(struct file *file, struct vm_area_struct * vma) { struct fb_info *info = file_fb_info(file); - struct fb_ops *fb; + int (*fb_mmap_fn)(struct fb_info *info, struct vm_area_struct *vma); unsigned long mmio_pgoff; unsigned long start; u32 len; if (!info) return -ENODEV; - fb = info->fbops; mutex_lock(&info->mm_lock); - if (fb->fb_mmap) { + + fb_mmap_fn = info->fbops->fb_mmap; + +#if IS_ENABLED(CONFIG_FB_DEFERRED_IO) + if (info->fbdefio) + fb_mmap_fn = fb_deferred_io_mmap; +#endif + + if (fb_mmap_fn) { int res; /* @@ -1349,7 +1356,7 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) * SME protection is removed ahead of the call */ vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); - res = fb->fb_mmap(info, vma); + res = fb_mmap_fn(info, vma); mutex_unlock(&info->mm_lock); return res; } -- cgit v1.2.3 From 822f82fbc0b1d931e8cc63913e8d8a90bcf0ced6 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Fri, 29 Nov 2019 12:29:33 +0200 Subject: video: smscufx: don't restore fb_mmap after deferred IO cleanup Deferred IO now preserves the fb_ops. Cc: Steve Glendinning Cc: linux-fbdev@vger.kernel.org Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/480dcc682481e6972e5648181d7e92120929ec6b.1575022735.git.jani.nikula@intel.com --- drivers/video/fbdev/smscufx.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c index 0e0f5bbfc5ef..e362d7da87fc 100644 --- a/drivers/video/fbdev/smscufx.c +++ b/drivers/video/fbdev/smscufx.c @@ -1170,7 +1170,6 @@ static int ufx_ops_release(struct fb_info *info, int user) fb_deferred_io_cleanup(info); kfree(info->fbdefio); info->fbdefio = NULL; - info->fbops->fb_mmap = ufx_ops_mmap; } pr_debug("released /dev/fb%d user=%d count=%d", -- cgit v1.2.3 From f1844af349c730b159dd78cc76da2978c49fafd0 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Fri, 29 Nov 2019 12:29:34 +0200 Subject: video: udlfb: don't restore fb_mmap after deferred IO cleanup Deferred IO now preserves the fb_ops. Cc: Bernie Thompson Cc: linux-fbdev@vger.kernel.org Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/0f12bb51a6f2a656571cd21230b7e9d5be320db4.1575022735.git.jani.nikula@intel.com --- drivers/video/fbdev/udlfb.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index fe373b63ddd6..07905d385949 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1037,7 +1037,6 @@ static int dlfb_ops_release(struct fb_info *info, int user) fb_deferred_io_cleanup(info); kfree(info->fbdefio); info->fbdefio = NULL; - info->fbops->fb_mmap = dlfb_ops_mmap; } dev_dbg(info->dev, "release, user=%d count=%d\n", user, dlfb->fb_count); -- cgit v1.2.3 From 80b2976efa865941831459b50ca333701e2a7d29 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Fri, 29 Nov 2019 12:29:35 +0200 Subject: video: fbdev: vesafb: modify the static fb_ops directly Avoid modifying the fb_ops via info->fbops to let us make the pointer const in the future. Cc: linux-fbdev@vger.kernel.org Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/9e34c1d9a81690cbd75af7969fc4baf60a64b13f.1575022735.git.jani.nikula@intel.com --- drivers/video/fbdev/vesafb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c index d9c08f6c2155..a1fe24ea869b 100644 --- a/drivers/video/fbdev/vesafb.c +++ b/drivers/video/fbdev/vesafb.c @@ -447,15 +447,15 @@ static int vesafb_probe(struct platform_device *dev) vesafb_fix.smem_start, info->screen_base, size_remap/1024, size_total/1024); + if (!ypan) + vesafb_ops.fb_pan_display = NULL; + info->fbops = &vesafb_ops; info->var = vesafb_defined; info->fix = vesafb_fix; info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE | (ypan ? FBINFO_HWACCEL_YPAN : 0); - if (!ypan) - info->fbops->fb_pan_display = NULL; - if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { err = -ENOMEM; goto err; -- cgit v1.2.3 From f23c57e290774cd4f721801061345d351b9b601f Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Fri, 29 Nov 2019 12:29:36 +0200 Subject: video: fbmem: use const pointer for fb_ops Use const for fb_ops to let us make the info->fbops pointer const in the future. v2: rebase Cc: linux-fbdev@vger.kernel.org Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/3a27f95b424a67b3542b5906c660741daf1d4ea6.1575022735.git.jani.nikula@intel.com --- drivers/video/fbdev/core/fbmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 990550930a8e..7ddeb90337bc 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1079,7 +1079,7 @@ EXPORT_SYMBOL(fb_blank); static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { - struct fb_ops *fb; + const struct fb_ops *fb; struct fb_var_screeninfo var; struct fb_fix_screeninfo fix; struct fb_cmap cmap_from; @@ -1292,7 +1292,7 @@ static long fb_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct fb_info *info = file_fb_info(file); - struct fb_ops *fb; + const struct fb_ops *fb; long ret = -ENOIOCTLCMD; if (!info) -- cgit v1.2.3 From e67efd45d6529be2e1a0c1a2c740420c7adeee32 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Fri, 29 Nov 2019 12:29:37 +0200 Subject: video: omapfb: use const pointer for fb_ops Use const for fb_ops to let us make the info->fbops pointer const in the future. Cc: linux-fbdev@vger.kernel.org Cc: linux-omap@vger.kernel.org Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/dfa4376e219ffeef9175993eaff91b5fe7ecccab.1575022735.git.jani.nikula@intel.com --- drivers/video/fbdev/omap/omapfb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index 702cca59bda1..e8a304f84ea8 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -1052,7 +1052,7 @@ static int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, { struct omapfb_plane_struct *plane = fbi->par; struct omapfb_device *fbdev = plane->fbdev; - struct fb_ops *ops = fbi->fbops; + const struct fb_ops *ops = fbi->fbops; union { struct omapfb_update_window update_window; struct omapfb_plane_info plane_info; -- cgit v1.2.3 From f4e97477bece94a1e07402c899e65676153dff73 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 3 Dec 2019 18:38:43 +0200 Subject: video: fbdev: atyfb: modify the static fb_ops directly Avoid modifying the fb_ops via info->fbops to let us make the pointer const in the future. Cc: linux-fbdev@vger.kernel.org Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/7dfbf1d47203157f5eb9a6f447f0095765d0b5e6.1575390740.git.jani.nikula@intel.com --- drivers/video/fbdev/aty/atyfb.h | 2 +- drivers/video/fbdev/aty/atyfb_base.c | 6 +++--- drivers/video/fbdev/aty/mach64_cursor.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/aty/atyfb.h b/drivers/video/fbdev/aty/atyfb.h index e5a347c58180..a7833bc98225 100644 --- a/drivers/video/fbdev/aty/atyfb.h +++ b/drivers/video/fbdev/aty/atyfb.h @@ -341,7 +341,7 @@ extern const u8 aty_postdividers[8]; * Hardware cursor support */ -extern int aty_init_cursor(struct fb_info *info); +extern int aty_init_cursor(struct fb_info *info, struct fb_ops *atyfb_ops); /* * Hardware acceleration diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index 6dda5d885a03..bebc08505d94 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -1316,10 +1316,10 @@ static int atyfb_set_par(struct fb_info *info) par->accel_flags = var->accel_flags; /* hack */ if (var->accel_flags) { - info->fbops->fb_sync = atyfb_sync; + atyfb_ops.fb_sync = atyfb_sync; info->flags &= ~FBINFO_HWACCEL_DISABLED; } else { - info->fbops->fb_sync = NULL; + atyfb_ops.fb_sync = NULL; info->flags |= FBINFO_HWACCEL_DISABLED; } @@ -2702,7 +2702,7 @@ static int aty_init(struct fb_info *info) #ifdef CONFIG_FB_ATY_CT if (!noaccel && M64_HAS(INTEGRATED)) - aty_init_cursor(info); + aty_init_cursor(info, &atyfb_ops); #endif /* CONFIG_FB_ATY_CT */ info->var = var; diff --git a/drivers/video/fbdev/aty/mach64_cursor.c b/drivers/video/fbdev/aty/mach64_cursor.c index 4cde25eab8e8..b06fa6e42e6e 100644 --- a/drivers/video/fbdev/aty/mach64_cursor.c +++ b/drivers/video/fbdev/aty/mach64_cursor.c @@ -194,7 +194,7 @@ static int atyfb_cursor(struct fb_info *info, struct fb_cursor *cursor) return 0; } -int aty_init_cursor(struct fb_info *info) +int aty_init_cursor(struct fb_info *info, struct fb_ops *atyfb_ops) { unsigned long addr; @@ -219,7 +219,7 @@ int aty_init_cursor(struct fb_info *info) info->sprite.buf_align = 16; /* and 64 lines tall. */ info->sprite.flags = FB_PIXMAP_IO; - info->fbops->fb_cursor = atyfb_cursor; + atyfb_ops->fb_cursor = atyfb_cursor; return 0; } -- cgit v1.2.3 From c63c35dea3cba05201d37fe42e4fb8a9e4a070f2 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 3 Dec 2019 18:38:44 +0200 Subject: video: fbdev: mb862xx: modify the static fb_ops directly 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 Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/51f55c02ea4057cc46335ca5c447b92a55383f77.1575390740.git.jani.nikula@intel.com --- drivers/video/fbdev/mb862xx/mb862xxfb.h | 2 +- drivers/video/fbdev/mb862xx/mb862xxfb_accel.c | 15 +++++++-------- drivers/video/fbdev/mb862xx/mb862xxfbdrv.c | 4 +++- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/mb862xx/mb862xxfb.h b/drivers/video/fbdev/mb862xx/mb862xxfb.h index 50bc9b584ca1..52a77ea4e849 100644 --- a/drivers/video/fbdev/mb862xx/mb862xxfb.h +++ b/drivers/video/fbdev/mb862xx/mb862xxfb.h @@ -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); diff --git a/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c b/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c index f58ff900e82a..42569264801f 100644 --- a/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c +++ b/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c @@ -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"); diff --git a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c index 962c0171d271..52755b591c14 100644 --- a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c +++ b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c @@ -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; -- cgit v1.2.3 From 9567a03e19d264a4a033963981cd7d1339ccd3c7 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 3 Dec 2019 18:38:45 +0200 Subject: video: fbdev: nvidia: modify the static fb_ops directly Avoid modifying the fb_ops via info->fbops to let us make the pointer const in the future. Cc: linux-fbdev@vger.kernel.org Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/9639e2305fd4d03311bf909b8914277b221ca582.1575390740.git.jani.nikula@intel.com --- drivers/video/fbdev/nvidia/nvidia.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/nvidia/nvidia.c b/drivers/video/fbdev/nvidia/nvidia.c index fbeeed5afe35..c583c018304d 100644 --- a/drivers/video/fbdev/nvidia/nvidia.c +++ b/drivers/video/fbdev/nvidia/nvidia.c @@ -607,6 +607,8 @@ static int nvidiafb_cursor(struct fb_info *info, struct fb_cursor *cursor) return 0; } +static struct fb_ops nvidia_fb_ops; + static int nvidiafb_set_par(struct fb_info *info) { struct nvidia_par *par = info->par; @@ -660,19 +662,19 @@ static int nvidiafb_set_par(struct fb_info *info) info->fix.line_length = (info->var.xres_virtual * info->var.bits_per_pixel) >> 3; if (info->var.accel_flags) { - info->fbops->fb_imageblit = nvidiafb_imageblit; - info->fbops->fb_fillrect = nvidiafb_fillrect; - info->fbops->fb_copyarea = nvidiafb_copyarea; - info->fbops->fb_sync = nvidiafb_sync; + nvidia_fb_ops.fb_imageblit = nvidiafb_imageblit; + nvidia_fb_ops.fb_fillrect = nvidiafb_fillrect; + nvidia_fb_ops.fb_copyarea = nvidiafb_copyarea; + nvidia_fb_ops.fb_sync = nvidiafb_sync; info->pixmap.scan_align = 4; info->flags &= ~FBINFO_HWACCEL_DISABLED; info->flags |= FBINFO_READS_FAST; NVResetGraphics(info); } else { - info->fbops->fb_imageblit = cfb_imageblit; - info->fbops->fb_fillrect = cfb_fillrect; - info->fbops->fb_copyarea = cfb_copyarea; - info->fbops->fb_sync = NULL; + nvidia_fb_ops.fb_imageblit = cfb_imageblit; + nvidia_fb_ops.fb_fillrect = cfb_fillrect; + nvidia_fb_ops.fb_copyarea = cfb_copyarea; + nvidia_fb_ops.fb_sync = NULL; info->pixmap.scan_align = 1; info->flags |= FBINFO_HWACCEL_DISABLED; info->flags &= ~FBINFO_READS_FAST; @@ -1165,7 +1167,7 @@ static int nvidia_set_fbinfo(struct fb_info *info) info->pixmap.flags = FB_PIXMAP_SYSTEM; if (!hwcur) - info->fbops->fb_cursor = NULL; + nvidia_fb_ops.fb_cursor = NULL; info->var.accel_flags = (!noaccel); -- cgit v1.2.3 From 1b78e72baee87796e37d3a7cab1aded03c91d820 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 3 Dec 2019 18:38:46 +0200 Subject: video: fbdev: uvesafb: modify the static fb_ops directly Avoid modifying the fb_ops via info->fbops to let us make the pointer const in the future. Cc: linux-fbdev@vger.kernel.org Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/af63cda5de9fee3acd28e7d264f920338298bc0a.1575390740.git.jani.nikula@intel.com --- drivers/video/fbdev/uvesafb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c index 439565cae7ab..53d08d1b56f5 100644 --- a/drivers/video/fbdev/uvesafb.c +++ b/drivers/video/fbdev/uvesafb.c @@ -1440,7 +1440,7 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode) /* Disable blanking if the user requested so. */ if (!blank) - info->fbops->fb_blank = NULL; + uvesafb_ops.fb_blank = NULL; /* * Find out how much IO memory is required for the mode with @@ -1510,7 +1510,7 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode) (par->ypan ? FBINFO_HWACCEL_YPAN : 0); if (!par->ypan) - info->fbops->fb_pan_display = NULL; + uvesafb_ops.fb_pan_display = NULL; } static void uvesafb_init_mtrr(struct fb_info *info) -- cgit v1.2.3 From 28318ac1742ab17eb8ba1c1be0dea4cc14b5b2ea Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 3 Dec 2019 18:38:49 +0200 Subject: video: fbdev: intelfb: use const pointer for fb_ops Use const for fb_ops to let us make the fbops struct const in the future. Cc: linux-fbdev@vger.kernel.org Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/171c573bc2977a6ec374753ac7bb03a3523ca2b7.1575390740.git.jani.nikula@intel.com --- drivers/video/fbdev/intelfb/intelfb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/intelfb/intelfb.h b/drivers/video/fbdev/intelfb/intelfb.h index b54db05f028d..5de703902a21 100644 --- a/drivers/video/fbdev/intelfb/intelfb.h +++ b/drivers/video/fbdev/intelfb/intelfb.h @@ -273,7 +273,7 @@ struct intelfb_vsync { struct intelfb_info { struct fb_info *info; - struct fb_ops *fbops; + const struct fb_ops *fbops; struct pci_dev *pdev; struct intelfb_hwstate save_state; -- cgit v1.2.3 From 8a48ac339398f21282985bff16552447d41dcfb2 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Tue, 3 Dec 2019 18:38:50 +0200 Subject: video: constify fb ops across all drivers Now that the fbops member of struct fb_info is const, we can start making the ops const as well. This does not cover all drivers; some actually modify the fbops struct, for example to adjust for different configurations, and others do more involved things that I'd rather not touch in practically obsolete drivers. Mostly this is the low hanging fruit where we can add "const" and be done with it. v3: - un-constify atyfb, mb862xx, nvidia and uvesabf (0day) v2: - fix typo (Christophe de Dinechin) - use "static const" instead of "const static" in mx3fb.c - also constify smscufx.c Cc: linux-fbdev@vger.kernel.org Reviewed-by: Daniel Vetter Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/ce67f14435f3af498f2e8bf35ce4be11f7504132.1575390740.git.jani.nikula@intel.com --- drivers/video/fbdev/68328fb.c | 2 +- drivers/video/fbdev/acornfb.c | 2 +- drivers/video/fbdev/amba-clcd.c | 2 +- drivers/video/fbdev/amifb.c | 2 +- drivers/video/fbdev/arcfb.c | 2 +- drivers/video/fbdev/arkfb.c | 2 +- drivers/video/fbdev/asiliantfb.c | 2 +- drivers/video/fbdev/atmel_lcdfb.c | 2 +- drivers/video/fbdev/aty/aty128fb.c | 2 +- drivers/video/fbdev/aty/radeon_base.c | 2 +- drivers/video/fbdev/au1100fb.c | 2 +- drivers/video/fbdev/au1200fb.c | 2 +- drivers/video/fbdev/broadsheetfb.c | 2 +- drivers/video/fbdev/bw2.c | 2 +- drivers/video/fbdev/carminefb.c | 2 +- drivers/video/fbdev/cg14.c | 2 +- drivers/video/fbdev/cg3.c | 2 +- drivers/video/fbdev/cg6.c | 2 +- drivers/video/fbdev/chipsfb.c | 2 +- drivers/video/fbdev/cirrusfb.c | 2 +- drivers/video/fbdev/clps711x-fb.c | 2 +- drivers/video/fbdev/cobalt_lcdfb.c | 2 +- drivers/video/fbdev/controlfb.c | 2 +- drivers/video/fbdev/cyber2000fb.c | 2 +- drivers/video/fbdev/da8xx-fb.c | 2 +- drivers/video/fbdev/dnfb.c | 2 +- drivers/video/fbdev/efifb.c | 2 +- drivers/video/fbdev/ep93xx-fb.c | 2 +- drivers/video/fbdev/fb-puv3.c | 2 +- drivers/video/fbdev/ffb.c | 2 +- drivers/video/fbdev/fm2fb.c | 2 +- drivers/video/fbdev/fsl-diu-fb.c | 2 +- drivers/video/fbdev/g364fb.c | 2 +- drivers/video/fbdev/gbefb.c | 2 +- drivers/video/fbdev/geode/gx1fb_core.c | 2 +- drivers/video/fbdev/geode/gxfb_core.c | 2 +- drivers/video/fbdev/geode/lxfb_core.c | 2 +- drivers/video/fbdev/goldfishfb.c | 2 +- drivers/video/fbdev/grvga.c | 2 +- drivers/video/fbdev/gxt4500.c | 2 +- drivers/video/fbdev/hecubafb.c | 2 +- drivers/video/fbdev/hgafb.c | 2 +- drivers/video/fbdev/hitfb.c | 2 +- drivers/video/fbdev/hpfb.c | 2 +- drivers/video/fbdev/hyperv_fb.c | 2 +- drivers/video/fbdev/i740fb.c | 2 +- drivers/video/fbdev/imsttfb.c | 2 +- drivers/video/fbdev/imxfb.c | 2 +- drivers/video/fbdev/intelfb/intelfbdrv.c | 2 +- drivers/video/fbdev/kyro/fbdev.c | 2 +- drivers/video/fbdev/leo.c | 2 +- drivers/video/fbdev/macfb.c | 2 +- drivers/video/fbdev/matrox/matroxfb_crtc2.c | 2 +- drivers/video/fbdev/maxinefb.c | 2 +- drivers/video/fbdev/mbx/mbxfb.c | 2 +- drivers/video/fbdev/metronomefb.c | 2 +- drivers/video/fbdev/mmp/fb/mmpfb.c | 2 +- drivers/video/fbdev/mx3fb.c | 5 +++-- drivers/video/fbdev/neofb.c | 2 +- drivers/video/fbdev/ocfb.c | 2 +- drivers/video/fbdev/offb.c | 2 +- drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 2 +- drivers/video/fbdev/p9100.c | 2 +- drivers/video/fbdev/platinumfb.c | 2 +- drivers/video/fbdev/pm2fb.c | 2 +- drivers/video/fbdev/pm3fb.c | 2 +- drivers/video/fbdev/pmag-aa-fb.c | 2 +- drivers/video/fbdev/pmag-ba-fb.c | 2 +- drivers/video/fbdev/pmagb-b-fb.c | 2 +- drivers/video/fbdev/ps3fb.c | 2 +- drivers/video/fbdev/pvr2fb.c | 2 +- drivers/video/fbdev/pxa168fb.c | 2 +- drivers/video/fbdev/pxafb.c | 4 ++-- drivers/video/fbdev/q40fb.c | 2 +- drivers/video/fbdev/riva/fbdev.c | 2 +- drivers/video/fbdev/s3c-fb.c | 2 +- drivers/video/fbdev/s3c2410fb.c | 2 +- drivers/video/fbdev/s3fb.c | 2 +- drivers/video/fbdev/sa1100fb.c | 2 +- drivers/video/fbdev/savage/savagefb_driver.c | 2 +- drivers/video/fbdev/sh7760fb.c | 2 +- drivers/video/fbdev/sh_mobile_lcdcfb.c | 4 ++-- drivers/video/fbdev/simplefb.c | 2 +- drivers/video/fbdev/sis/sis_main.c | 2 +- drivers/video/fbdev/skeletonfb.c | 2 +- drivers/video/fbdev/sm712fb.c | 2 +- drivers/video/fbdev/smscufx.c | 2 +- drivers/video/fbdev/ssd1307fb.c | 2 +- drivers/video/fbdev/sstfb.c | 2 +- drivers/video/fbdev/stifb.c | 2 +- drivers/video/fbdev/sunxvr1000.c | 2 +- drivers/video/fbdev/sunxvr2500.c | 2 +- drivers/video/fbdev/sunxvr500.c | 2 +- drivers/video/fbdev/tcx.c | 2 +- drivers/video/fbdev/tdfxfb.c | 2 +- drivers/video/fbdev/tgafb.c | 2 +- drivers/video/fbdev/tmiofb.c | 2 +- drivers/video/fbdev/tridentfb.c | 2 +- drivers/video/fbdev/valkyriefb.c | 2 +- drivers/video/fbdev/vfb.c | 2 +- drivers/video/fbdev/vga16fb.c | 2 +- drivers/video/fbdev/vt8500lcdfb.c | 2 +- drivers/video/fbdev/vt8623fb.c | 2 +- drivers/video/fbdev/w100fb.c | 2 +- drivers/video/fbdev/wm8505fb.c | 2 +- drivers/video/fbdev/xen-fbfront.c | 2 +- drivers/video/fbdev/xilinxfb.c | 2 +- 107 files changed, 111 insertions(+), 110 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/68328fb.c b/drivers/video/fbdev/68328fb.c index d48e96088f76..491fd5a82993 100644 --- a/drivers/video/fbdev/68328fb.c +++ b/drivers/video/fbdev/68328fb.c @@ -96,7 +96,7 @@ static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma); -static struct fb_ops mc68x328fb_ops = { +static const struct fb_ops mc68x328fb_ops = { .fb_check_var = mc68x328fb_check_var, .fb_set_par = mc68x328fb_set_par, .fb_setcolreg = mc68x328fb_setcolreg, diff --git a/drivers/video/fbdev/acornfb.c b/drivers/video/fbdev/acornfb.c index 7cacae5a8797..a3af49529173 100644 --- a/drivers/video/fbdev/acornfb.c +++ b/drivers/video/fbdev/acornfb.c @@ -604,7 +604,7 @@ acornfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) return 0; } -static struct fb_ops acornfb_ops = { +static const struct fb_ops acornfb_ops = { .owner = THIS_MODULE, .fb_check_var = acornfb_check_var, .fb_set_par = acornfb_set_par, diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c index 7de43be6ef2c..c3d55fc6c4e0 100644 --- a/drivers/video/fbdev/amba-clcd.c +++ b/drivers/video/fbdev/amba-clcd.c @@ -423,7 +423,7 @@ static int clcdfb_mmap(struct fb_info *info, return ret; } -static struct fb_ops clcdfb_ops = { +static const struct fb_ops clcdfb_ops = { .owner = THIS_MODULE, .fb_check_var = clcdfb_check_var, .fb_set_par = clcdfb_set_par, diff --git a/drivers/video/fbdev/amifb.c b/drivers/video/fbdev/amifb.c index 91ddc9602014..20e03e00b66d 100644 --- a/drivers/video/fbdev/amifb.c +++ b/drivers/video/fbdev/amifb.c @@ -3493,7 +3493,7 @@ static irqreturn_t amifb_interrupt(int irq, void *dev_id) } -static struct fb_ops amifb_ops = { +static const struct fb_ops amifb_ops = { .owner = THIS_MODULE, .fb_check_var = amifb_check_var, .fb_set_par = amifb_set_par, diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c index a48741aab240..314ab82e01c0 100644 --- a/drivers/video/fbdev/arcfb.c +++ b/drivers/video/fbdev/arcfb.c @@ -491,7 +491,7 @@ static ssize_t arcfb_write(struct fb_info *info, const char __user *buf, return err; } -static struct fb_ops arcfb_ops = { +static const struct fb_ops arcfb_ops = { .owner = THIS_MODULE, .fb_open = arcfb_open, .fb_read = fb_sys_read, diff --git a/drivers/video/fbdev/arkfb.c b/drivers/video/fbdev/arkfb.c index f940e8b66b85..11ab9a153860 100644 --- a/drivers/video/fbdev/arkfb.c +++ b/drivers/video/fbdev/arkfb.c @@ -917,7 +917,7 @@ static int arkfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info /* Frame buffer operations */ -static struct fb_ops arkfb_ops = { +static const struct fb_ops arkfb_ops = { .owner = THIS_MODULE, .fb_open = arkfb_open, .fb_release = arkfb_release, diff --git a/drivers/video/fbdev/asiliantfb.c b/drivers/video/fbdev/asiliantfb.c index ea31054a28ca..3e006da47752 100644 --- a/drivers/video/fbdev/asiliantfb.c +++ b/drivers/video/fbdev/asiliantfb.c @@ -95,7 +95,7 @@ static int asiliantfb_set_par(struct fb_info *info); static int asiliantfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info); -static struct fb_ops asiliantfb_ops = { +static const struct fb_ops asiliantfb_ops = { .owner = THIS_MODULE, .fb_check_var = asiliantfb_check_var, .fb_set_par = asiliantfb_set_par, diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index 5ff8e0320d95..d567f5d56c13 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c @@ -824,7 +824,7 @@ static int atmel_lcdfb_blank(int blank_mode, struct fb_info *info) return ((blank_mode == FB_BLANK_NORMAL) ? 1 : 0); } -static struct fb_ops atmel_lcdfb_ops = { +static const struct fb_ops atmel_lcdfb_ops = { .owner = THIS_MODULE, .fb_check_var = atmel_lcdfb_check_var, .fb_set_par = atmel_lcdfb_set_par, diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index fc1e45d44719..d7e41c8dd533 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c @@ -509,7 +509,7 @@ static void aty128_bl_set_power(struct fb_info *info, int power); (readb(bios + (v) + 3) << 24)) -static struct fb_ops aty128fb_ops = { +static const struct fb_ops aty128fb_ops = { .owner = THIS_MODULE, .fb_check_var = aty128fb_check_var, .fb_set_par = aty128fb_set_par, diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c index 4ca07866f2f6..3af00e3b965e 100644 --- a/drivers/video/fbdev/aty/radeon_base.c +++ b/drivers/video/fbdev/aty/radeon_base.c @@ -1965,7 +1965,7 @@ static int radeonfb_set_par(struct fb_info *info) } -static struct fb_ops radeonfb_ops = { +static const struct fb_ops radeonfb_ops = { .owner = THIS_MODULE, .fb_check_var = radeonfb_check_var, .fb_set_par = radeonfb_set_par, diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c index 99941ae1f3a1..37a6512feda0 100644 --- a/drivers/video/fbdev/au1100fb.c +++ b/drivers/video/fbdev/au1100fb.c @@ -348,7 +348,7 @@ int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) fbdev->fb_len); } -static struct fb_ops au1100fb_ops = +static const struct fb_ops au1100fb_ops = { .owner = THIS_MODULE, .fb_setcolreg = au1100fb_fb_setcolreg, diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c index 265d3b45efd0..c00e01a17368 100644 --- a/drivers/video/fbdev/au1200fb.c +++ b/drivers/video/fbdev/au1200fb.c @@ -1483,7 +1483,7 @@ static int au1200fb_ioctl(struct fb_info *info, unsigned int cmd, } -static struct fb_ops au1200fb_fb_ops = { +static const struct fb_ops au1200fb_fb_ops = { .owner = THIS_MODULE, .fb_check_var = au1200fb_fb_check_var, .fb_set_par = au1200fb_fb_set_par, diff --git a/drivers/video/fbdev/broadsheetfb.c b/drivers/video/fbdev/broadsheetfb.c index d6ba348deb9f..fd66f4d4a621 100644 --- a/drivers/video/fbdev/broadsheetfb.c +++ b/drivers/video/fbdev/broadsheetfb.c @@ -1048,7 +1048,7 @@ static ssize_t broadsheetfb_write(struct fb_info *info, const char __user *buf, return (err) ? err : count; } -static struct fb_ops broadsheetfb_ops = { +static const struct fb_ops broadsheetfb_ops = { .owner = THIS_MODULE, .fb_read = fb_sys_read, .fb_write = broadsheetfb_write, diff --git a/drivers/video/fbdev/bw2.c b/drivers/video/fbdev/bw2.c index 436f10f3d375..0d9a6bb57a09 100644 --- a/drivers/video/fbdev/bw2.c +++ b/drivers/video/fbdev/bw2.c @@ -37,7 +37,7 @@ static int bw2_ioctl(struct fb_info *, unsigned int, unsigned long); * Frame buffer operations */ -static struct fb_ops bw2_ops = { +static const struct fb_ops bw2_ops = { .owner = THIS_MODULE, .fb_blank = bw2_blank, .fb_fillrect = cfb_fillrect, diff --git a/drivers/video/fbdev/carminefb.c b/drivers/video/fbdev/carminefb.c index 9f3be0258623..bf3f2a9598b1 100644 --- a/drivers/video/fbdev/carminefb.c +++ b/drivers/video/fbdev/carminefb.c @@ -527,7 +527,7 @@ static int init_hardware(struct carmine_hw *hw) return 0; } -static struct fb_ops carminefb_ops = { +static const struct fb_ops carminefb_ops = { .owner = THIS_MODULE, .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, diff --git a/drivers/video/fbdev/cg14.c b/drivers/video/fbdev/cg14.c index d80d99db3a46..a620b51cf7d0 100644 --- a/drivers/video/fbdev/cg14.c +++ b/drivers/video/fbdev/cg14.c @@ -39,7 +39,7 @@ static int cg14_pan_display(struct fb_var_screeninfo *, struct fb_info *); * Frame buffer operations */ -static struct fb_ops cg14_ops = { +static const struct fb_ops cg14_ops = { .owner = THIS_MODULE, .fb_setcolreg = cg14_setcolreg, .fb_pan_display = cg14_pan_display, diff --git a/drivers/video/fbdev/cg3.c b/drivers/video/fbdev/cg3.c index 09f616dddfd7..77f6470ce665 100644 --- a/drivers/video/fbdev/cg3.c +++ b/drivers/video/fbdev/cg3.c @@ -39,7 +39,7 @@ static int cg3_ioctl(struct fb_info *, unsigned int, unsigned long); * Frame buffer operations */ -static struct fb_ops cg3_ops = { +static const struct fb_ops cg3_ops = { .owner = THIS_MODULE, .fb_setcolreg = cg3_setcolreg, .fb_blank = cg3_blank, diff --git a/drivers/video/fbdev/cg6.c b/drivers/video/fbdev/cg6.c index d5888aecc2fb..a1c68cd48d7e 100644 --- a/drivers/video/fbdev/cg6.c +++ b/drivers/video/fbdev/cg6.c @@ -44,7 +44,7 @@ static int cg6_pan_display(struct fb_var_screeninfo *, struct fb_info *); * Frame buffer operations */ -static struct fb_ops cg6_ops = { +static const struct fb_ops cg6_ops = { .owner = THIS_MODULE, .fb_setcolreg = cg6_setcolreg, .fb_blank = cg6_blank, diff --git a/drivers/video/fbdev/chipsfb.c b/drivers/video/fbdev/chipsfb.c index f4dc320dcafe..998067b701fa 100644 --- a/drivers/video/fbdev/chipsfb.c +++ b/drivers/video/fbdev/chipsfb.c @@ -79,7 +79,7 @@ static int chipsfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info); static int chipsfb_blank(int blank, struct fb_info *info); -static struct fb_ops chipsfb_ops = { +static const struct fb_ops chipsfb_ops = { .owner = THIS_MODULE, .fb_check_var = chipsfb_check_var, .fb_set_par = chipsfb_set_par, diff --git a/drivers/video/fbdev/cirrusfb.c b/drivers/video/fbdev/cirrusfb.c index e4ce5667b125..c3a3e344cee3 100644 --- a/drivers/video/fbdev/cirrusfb.c +++ b/drivers/video/fbdev/cirrusfb.c @@ -1956,7 +1956,7 @@ static void cirrusfb_zorro_unmap(struct fb_info *info) #endif /* CONFIG_ZORRO */ /* function table of the above functions */ -static struct fb_ops cirrusfb_ops = { +static const struct fb_ops cirrusfb_ops = { .owner = THIS_MODULE, .fb_open = cirrusfb_open, .fb_release = cirrusfb_release, diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c index cabbc721f894..c5d15c6db287 100644 --- a/drivers/video/fbdev/clps711x-fb.c +++ b/drivers/video/fbdev/clps711x-fb.c @@ -153,7 +153,7 @@ static int clps711x_fb_blank(int blank, struct fb_info *info) return 0; } -static struct fb_ops clps711x_fb_ops = { +static const struct fb_ops clps711x_fb_ops = { .owner = THIS_MODULE, .fb_setcolreg = clps711x_fb_setcolreg, .fb_check_var = clps711x_fb_check_var, diff --git a/drivers/video/fbdev/cobalt_lcdfb.c b/drivers/video/fbdev/cobalt_lcdfb.c index 544946901e8b..5f8b6324d2e8 100644 --- a/drivers/video/fbdev/cobalt_lcdfb.c +++ b/drivers/video/fbdev/cobalt_lcdfb.c @@ -269,7 +269,7 @@ static int cobalt_lcdfb_cursor(struct fb_info *info, struct fb_cursor *cursor) return 0; } -static struct fb_ops cobalt_lcd_fbops = { +static const struct fb_ops cobalt_lcd_fbops = { .owner = THIS_MODULE, .fb_read = cobalt_lcdfb_read, .fb_write = cobalt_lcdfb_write, diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c index 9a680ef3ffc3..38b61cdb5ca4 100644 --- a/drivers/video/fbdev/controlfb.c +++ b/drivers/video/fbdev/controlfb.c @@ -157,7 +157,7 @@ static int default_vmode __initdata = VMODE_NVRAM; static int default_cmode __initdata = CMODE_NVRAM; -static struct fb_ops controlfb_ops = { +static const struct fb_ops controlfb_ops = { .owner = THIS_MODULE, .fb_check_var = controlfb_check_var, .fb_set_par = controlfb_set_par, diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c index 3a2d9ff0aa42..460826a7ad55 100644 --- a/drivers/video/fbdev/cyber2000fb.c +++ b/drivers/video/fbdev/cyber2000fb.c @@ -1060,7 +1060,7 @@ static int cyber2000fb_blank(int blank, struct fb_info *info) return 0; } -static struct fb_ops cyber2000fb_ops = { +static const struct fb_ops cyber2000fb_ops = { .owner = THIS_MODULE, .fb_check_var = cyber2000fb_check_var, .fb_set_par = cyber2000fb_set_par, diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c index 2d3dcc52fcf3..73c3c4c8cc12 100644 --- a/drivers/video/fbdev/da8xx-fb.c +++ b/drivers/video/fbdev/da8xx-fb.c @@ -1294,7 +1294,7 @@ static int da8xxfb_set_par(struct fb_info *info) return 0; } -static struct fb_ops da8xx_fb_ops = { +static const struct fb_ops da8xx_fb_ops = { .owner = THIS_MODULE, .fb_check_var = fb_check_var, .fb_set_par = da8xxfb_set_par, diff --git a/drivers/video/fbdev/dnfb.c b/drivers/video/fbdev/dnfb.c index 8da517eaa4a3..3688f9165848 100644 --- a/drivers/video/fbdev/dnfb.c +++ b/drivers/video/fbdev/dnfb.c @@ -108,7 +108,7 @@ static int dnfb_blank(int blank, struct fb_info *info); static void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); -static struct fb_ops dn_fb_ops = { +static const struct fb_ops dn_fb_ops = { .owner = THIS_MODULE, .fb_blank = dnfb_blank, .fb_fillrect = cfb_fillrect, diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 51d97ec4f58f..f03f9fb60c26 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -255,7 +255,7 @@ static void efifb_destroy(struct fb_info *info) fb_dealloc_cmap(&info->cmap); } -static struct fb_ops efifb_ops = { +static const struct fb_ops efifb_ops = { .owner = THIS_MODULE, .fb_destroy = efifb_destroy, .fb_setcolreg = efifb_setcolreg, diff --git a/drivers/video/fbdev/ep93xx-fb.c b/drivers/video/fbdev/ep93xx-fb.c index d04a047094fc..cda2ef337423 100644 --- a/drivers/video/fbdev/ep93xx-fb.c +++ b/drivers/video/fbdev/ep93xx-fb.c @@ -402,7 +402,7 @@ static int ep93xxfb_setcolreg(unsigned int regno, unsigned int red, return 0; } -static struct fb_ops ep93xxfb_ops = { +static const struct fb_ops ep93xxfb_ops = { .owner = THIS_MODULE, .fb_check_var = ep93xxfb_check_var, .fb_set_par = ep93xxfb_set_par, diff --git a/drivers/video/fbdev/fb-puv3.c b/drivers/video/fbdev/fb-puv3.c index fa62c4dff7d1..75df6aabac21 100644 --- a/drivers/video/fbdev/fb-puv3.c +++ b/drivers/video/fbdev/fb-puv3.c @@ -644,7 +644,7 @@ int unifb_mmap(struct fb_info *info, return vm_iomap_memory(vma, info->fix.smem_start, info->fix.smem_len); } -static struct fb_ops unifb_ops = { +static const struct fb_ops unifb_ops = { .fb_read = fb_sys_read, .fb_write = fb_sys_write, .fb_check_var = unifb_check_var, diff --git a/drivers/video/fbdev/ffb.c b/drivers/video/fbdev/ffb.c index cd2d1db239a2..948b73184433 100644 --- a/drivers/video/fbdev/ffb.c +++ b/drivers/video/fbdev/ffb.c @@ -44,7 +44,7 @@ static int ffb_pan_display(struct fb_var_screeninfo *, struct fb_info *); * Frame buffer operations */ -static struct fb_ops ffb_ops = { +static const struct fb_ops ffb_ops = { .owner = THIS_MODULE, .fb_setcolreg = ffb_setcolreg, .fb_blank = ffb_blank, diff --git a/drivers/video/fbdev/fm2fb.c b/drivers/video/fbdev/fm2fb.c index ac7a4ebfd390..3b727d528fde 100644 --- a/drivers/video/fbdev/fm2fb.c +++ b/drivers/video/fbdev/fm2fb.c @@ -165,7 +165,7 @@ static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info); static int fm2fb_blank(int blank, struct fb_info *info); -static struct fb_ops fm2fb_ops = { +static const struct fb_ops fm2fb_ops = { .owner = THIS_MODULE, .fb_setcolreg = fm2fb_setcolreg, .fb_blank = fm2fb_blank, diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c index d19f58263b4e..7cacabdd5f12 100644 --- a/drivers/video/fbdev/fsl-diu-fb.c +++ b/drivers/video/fbdev/fsl-diu-fb.c @@ -1448,7 +1448,7 @@ static int fsl_diu_release(struct fb_info *info, int user) return res; } -static struct fb_ops fsl_diu_ops = { +static const struct fb_ops fsl_diu_ops = { .owner = THIS_MODULE, .fb_check_var = fsl_diu_check_var, .fb_set_par = fsl_diu_set_par, diff --git a/drivers/video/fbdev/g364fb.c b/drivers/video/fbdev/g364fb.c index 223896cc5f7d..845b79da2a7c 100644 --- a/drivers/video/fbdev/g364fb.c +++ b/drivers/video/fbdev/g364fb.c @@ -111,7 +111,7 @@ static int g364fb_setcolreg(u_int regno, u_int red, u_int green, static int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor); static int g364fb_blank(int blank, struct fb_info *info); -static struct fb_ops g364fb_ops = { +static const struct fb_ops g364fb_ops = { .owner = THIS_MODULE, .fb_setcolreg = g364fb_setcolreg, .fb_pan_display = g364fb_pan_display, diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c index b9f6a82a0495..31270a8986e8 100644 --- a/drivers/video/fbdev/gbefb.c +++ b/drivers/video/fbdev/gbefb.c @@ -1044,7 +1044,7 @@ static int gbefb_mmap(struct fb_info *info, return 0; } -static struct fb_ops gbefb_ops = { +static const struct fb_ops gbefb_ops = { .owner = THIS_MODULE, .fb_check_var = gbefb_check_var, .fb_set_par = gbefb_set_par, diff --git a/drivers/video/fbdev/geode/gx1fb_core.c b/drivers/video/fbdev/geode/gx1fb_core.c index 737e472fac14..5d34d89fb665 100644 --- a/drivers/video/fbdev/geode/gx1fb_core.c +++ b/drivers/video/fbdev/geode/gx1fb_core.c @@ -252,7 +252,7 @@ static int parse_panel_option(struct fb_info *info) return 0; } -static struct fb_ops gx1fb_ops = { +static const struct fb_ops gx1fb_ops = { .owner = THIS_MODULE, .fb_check_var = gx1fb_check_var, .fb_set_par = gx1fb_set_par, diff --git a/drivers/video/fbdev/geode/gxfb_core.c b/drivers/video/fbdev/geode/gxfb_core.c index 435ce2aa4240..d38a148d4746 100644 --- a/drivers/video/fbdev/geode/gxfb_core.c +++ b/drivers/video/fbdev/geode/gxfb_core.c @@ -265,7 +265,7 @@ static int gxfb_map_video_memory(struct fb_info *info, struct pci_dev *dev) return 0; } -static struct fb_ops gxfb_ops = { +static const struct fb_ops gxfb_ops = { .owner = THIS_MODULE, .fb_check_var = gxfb_check_var, .fb_set_par = gxfb_set_par, diff --git a/drivers/video/fbdev/geode/lxfb_core.c b/drivers/video/fbdev/geode/lxfb_core.c index b0f07d676eb3..adc2d9c2395e 100644 --- a/drivers/video/fbdev/geode/lxfb_core.c +++ b/drivers/video/fbdev/geode/lxfb_core.c @@ -386,7 +386,7 @@ static int lxfb_map_video_memory(struct fb_info *info, struct pci_dev *dev) return 0; } -static struct fb_ops lxfb_ops = { +static const struct fb_ops lxfb_ops = { .owner = THIS_MODULE, .fb_check_var = lxfb_check_var, .fb_set_par = lxfb_set_par, diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c index f60ac276703d..9c83ec3f8e1f 100644 --- a/drivers/video/fbdev/goldfishfb.c +++ b/drivers/video/fbdev/goldfishfb.c @@ -160,7 +160,7 @@ static int goldfish_fb_blank(int blank, struct fb_info *info) return 0; } -static struct fb_ops goldfish_fb_ops = { +static const struct fb_ops goldfish_fb_ops = { .owner = THIS_MODULE, .fb_check_var = goldfish_fb_check_var, .fb_set_par = goldfish_fb_set_par, diff --git a/drivers/video/fbdev/grvga.c b/drivers/video/fbdev/grvga.c index d22e8b0c906d..07dda03e0957 100644 --- a/drivers/video/fbdev/grvga.c +++ b/drivers/video/fbdev/grvga.c @@ -251,7 +251,7 @@ static int grvga_pan_display(struct fb_var_screeninfo *var, return 0; } -static struct fb_ops grvga_ops = { +static const struct fb_ops grvga_ops = { .owner = THIS_MODULE, .fb_check_var = grvga_check_var, .fb_set_par = grvga_set_par, diff --git a/drivers/video/fbdev/gxt4500.c b/drivers/video/fbdev/gxt4500.c index c7502fd8f447..13ded3a10708 100644 --- a/drivers/video/fbdev/gxt4500.c +++ b/drivers/video/fbdev/gxt4500.c @@ -599,7 +599,7 @@ static const struct fb_fix_screeninfo gxt4500_fix = { .mmio_len = 0x20000, }; -static struct fb_ops gxt4500_ops = { +static const struct fb_ops gxt4500_ops = { .owner = THIS_MODULE, .fb_check_var = gxt4500_check_var, .fb_set_par = gxt4500_set_par, diff --git a/drivers/video/fbdev/hecubafb.c b/drivers/video/fbdev/hecubafb.c index 8577195cb533..00d77105161a 100644 --- a/drivers/video/fbdev/hecubafb.c +++ b/drivers/video/fbdev/hecubafb.c @@ -197,7 +197,7 @@ static ssize_t hecubafb_write(struct fb_info *info, const char __user *buf, return (err) ? err : count; } -static struct fb_ops hecubafb_ops = { +static const struct fb_ops hecubafb_ops = { .owner = THIS_MODULE, .fb_read = fb_sys_read, .fb_write = hecubafb_write, diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c index 59e1cae57948..a45fcff1461f 100644 --- a/drivers/video/fbdev/hgafb.c +++ b/drivers/video/fbdev/hgafb.c @@ -523,7 +523,7 @@ static void hgafb_imageblit(struct fb_info *info, const struct fb_image *image) } } -static struct fb_ops hgafb_ops = { +static const struct fb_ops hgafb_ops = { .owner = THIS_MODULE, .fb_open = hgafb_open, .fb_release = hgafb_release, diff --git a/drivers/video/fbdev/hitfb.c b/drivers/video/fbdev/hitfb.c index abe3e54d4506..009e5d2aa100 100644 --- a/drivers/video/fbdev/hitfb.c +++ b/drivers/video/fbdev/hitfb.c @@ -311,7 +311,7 @@ static int hitfb_set_par(struct fb_info *info) return 0; } -static struct fb_ops hitfb_ops = { +static const struct fb_ops hitfb_ops = { .owner = THIS_MODULE, .fb_check_var = hitfb_check_var, .fb_set_par = hitfb_set_par, diff --git a/drivers/video/fbdev/hpfb.c b/drivers/video/fbdev/hpfb.c index a79af8f069d1..f02be0db335e 100644 --- a/drivers/video/fbdev/hpfb.c +++ b/drivers/video/fbdev/hpfb.c @@ -184,7 +184,7 @@ static int hpfb_sync(struct fb_info *info) return 0; } -static struct fb_ops hpfb_ops = { +static const struct fb_ops hpfb_ops = { .owner = THIS_MODULE, .fb_setcolreg = hpfb_setcolreg, .fb_blank = hpfb_blank, diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c index 2dcb7c58b31e..fcd546e5c031 100644 --- a/drivers/video/fbdev/hyperv_fb.c +++ b/drivers/video/fbdev/hyperv_fb.c @@ -623,7 +623,7 @@ static void hvfb_cfb_imageblit(struct fb_info *p, synthvid_update(p); } -static struct fb_ops hvfb_ops = { +static const struct fb_ops hvfb_ops = { .owner = THIS_MODULE, .fb_check_var = hvfb_check_var, .fb_set_par = hvfb_set_par, diff --git a/drivers/video/fbdev/i740fb.c b/drivers/video/fbdev/i740fb.c index 347cf8babc3e..c65ec7386e87 100644 --- a/drivers/video/fbdev/i740fb.c +++ b/drivers/video/fbdev/i740fb.c @@ -981,7 +981,7 @@ static int i740fb_blank(int blank_mode, struct fb_info *info) return (blank_mode == FB_BLANK_NORMAL) ? 1 : 0; } -static struct fb_ops i740fb_ops = { +static const struct fb_ops i740fb_ops = { .owner = THIS_MODULE, .fb_open = i740fb_open, .fb_release = i740fb_release, diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c index 58b01c7d9056..3ac053b88495 100644 --- a/drivers/video/fbdev/imsttfb.c +++ b/drivers/video/fbdev/imsttfb.c @@ -1333,7 +1333,7 @@ static struct pci_driver imsttfb_pci_driver = { .remove = imsttfb_remove, }; -static struct fb_ops imsttfb_ops = { +static const struct fb_ops imsttfb_ops = { .owner = THIS_MODULE, .fb_check_var = imsttfb_check_var, .fb_set_par = imsttfb_set_par, diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index b3286d1fa543..08a17eb2a5c7 100644 --- a/drivers/video/fbdev/imxfb.c +++ b/drivers/video/fbdev/imxfb.c @@ -566,7 +566,7 @@ static int imxfb_blank(int blank, struct fb_info *info) return 0; } -static struct fb_ops imxfb_ops = { +static const struct fb_ops imxfb_ops = { .owner = THIS_MODULE, .fb_check_var = imxfb_check_var, .fb_set_par = imxfb_set_par, diff --git a/drivers/video/fbdev/intelfb/intelfbdrv.c b/drivers/video/fbdev/intelfb/intelfbdrv.c index a76c61512c60..c744891781a5 100644 --- a/drivers/video/fbdev/intelfb/intelfbdrv.c +++ b/drivers/video/fbdev/intelfb/intelfbdrv.c @@ -193,7 +193,7 @@ static const struct pci_device_id intelfb_pci_table[] = { static int num_registered = 0; /* fb ops */ -static struct fb_ops intel_fb_ops = { +static const struct fb_ops intel_fb_ops = { .owner = THIS_MODULE, .fb_open = intelfb_open, .fb_release = intelfb_release, diff --git a/drivers/video/fbdev/kyro/fbdev.c b/drivers/video/fbdev/kyro/fbdev.c index a7bd9f25911b..72dff2e42e3a 100644 --- a/drivers/video/fbdev/kyro/fbdev.c +++ b/drivers/video/fbdev/kyro/fbdev.c @@ -648,7 +648,7 @@ static struct pci_driver kyrofb_pci_driver = { .remove = kyrofb_remove, }; -static struct fb_ops kyrofb_ops = { +static const struct fb_ops kyrofb_ops = { .owner = THIS_MODULE, .fb_check_var = kyrofb_check_var, .fb_set_par = kyrofb_set_par, diff --git a/drivers/video/fbdev/leo.c b/drivers/video/fbdev/leo.c index 5b1141ac182b..40b11cce0ad6 100644 --- a/drivers/video/fbdev/leo.c +++ b/drivers/video/fbdev/leo.c @@ -39,7 +39,7 @@ static int leo_pan_display(struct fb_var_screeninfo *, struct fb_info *); * Frame buffer operations */ -static struct fb_ops leo_ops = { +static const struct fb_ops leo_ops = { .owner = THIS_MODULE, .fb_setcolreg = leo_setcolreg, .fb_blank = leo_blank, diff --git a/drivers/video/fbdev/macfb.c b/drivers/video/fbdev/macfb.c index 9a6feee96133..e05a97662ca8 100644 --- a/drivers/video/fbdev/macfb.c +++ b/drivers/video/fbdev/macfb.c @@ -496,7 +496,7 @@ static int macfb_setcolreg(unsigned regno, unsigned red, unsigned green, return 0; } -static struct fb_ops macfb_ops = { +static const struct fb_ops macfb_ops = { .owner = THIS_MODULE, .fb_setcolreg = macfb_setcolreg, .fb_fillrect = cfb_fillrect, diff --git a/drivers/video/fbdev/matrox/matroxfb_crtc2.c b/drivers/video/fbdev/matrox/matroxfb_crtc2.c index d2a81a2c3ac0..7655afa3fd50 100644 --- a/drivers/video/fbdev/matrox/matroxfb_crtc2.c +++ b/drivers/video/fbdev/matrox/matroxfb_crtc2.c @@ -563,7 +563,7 @@ static int matroxfb_dh_blank(int blank, struct fb_info* info) { #undef m2info } -static struct fb_ops matroxfb_dh_ops = { +static const struct fb_ops matroxfb_dh_ops = { .owner = THIS_MODULE, .fb_open = matroxfb_dh_open, .fb_release = matroxfb_dh_release, diff --git a/drivers/video/fbdev/maxinefb.c b/drivers/video/fbdev/maxinefb.c index 5bb1b5c308a7..ae1a42bcb0ea 100644 --- a/drivers/video/fbdev/maxinefb.c +++ b/drivers/video/fbdev/maxinefb.c @@ -105,7 +105,7 @@ static int maxinefb_setcolreg(unsigned regno, unsigned red, unsigned green, return 0; } -static struct fb_ops maxinefb_ops = { +static const struct fb_ops maxinefb_ops = { .owner = THIS_MODULE, .fb_setcolreg = maxinefb_setcolreg, .fb_fillrect = cfb_fillrect, diff --git a/drivers/video/fbdev/mbx/mbxfb.c b/drivers/video/fbdev/mbx/mbxfb.c index 50935252b50b..25dad4507d77 100644 --- a/drivers/video/fbdev/mbx/mbxfb.c +++ b/drivers/video/fbdev/mbx/mbxfb.c @@ -671,7 +671,7 @@ static int mbxfb_ioctl(struct fb_info *info, unsigned int cmd, return -EINVAL; } -static struct fb_ops mbxfb_ops = { +static const struct fb_ops mbxfb_ops = { .owner = THIS_MODULE, .fb_check_var = mbxfb_check_var, .fb_set_par = mbxfb_set_par, diff --git a/drivers/video/fbdev/metronomefb.c b/drivers/video/fbdev/metronomefb.c index bb4fee52e501..a42e2eceee48 100644 --- a/drivers/video/fbdev/metronomefb.c +++ b/drivers/video/fbdev/metronomefb.c @@ -558,7 +558,7 @@ static ssize_t metronomefb_write(struct fb_info *info, const char __user *buf, return (err) ? err : count; } -static struct fb_ops metronomefb_ops = { +static const struct fb_ops metronomefb_ops = { .owner = THIS_MODULE, .fb_write = metronomefb_write, .fb_fillrect = metronomefb_fillrect, diff --git a/drivers/video/fbdev/mmp/fb/mmpfb.c b/drivers/video/fbdev/mmp/fb/mmpfb.c index 47bc7c59bbd8..33db0850086f 100644 --- a/drivers/video/fbdev/mmp/fb/mmpfb.c +++ b/drivers/video/fbdev/mmp/fb/mmpfb.c @@ -454,7 +454,7 @@ static int mmpfb_blank(int blank, struct fb_info *info) return 0; } -static struct fb_ops mmpfb_ops = { +static const struct fb_ops mmpfb_ops = { .owner = THIS_MODULE, .fb_blank = mmpfb_blank, .fb_check_var = mmpfb_check_var, diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c index bafd5f5fac5a..4af28e4421e5 100644 --- a/drivers/video/fbdev/mx3fb.c +++ b/drivers/video/fbdev/mx3fb.c @@ -1249,7 +1249,7 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var, * invoked by the core framebuffer driver to perform operations like * blitting, rectangle filling, copy regions and cursor definition. */ -static struct fb_ops mx3fb_ops = { +static const struct fb_ops mx3fb_ops = { .owner = THIS_MODULE, .fb_set_par = mx3fb_set_par, .fb_check_var = mx3fb_check_var, @@ -1389,7 +1389,8 @@ static int mx3fb_unmap_video_memory(struct fb_info *fbi) * mx3fb_init_fbinfo() - initialize framebuffer information object. * @return: initialized framebuffer structure. */ -static struct fb_info *mx3fb_init_fbinfo(struct device *dev, struct fb_ops *ops) +static struct fb_info *mx3fb_init_fbinfo(struct device *dev, + const struct fb_ops *ops) { struct fb_info *fbi; struct mx3fb_info *mx3fbi; diff --git a/drivers/video/fbdev/neofb.c b/drivers/video/fbdev/neofb.c index b770946a0920..e6ea853c1723 100644 --- a/drivers/video/fbdev/neofb.c +++ b/drivers/video/fbdev/neofb.c @@ -1610,7 +1610,7 @@ neofb_cursor(struct fb_info *info, struct fb_cursor *cursor) } */ -static struct fb_ops neofb_ops = { +static const struct fb_ops neofb_ops = { .owner = THIS_MODULE, .fb_open = neofb_open, .fb_release = neofb_release, diff --git a/drivers/video/fbdev/ocfb.c b/drivers/video/fbdev/ocfb.c index a970edc2a6f8..c8cee2d890dc 100644 --- a/drivers/video/fbdev/ocfb.c +++ b/drivers/video/fbdev/ocfb.c @@ -285,7 +285,7 @@ static int ocfb_init_var(struct ocfb_dev *fbdev) return 0; } -static struct fb_ops ocfb_ops = { +static const struct fb_ops ocfb_ops = { .owner = THIS_MODULE, .fb_setcolreg = ocfb_setcolreg, .fb_fillrect = cfb_fillrect, diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index fbc6eafb63c7..5cd0f5f6a4ae 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c @@ -286,7 +286,7 @@ static void offb_destroy(struct fb_info *info) framebuffer_release(info); } -static struct fb_ops offb_ops = { +static const struct fb_ops offb_ops = { .owner = THIS_MODULE, .fb_destroy = offb_destroy, .fb_setcolreg = offb_setcolreg, diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c index 858c2c011d19..8dfa9158ba78 100644 --- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c +++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c @@ -1280,7 +1280,7 @@ ssize_t omapfb_write(struct fb_info *info, const char __user *buf, } #endif -static struct fb_ops omapfb_ops = { +static const struct fb_ops omapfb_ops = { .owner = THIS_MODULE, .fb_open = omapfb_open, .fb_release = omapfb_release, diff --git a/drivers/video/fbdev/p9100.c b/drivers/video/fbdev/p9100.c index 8c18cc51aae2..6da672e92643 100644 --- a/drivers/video/fbdev/p9100.c +++ b/drivers/video/fbdev/p9100.c @@ -37,7 +37,7 @@ static int p9100_ioctl(struct fb_info *, unsigned int, unsigned long); * Frame buffer operations */ -static struct fb_ops p9100_ops = { +static const struct fb_ops p9100_ops = { .owner = THIS_MODULE, .fb_setcolreg = p9100_setcolreg, .fb_blank = p9100_blank, diff --git a/drivers/video/fbdev/platinumfb.c b/drivers/video/fbdev/platinumfb.c index 632b246ca35f..ce413a9df06e 100644 --- a/drivers/video/fbdev/platinumfb.c +++ b/drivers/video/fbdev/platinumfb.c @@ -96,7 +96,7 @@ static int platinum_var_to_par(struct fb_var_screeninfo *var, * Interface used by the world */ -static struct fb_ops platinumfb_ops = { +static const struct fb_ops platinumfb_ops = { .owner = THIS_MODULE, .fb_check_var = platinumfb_check_var, .fb_set_par = platinumfb_set_par, diff --git a/drivers/video/fbdev/pm2fb.c b/drivers/video/fbdev/pm2fb.c index 1dcf02e12af4..8f933bad461c 100644 --- a/drivers/video/fbdev/pm2fb.c +++ b/drivers/video/fbdev/pm2fb.c @@ -1483,7 +1483,7 @@ static int pm2fb_cursor(struct fb_info *info, struct fb_cursor *cursor) * Frame buffer operations */ -static struct fb_ops pm2fb_ops = { +static const struct fb_ops pm2fb_ops = { .owner = THIS_MODULE, .fb_check_var = pm2fb_check_var, .fb_set_par = pm2fb_set_par, diff --git a/drivers/video/fbdev/pm3fb.c b/drivers/video/fbdev/pm3fb.c index 6130aa56a1e9..15a2b495235b 100644 --- a/drivers/video/fbdev/pm3fb.c +++ b/drivers/video/fbdev/pm3fb.c @@ -1200,7 +1200,7 @@ static int pm3fb_blank(int blank_mode, struct fb_info *info) * Frame buffer operations */ -static struct fb_ops pm3fb_ops = { +static const struct fb_ops pm3fb_ops = { .owner = THIS_MODULE, .fb_check_var = pm3fb_check_var, .fb_set_par = pm3fb_set_par, diff --git a/drivers/video/fbdev/pmag-aa-fb.c b/drivers/video/fbdev/pmag-aa-fb.c index d1e78ce3a9c2..7b33b52b2526 100644 --- a/drivers/video/fbdev/pmag-aa-fb.c +++ b/drivers/video/fbdev/pmag-aa-fb.c @@ -147,7 +147,7 @@ static int aafb_blank(int blank, struct fb_info *info) return 0; } -static struct fb_ops aafb_ops = { +static const struct fb_ops aafb_ops = { .owner = THIS_MODULE, .fb_blank = aafb_blank, .fb_fillrect = cfb_fillrect, diff --git a/drivers/video/fbdev/pmag-ba-fb.c b/drivers/video/fbdev/pmag-ba-fb.c index 56b912bb28de..a60e56d8980b 100644 --- a/drivers/video/fbdev/pmag-ba-fb.c +++ b/drivers/video/fbdev/pmag-ba-fb.c @@ -117,7 +117,7 @@ static int pmagbafb_setcolreg(unsigned int regno, unsigned int red, return 0; } -static struct fb_ops pmagbafb_ops = { +static const struct fb_ops pmagbafb_ops = { .owner = THIS_MODULE, .fb_setcolreg = pmagbafb_setcolreg, .fb_fillrect = cfb_fillrect, diff --git a/drivers/video/fbdev/pmagb-b-fb.c b/drivers/video/fbdev/pmagb-b-fb.c index 2822b2225924..f02080f21077 100644 --- a/drivers/video/fbdev/pmagb-b-fb.c +++ b/drivers/video/fbdev/pmagb-b-fb.c @@ -121,7 +121,7 @@ static int pmagbbfb_setcolreg(unsigned int regno, unsigned int red, return 0; } -static struct fb_ops pmagbbfb_ops = { +static const struct fb_ops pmagbbfb_ops = { .owner = THIS_MODULE, .fb_setcolreg = pmagbbfb_setcolreg, .fb_fillrect = cfb_fillrect, diff --git a/drivers/video/fbdev/ps3fb.c b/drivers/video/fbdev/ps3fb.c index 5ed2db39d823..834f63edf700 100644 --- a/drivers/video/fbdev/ps3fb.c +++ b/drivers/video/fbdev/ps3fb.c @@ -934,7 +934,7 @@ static irqreturn_t ps3fb_vsync_interrupt(int irq, void *ptr) } -static struct fb_ops ps3fb_ops = { +static const struct fb_ops ps3fb_ops = { .fb_open = ps3fb_open, .fb_release = ps3fb_release, .fb_read = fb_sys_read, diff --git a/drivers/video/fbdev/pvr2fb.c b/drivers/video/fbdev/pvr2fb.c index 0a3b2b7c7891..fcb16eabbb0d 100644 --- a/drivers/video/fbdev/pvr2fb.c +++ b/drivers/video/fbdev/pvr2fb.c @@ -707,7 +707,7 @@ out_unmap: } #endif /* CONFIG_PVR2_DMA */ -static struct fb_ops pvr2fb_ops = { +static const struct fb_ops pvr2fb_ops = { .owner = THIS_MODULE, .fb_setcolreg = pvr2fb_setcolreg, .fb_blank = pvr2fb_blank, diff --git a/drivers/video/fbdev/pxa168fb.c b/drivers/video/fbdev/pxa168fb.c index 1410f476e135..c672c3354a2c 100644 --- a/drivers/video/fbdev/pxa168fb.c +++ b/drivers/video/fbdev/pxa168fb.c @@ -545,7 +545,7 @@ static irqreturn_t pxa168fb_handle_irq(int irq, void *dev_id) return IRQ_NONE; } -static struct fb_ops pxa168fb_ops = { +static const struct fb_ops pxa168fb_ops = { .owner = THIS_MODULE, .fb_check_var = pxa168fb_check_var, .fb_set_par = pxa168fb_set_par, diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index f70c9f79622e..6f7e9fb63190 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -597,7 +597,7 @@ static int pxafb_blank(int blank, struct fb_info *info) return 0; } -static struct fb_ops pxafb_ops = { +static const struct fb_ops pxafb_ops = { .owner = THIS_MODULE, .fb_check_var = pxafb_check_var, .fb_set_par = pxafb_set_par, @@ -865,7 +865,7 @@ static int overlayfb_set_par(struct fb_info *info) return 0; } -static struct fb_ops overlay_fb_ops = { +static const struct fb_ops overlay_fb_ops = { .owner = THIS_MODULE, .fb_open = overlayfb_open, .fb_release = overlayfb_release, diff --git a/drivers/video/fbdev/q40fb.c b/drivers/video/fbdev/q40fb.c index 0b93aa964d43..79ff14a35c85 100644 --- a/drivers/video/fbdev/q40fb.c +++ b/drivers/video/fbdev/q40fb.c @@ -75,7 +75,7 @@ static int q40fb_setcolreg(unsigned regno, unsigned red, unsigned green, return 0; } -static struct fb_ops q40fb_ops = { +static const struct fb_ops q40fb_ops = { .owner = THIS_MODULE, .fb_setcolreg = q40fb_setcolreg, .fb_fillrect = cfb_fillrect, diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c index ca593a3e41d7..764ec3285e62 100644 --- a/drivers/video/fbdev/riva/fbdev.c +++ b/drivers/video/fbdev/riva/fbdev.c @@ -1673,7 +1673,7 @@ static int rivafb_sync(struct fb_info *info) * ------------------------------------------------------------------------- */ /* kernel interface */ -static struct fb_ops riva_fb_ops = { +static const struct fb_ops riva_fb_ops = { .owner = THIS_MODULE, .fb_open = rivafb_open, .fb_release = rivafb_release, diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c index ba04d7a67829..f4871c430f8d 100644 --- a/drivers/video/fbdev/s3c-fb.c +++ b/drivers/video/fbdev/s3c-fb.c @@ -1035,7 +1035,7 @@ static int s3c_fb_ioctl(struct fb_info *info, unsigned int cmd, return ret; } -static struct fb_ops s3c_fb_ops = { +static const struct fb_ops s3c_fb_ops = { .owner = THIS_MODULE, .fb_check_var = s3c_fb_check_var, .fb_set_par = s3c_fb_set_par, diff --git a/drivers/video/fbdev/s3c2410fb.c b/drivers/video/fbdev/s3c2410fb.c index a702da89910b..2fb15a540167 100644 --- a/drivers/video/fbdev/s3c2410fb.c +++ b/drivers/video/fbdev/s3c2410fb.c @@ -618,7 +618,7 @@ static int s3c2410fb_debug_store(struct device *dev, static DEVICE_ATTR(debug, 0664, s3c2410fb_debug_show, s3c2410fb_debug_store); -static struct fb_ops s3c2410fb_ops = { +static const struct fb_ops s3c2410fb_ops = { .owner = THIS_MODULE, .fb_check_var = s3c2410fb_check_var, .fb_set_par = s3c2410fb_set_par, diff --git a/drivers/video/fbdev/s3fb.c b/drivers/video/fbdev/s3fb.c index be16c349c10f..60c424fae988 100644 --- a/drivers/video/fbdev/s3fb.c +++ b/drivers/video/fbdev/s3fb.c @@ -1037,7 +1037,7 @@ static int s3fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) /* Frame buffer operations */ -static struct fb_ops s3fb_ops = { +static const struct fb_ops s3fb_ops = { .owner = THIS_MODULE, .fb_open = s3fb_open, .fb_release = s3fb_release, diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index 81ad3aa1ca06..4680cc3efb81 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c @@ -574,7 +574,7 @@ static int sa1100fb_mmap(struct fb_info *info, return vm_iomap_memory(vma, info->fix.mmio_start, info->fix.mmio_len); } -static struct fb_ops sa1100fb_ops = { +static const struct fb_ops sa1100fb_ops = { .owner = THIS_MODULE, .fb_check_var = sa1100fb_check_var, .fb_set_par = sa1100fb_set_par, diff --git a/drivers/video/fbdev/savage/savagefb_driver.c b/drivers/video/fbdev/savage/savagefb_driver.c index 512789f5f884..aab312a7d9da 100644 --- a/drivers/video/fbdev/savage/savagefb_driver.c +++ b/drivers/video/fbdev/savage/savagefb_driver.c @@ -1637,7 +1637,7 @@ static int savagefb_release(struct fb_info *info, int user) return 0; } -static struct fb_ops savagefb_ops = { +static const struct fb_ops savagefb_ops = { .owner = THIS_MODULE, .fb_open = savagefb_open, .fb_release = savagefb_release, diff --git a/drivers/video/fbdev/sh7760fb.c b/drivers/video/fbdev/sh7760fb.c index ab8fe838c776..b8ec8d9bb4c8 100644 --- a/drivers/video/fbdev/sh7760fb.c +++ b/drivers/video/fbdev/sh7760fb.c @@ -341,7 +341,7 @@ static int sh7760fb_set_par(struct fb_info *info) return 0; } -static struct fb_ops sh7760fb_ops = { +static const struct fb_ops sh7760fb_ops = { .owner = THIS_MODULE, .fb_blank = sh7760fb_blank, .fb_check_var = sh7760fb_check_var, diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index c249763dbf0b..25f119efebc0 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -1490,7 +1490,7 @@ sh_mobile_lcdc_overlay_mmap(struct fb_info *info, struct vm_area_struct *vma) ovl->dma_handle, ovl->fb_size); } -static struct fb_ops sh_mobile_lcdc_overlay_ops = { +static const struct fb_ops sh_mobile_lcdc_overlay_ops = { .owner = THIS_MODULE, .fb_read = fb_sys_read, .fb_write = fb_sys_write, @@ -1964,7 +1964,7 @@ sh_mobile_lcdc_mmap(struct fb_info *info, struct vm_area_struct *vma) ch->dma_handle, ch->fb_size); } -static struct fb_ops sh_mobile_lcdc_ops = { +static const struct fb_ops sh_mobile_lcdc_ops = { .owner = THIS_MODULE, .fb_setcolreg = sh_mobile_lcdc_setcolreg, .fb_read = fb_sys_read, diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c index 7dc0105f700d..533a047d07a2 100644 --- a/drivers/video/fbdev/simplefb.c +++ b/drivers/video/fbdev/simplefb.c @@ -78,7 +78,7 @@ static void simplefb_destroy(struct fb_info *info) iounmap(info->screen_base); } -static struct fb_ops simplefb_ops = { +static const struct fb_ops simplefb_ops = { .owner = THIS_MODULE, .fb_destroy = simplefb_destroy, .fb_setcolreg = simplefb_setcolreg, diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c index b443a8ed4600..ac140962b1bf 100644 --- a/drivers/video/fbdev/sis/sis_main.c +++ b/drivers/video/fbdev/sis/sis_main.c @@ -1906,7 +1906,7 @@ sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info) /* ---------------- fb_ops structures ----------------- */ -static struct fb_ops sisfb_ops = { +static const struct fb_ops sisfb_ops = { .owner = THIS_MODULE, .fb_open = sisfb_open, .fb_release = sisfb_release, diff --git a/drivers/video/fbdev/skeletonfb.c b/drivers/video/fbdev/skeletonfb.c index 812a36cb60c3..bcacfb6934fa 100644 --- a/drivers/video/fbdev/skeletonfb.c +++ b/drivers/video/fbdev/skeletonfb.c @@ -634,7 +634,7 @@ int xxxfb_sync(struct fb_info *info) * Frame buffer operations */ -static struct fb_ops xxxfb_ops = { +static const struct fb_ops xxxfb_ops = { .owner = THIS_MODULE, .fb_open = xxxfb_open, .fb_read = xxxfb_read, diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c index 207d0add684b..6a1b4a853d9e 100644 --- a/drivers/video/fbdev/sm712fb.c +++ b/drivers/video/fbdev/sm712fb.c @@ -1369,7 +1369,7 @@ static int smtc_set_par(struct fb_info *info) return 0; } -static struct fb_ops smtcfb_ops = { +static const struct fb_ops smtcfb_ops = { .owner = THIS_MODULE, .fb_check_var = smtc_check_var, .fb_set_par = smtc_set_par, diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c index e362d7da87fc..bfac3ee4a642 100644 --- a/drivers/video/fbdev/smscufx.c +++ b/drivers/video/fbdev/smscufx.c @@ -1268,7 +1268,7 @@ static int ufx_ops_blank(int blank_mode, struct fb_info *info) return 0; } -static struct fb_ops ufx_ops = { +static const struct fb_ops ufx_ops = { .owner = THIS_MODULE, .fb_read = fb_sys_read, .fb_write = ufx_ops_write, diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 78ca7ffc40c2..142535267fec 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -280,7 +280,7 @@ static void ssd1307fb_imageblit(struct fb_info *info, const struct fb_image *ima ssd1307fb_update_display(par); } -static struct fb_ops ssd1307fb_ops = { +static const struct fb_ops ssd1307fb_ops = { .owner = THIS_MODULE, .fb_read = fb_sys_read, .fb_write = ssd1307fb_write, diff --git a/drivers/video/fbdev/sstfb.c b/drivers/video/fbdev/sstfb.c index 4e22ae383c87..82e707a48e4e 100644 --- a/drivers/video/fbdev/sstfb.c +++ b/drivers/video/fbdev/sstfb.c @@ -1307,7 +1307,7 @@ static int sstfb_setup(char *options) } -static struct fb_ops sstfb_ops = { +static const struct fb_ops sstfb_ops = { .owner = THIS_MODULE, .fb_check_var = sstfb_check_var, .fb_set_par = sstfb_set_par, diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c index 9e88e3f594c2..5400ab79fbbd 100644 --- a/drivers/video/fbdev/stifb.c +++ b/drivers/video/fbdev/stifb.c @@ -1101,7 +1101,7 @@ stifb_init_display(struct stifb_info *fb) /* ------------ Interfaces to hardware functions ------------ */ -static struct fb_ops stifb_ops = { +static const struct fb_ops stifb_ops = { .owner = THIS_MODULE, .fb_setcolreg = stifb_setcolreg, .fb_blank = stifb_blank, diff --git a/drivers/video/fbdev/sunxvr1000.c b/drivers/video/fbdev/sunxvr1000.c index 784c9bd5d502..15b079505a00 100644 --- a/drivers/video/fbdev/sunxvr1000.c +++ b/drivers/video/fbdev/sunxvr1000.c @@ -59,7 +59,7 @@ static int gfb_setcolreg(unsigned regno, return 0; } -static struct fb_ops gfb_ops = { +static const struct fb_ops gfb_ops = { .owner = THIS_MODULE, .fb_setcolreg = gfb_setcolreg, .fb_fillrect = cfb_fillrect, diff --git a/drivers/video/fbdev/sunxvr2500.c b/drivers/video/fbdev/sunxvr2500.c index 31683e5a8b79..1d3bacd9d5ac 100644 --- a/drivers/video/fbdev/sunxvr2500.c +++ b/drivers/video/fbdev/sunxvr2500.c @@ -63,7 +63,7 @@ static int s3d_setcolreg(unsigned regno, return 0; } -static struct fb_ops s3d_ops = { +static const struct fb_ops s3d_ops = { .owner = THIS_MODULE, .fb_setcolreg = s3d_setcolreg, .fb_fillrect = cfb_fillrect, diff --git a/drivers/video/fbdev/sunxvr500.c b/drivers/video/fbdev/sunxvr500.c index d392976126a6..9daf17b11106 100644 --- a/drivers/video/fbdev/sunxvr500.c +++ b/drivers/video/fbdev/sunxvr500.c @@ -186,7 +186,7 @@ static void e3d_copyarea(struct fb_info *info, const struct fb_copyarea *area) spin_unlock_irqrestore(&ep->lock, flags); } -static struct fb_ops e3d_ops = { +static const struct fb_ops e3d_ops = { .owner = THIS_MODULE, .fb_setcolreg = e3d_setcolreg, .fb_fillrect = e3d_fillrect, diff --git a/drivers/video/fbdev/tcx.c b/drivers/video/fbdev/tcx.c index 7897f86fb23e..34b2e5b6e84a 100644 --- a/drivers/video/fbdev/tcx.c +++ b/drivers/video/fbdev/tcx.c @@ -40,7 +40,7 @@ static int tcx_pan_display(struct fb_var_screeninfo *, struct fb_info *); * Frame buffer operations */ -static struct fb_ops tcx_ops = { +static const struct fb_ops tcx_ops = { .owner = THIS_MODULE, .fb_setcolreg = tcx_setcolreg, .fb_blank = tcx_blank, diff --git a/drivers/video/fbdev/tdfxfb.c b/drivers/video/fbdev/tdfxfb.c index fdbb1ea66e6c..0349cf69652f 100644 --- a/drivers/video/fbdev/tdfxfb.c +++ b/drivers/video/fbdev/tdfxfb.c @@ -1141,7 +1141,7 @@ static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor) return 0; } -static struct fb_ops tdfxfb_ops = { +static const struct fb_ops tdfxfb_ops = { .owner = THIS_MODULE, .fb_check_var = tdfxfb_check_var, .fb_set_par = tdfxfb_set_par, diff --git a/drivers/video/fbdev/tgafb.c b/drivers/video/fbdev/tgafb.c index 286b2371c7dd..7cd262858241 100644 --- a/drivers/video/fbdev/tgafb.c +++ b/drivers/video/fbdev/tgafb.c @@ -70,7 +70,7 @@ static struct tc_driver tgafb_tc_driver; * Frame buffer operations */ -static struct fb_ops tgafb_ops = { +static const struct fb_ops tgafb_ops = { .owner = THIS_MODULE, .fb_check_var = tgafb_check_var, .fb_set_par = tgafb_set_par, diff --git a/drivers/video/fbdev/tmiofb.c b/drivers/video/fbdev/tmiofb.c index 4f2fcea10d2b..50111966c981 100644 --- a/drivers/video/fbdev/tmiofb.c +++ b/drivers/video/fbdev/tmiofb.c @@ -646,7 +646,7 @@ static int tmiofb_blank(int blank, struct fb_info *info) return 0; } -static struct fb_ops tmiofb_ops = { +static const struct fb_ops tmiofb_ops = { .owner = THIS_MODULE, .fb_ioctl = tmiofb_ioctl, diff --git a/drivers/video/fbdev/tridentfb.c b/drivers/video/fbdev/tridentfb.c index da74bf6c5996..715509917eaa 100644 --- a/drivers/video/fbdev/tridentfb.c +++ b/drivers/video/fbdev/tridentfb.c @@ -1443,7 +1443,7 @@ static int tridentfb_blank(int blank_mode, struct fb_info *info) return (blank_mode == FB_BLANK_NORMAL) ? 1 : 0; } -static struct fb_ops tridentfb_ops = { +static const struct fb_ops tridentfb_ops = { .owner = THIS_MODULE, .fb_setcolreg = tridentfb_setcolreg, .fb_pan_display = tridentfb_pan_display, diff --git a/drivers/video/fbdev/valkyriefb.c b/drivers/video/fbdev/valkyriefb.c index e04fde9c1fcd..ca8d7343aaa1 100644 --- a/drivers/video/fbdev/valkyriefb.c +++ b/drivers/video/fbdev/valkyriefb.c @@ -113,7 +113,7 @@ static int valkyrie_init_info(struct fb_info *info, struct fb_info_valkyrie *p); static void valkyrie_par_to_fix(struct fb_par_valkyrie *par, struct fb_fix_screeninfo *fix); static void valkyrie_init_fix(struct fb_fix_screeninfo *fix, struct fb_info_valkyrie *p); -static struct fb_ops valkyriefb_ops = { +static const struct fb_ops valkyriefb_ops = { .owner = THIS_MODULE, .fb_check_var = valkyriefb_check_var, .fb_set_par = valkyriefb_set_par, diff --git a/drivers/video/fbdev/vfb.c b/drivers/video/fbdev/vfb.c index 54127905bfe7..95d3c59867d0 100644 --- a/drivers/video/fbdev/vfb.c +++ b/drivers/video/fbdev/vfb.c @@ -78,7 +78,7 @@ static int vfb_pan_display(struct fb_var_screeninfo *var, static int vfb_mmap(struct fb_info *info, struct vm_area_struct *vma); -static struct fb_ops vfb_ops = { +static const struct fb_ops vfb_ops = { .fb_read = fb_sys_read, .fb_write = fb_sys_write, .fb_check_var = vfb_check_var, diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c index 2c6a576ed84c..a20eeb8308ff 100644 --- a/drivers/video/fbdev/vga16fb.c +++ b/drivers/video/fbdev/vga16fb.c @@ -1270,7 +1270,7 @@ static void vga16fb_destroy(struct fb_info *info) framebuffer_release(info); } -static struct fb_ops vga16fb_ops = { +static const struct fb_ops vga16fb_ops = { .owner = THIS_MODULE, .fb_open = vga16fb_open, .fb_release = vga16fb_release, diff --git a/drivers/video/fbdev/vt8500lcdfb.c b/drivers/video/fbdev/vt8500lcdfb.c index be8d9702cbb2..f744479dc7df 100644 --- a/drivers/video/fbdev/vt8500lcdfb.c +++ b/drivers/video/fbdev/vt8500lcdfb.c @@ -238,7 +238,7 @@ static int vt8500lcd_blank(int blank, struct fb_info *info) return 0; } -static struct fb_ops vt8500lcd_ops = { +static const struct fb_ops vt8500lcd_ops = { .owner = THIS_MODULE, .fb_set_par = vt8500lcd_set_par, .fb_setcolreg = vt8500lcd_setcolreg, diff --git a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c index c339a8fbad81..7b3eef1b893f 100644 --- a/drivers/video/fbdev/vt8623fb.c +++ b/drivers/video/fbdev/vt8623fb.c @@ -634,7 +634,7 @@ static int vt8623fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *i /* Frame buffer operations */ -static struct fb_ops vt8623fb_ops = { +static const struct fb_ops vt8623fb_ops = { .owner = THIS_MODULE, .fb_open = vt8623fb_open, .fb_release = vt8623fb_release, diff --git a/drivers/video/fbdev/w100fb.c b/drivers/video/fbdev/w100fb.c index 3be07807edcd..fe628ec20149 100644 --- a/drivers/video/fbdev/w100fb.c +++ b/drivers/video/fbdev/w100fb.c @@ -549,7 +549,7 @@ static int w100fb_set_par(struct fb_info *info) /* * Frame buffer operations */ -static struct fb_ops w100fb_ops = { +static const struct fb_ops w100fb_ops = { .owner = THIS_MODULE, .fb_check_var = w100fb_check_var, .fb_set_par = w100fb_set_par, diff --git a/drivers/video/fbdev/wm8505fb.c b/drivers/video/fbdev/wm8505fb.c index 17c780315ca5..b656eff58c23 100644 --- a/drivers/video/fbdev/wm8505fb.c +++ b/drivers/video/fbdev/wm8505fb.c @@ -246,7 +246,7 @@ static int wm8505fb_blank(int blank, struct fb_info *info) return 0; } -static struct fb_ops wm8505fb_ops = { +static const struct fb_ops wm8505fb_ops = { .owner = THIS_MODULE, .fb_set_par = wm8505fb_set_par, .fb_setcolreg = wm8505fb_setcolreg, diff --git a/drivers/video/fbdev/xen-fbfront.c b/drivers/video/fbdev/xen-fbfront.c index a3d6b6db221b..00307b8693bf 100644 --- a/drivers/video/fbdev/xen-fbfront.c +++ b/drivers/video/fbdev/xen-fbfront.c @@ -328,7 +328,7 @@ static int xenfb_set_par(struct fb_info *info) return 0; } -static struct fb_ops xenfb_fb_ops = { +static const struct fb_ops xenfb_fb_ops = { .owner = THIS_MODULE, .fb_read = fb_sys_read, .fb_write = xenfb_write, diff --git a/drivers/video/fbdev/xilinxfb.c b/drivers/video/fbdev/xilinxfb.c index 8628829b470d..ca4ff658cad0 100644 --- a/drivers/video/fbdev/xilinxfb.c +++ b/drivers/video/fbdev/xilinxfb.c @@ -247,7 +247,7 @@ xilinx_fb_blank(int blank_mode, struct fb_info *fbi) return 0; /* success */ } -static struct fb_ops xilinxfb_ops = { +static const struct fb_ops xilinxfb_ops = { .owner = THIS_MODULE, .fb_setcolreg = xilinx_fb_setcolreg, .fb_blank = xilinx_fb_blank, -- cgit v1.2.3 From 5d2197466a094cba586d3a169778432ac4febcb8 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 27 Jun 2019 16:07:03 +0200 Subject: video: fbdev: mmp: remove duplicated MMP_DISP dependency This dependency is already present in higher level Kconfig file (drivers/video/fbdev/mmp/Kconfig). Reviewed-by: Andrzej Hajda Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/eb28587c-4f8f-f044-1b8b-317a8d7967aa@samsung.com --- drivers/video/fbdev/mmp/fb/Kconfig | 4 ---- drivers/video/fbdev/mmp/hw/Kconfig | 4 ---- 2 files changed, 8 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/mmp/fb/Kconfig b/drivers/video/fbdev/mmp/fb/Kconfig index 39944eb23ef8..0ec2e3fb9e17 100644 --- a/drivers/video/fbdev/mmp/fb/Kconfig +++ b/drivers/video/fbdev/mmp/fb/Kconfig @@ -1,6 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -if MMP_DISP - config MMP_FB tristate "fb driver for Marvell MMP Display Subsystem" depends on FB @@ -10,5 +8,3 @@ config MMP_FB default y help fb driver for Marvell MMP Display Subsystem - -endif diff --git a/drivers/video/fbdev/mmp/hw/Kconfig b/drivers/video/fbdev/mmp/hw/Kconfig index 4d018cf661ec..39ec9ebd781f 100644 --- a/drivers/video/fbdev/mmp/hw/Kconfig +++ b/drivers/video/fbdev/mmp/hw/Kconfig @@ -1,6 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -if MMP_DISP - config MMP_DISP_CONTROLLER bool "mmp display controller hw support" depends on CPU_PXA910 || CPU_MMP2 @@ -16,5 +14,3 @@ config MMP_DISP_SPI help Marvell MMP display hw controller spi port support will register as a spi master for panel usage - -endif -- cgit v1.2.3 From dd90e9ae55a1e7efd3ac036afe9f7ae7bb64d39d Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 27 Jun 2019 16:07:43 +0200 Subject: video: fbdev: mmp: add COMPILE_TEST support Add COMPILE_TEST support to mmp display subsystem for better compile testing coverage. Reviewed-by: Andrzej Hajda Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/d21a19ea-8c18-80df-ae79-76de7c5ee67c@samsung.com --- drivers/video/fbdev/mmp/Kconfig | 2 +- drivers/video/fbdev/mmp/hw/Kconfig | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/mmp/Kconfig b/drivers/video/fbdev/mmp/Kconfig index 9041ffd2cfcf..5c6cc97c96f0 100644 --- a/drivers/video/fbdev/mmp/Kconfig +++ b/drivers/video/fbdev/mmp/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only menuconfig MMP_DISP tristate "Marvell MMP Display Subsystem support" - depends on CPU_PXA910 || CPU_MMP2 + depends on CPU_PXA910 || CPU_MMP2 || COMPILE_TEST help Marvell Display Subsystem support. diff --git a/drivers/video/fbdev/mmp/hw/Kconfig b/drivers/video/fbdev/mmp/hw/Kconfig index 39ec9ebd781f..7ebe125093d5 100644 --- a/drivers/video/fbdev/mmp/hw/Kconfig +++ b/drivers/video/fbdev/mmp/hw/Kconfig @@ -1,7 +1,8 @@ # SPDX-License-Identifier: GPL-2.0-only config MMP_DISP_CONTROLLER bool "mmp display controller hw support" - depends on CPU_PXA910 || CPU_MMP2 + depends on HAVE_CLK && HAS_IOMEM + depends on CPU_PXA910 || CPU_MMP2 || COMPILE_TEST help Marvell MMP display hw controller support this controller is used on Marvell PXA910 and -- cgit v1.2.3 From e41f6b17aba58f4504491ebddc6ae4ce14f33ef3 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 27 Jun 2019 16:08:43 +0200 Subject: video: fbdev: mmp: fix sparse warnings about using incorrect types Use ->screen_buffer instead of ->screen_base in mmpfb driver. [ Please see commit 17a7b0b4d974 ("fb.h: Provide alternate screen_base pointer") for details. ] Also fix all other sparse warnings about using incorrect types in mmp display subsystem. Reviewed-by: Andrzej Hajda Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/ee796b43-f200-d41a-b18c-ae3d6bcaaa67@samsung.com --- drivers/video/fbdev/mmp/fb/mmpfb.c | 2 +- drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 57 ++++++++++++++++++++--------------- drivers/video/fbdev/mmp/hw/mmp_ctrl.h | 10 +++--- drivers/video/fbdev/mmp/hw/mmp_spi.c | 6 ++-- 4 files changed, 42 insertions(+), 33 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/mmp/fb/mmpfb.c b/drivers/video/fbdev/mmp/fb/mmpfb.c index 33db0850086f..01c75c031cb6 100644 --- a/drivers/video/fbdev/mmp/fb/mmpfb.c +++ b/drivers/video/fbdev/mmp/fb/mmpfb.c @@ -522,7 +522,7 @@ static int fb_info_setup(struct fb_info *info, info->var.bits_per_pixel / 8; info->fbops = &mmpfb_ops; info->pseudo_palette = fbi->pseudo_palette; - info->screen_base = fbi->fb_start; + info->screen_buffer = fbi->fb_start; info->screen_size = fbi->fb_size; /* For FB framework: Allocate color map and Register framebuffer*/ diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c index 17174cd7a5bb..b877a606ce26 100644 --- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c +++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c @@ -136,19 +136,26 @@ static void overlay_set_win(struct mmp_overlay *overlay, struct mmp_win *win) mutex_lock(&overlay->access_ok); if (overlay_is_vid(overlay)) { - writel_relaxed(win->pitch[0], ®s->v_pitch_yc); - writel_relaxed(win->pitch[2] << 16 | - win->pitch[1], ®s->v_pitch_uv); - - writel_relaxed((win->ysrc << 16) | win->xsrc, ®s->v_size); - writel_relaxed((win->ydst << 16) | win->xdst, ®s->v_size_z); - writel_relaxed(win->ypos << 16 | win->xpos, ®s->v_start); + writel_relaxed(win->pitch[0], + (void __iomem *)®s->v_pitch_yc); + writel_relaxed(win->pitch[2] << 16 | win->pitch[1], + (void __iomem *)®s->v_pitch_uv); + + writel_relaxed((win->ysrc << 16) | win->xsrc, + (void __iomem *)®s->v_size); + writel_relaxed((win->ydst << 16) | win->xdst, + (void __iomem *)®s->v_size_z); + writel_relaxed(win->ypos << 16 | win->xpos, + (void __iomem *)®s->v_start); } else { - writel_relaxed(win->pitch[0], ®s->g_pitch); - - writel_relaxed((win->ysrc << 16) | win->xsrc, ®s->g_size); - writel_relaxed((win->ydst << 16) | win->xdst, ®s->g_size_z); - writel_relaxed(win->ypos << 16 | win->xpos, ®s->g_start); + writel_relaxed(win->pitch[0], (void __iomem *)®s->g_pitch); + + writel_relaxed((win->ysrc << 16) | win->xsrc, + (void __iomem *)®s->g_size); + writel_relaxed((win->ydst << 16) | win->xdst, + (void __iomem *)®s->g_size_z); + writel_relaxed(win->ypos << 16 | win->xpos, + (void __iomem *)®s->g_start); } dmafetch_set_fmt(overlay); @@ -233,11 +240,11 @@ static int overlay_set_addr(struct mmp_overlay *overlay, struct mmp_addr *addr) memcpy(&overlay->addr, addr, sizeof(struct mmp_addr)); if (overlay_is_vid(overlay)) { - writel_relaxed(addr->phys[0], ®s->v_y0); - writel_relaxed(addr->phys[1], ®s->v_u0); - writel_relaxed(addr->phys[2], ®s->v_v0); + writel_relaxed(addr->phys[0], (void __iomem *)®s->v_y0); + writel_relaxed(addr->phys[1], (void __iomem *)®s->v_u0); + writel_relaxed(addr->phys[2], (void __iomem *)®s->v_v0); } else - writel_relaxed(addr->phys[0], ®s->g_0); + writel_relaxed(addr->phys[0], (void __iomem *)®s->g_0); return overlay->addr.phys[0]; } @@ -268,16 +275,18 @@ static void path_set_mode(struct mmp_path *path, struct mmp_mode *mode) tmp |= dsi_rbswap & CFG_INTFRBSWAP_MASK; writel_relaxed(tmp, ctrl_regs(path) + intf_rbswap_ctrl(path->id)); - writel_relaxed((mode->yres << 16) | mode->xres, ®s->screen_active); + writel_relaxed((mode->yres << 16) | mode->xres, + (void __iomem *)®s->screen_active); writel_relaxed((mode->left_margin << 16) | mode->right_margin, - ®s->screen_h_porch); + (void __iomem *)®s->screen_h_porch); writel_relaxed((mode->upper_margin << 16) | mode->lower_margin, - ®s->screen_v_porch); + (void __iomem *)®s->screen_v_porch); total_x = mode->xres + mode->left_margin + mode->right_margin + mode->hsync_len; total_y = mode->yres + mode->upper_margin + mode->lower_margin + mode->vsync_len; - writel_relaxed((total_y << 16) | total_x, ®s->screen_size); + writel_relaxed((total_y << 16) | total_x, + (void __iomem *)®s->screen_size); /* vsync ctrl */ if (path->output_type == PATH_OUT_DSI) @@ -285,7 +294,7 @@ static void path_set_mode(struct mmp_path *path, struct mmp_mode *mode) else vsync_ctrl = ((mode->xres + mode->right_margin) << 16) | (mode->xres + mode->right_margin); - writel_relaxed(vsync_ctrl, ®s->vsync_ctrl); + writel_relaxed(vsync_ctrl, (void __iomem *)®s->vsync_ctrl); /* set pixclock div */ sclk_src = clk_get_rate(path_to_ctrl(path)->clk); @@ -366,9 +375,9 @@ static void path_set_default(struct mmp_path *path) writel_relaxed(dma_ctrl1, ctrl_regs(path) + dma_ctrl(1, path->id)); /* Configure default register values */ - writel_relaxed(0x00000000, ®s->blank_color); - writel_relaxed(0x00000000, ®s->g_1); - writel_relaxed(0x00000000, ®s->g_start); + writel_relaxed(0x00000000, (void __iomem *)®s->blank_color); + writel_relaxed(0x00000000, (void __iomem *)®s->g_1); + writel_relaxed(0x00000000, (void __iomem *)®s->g_start); /* * 1.enable multiple burst request in DMA AXI diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.h b/drivers/video/fbdev/mmp/hw/mmp_ctrl.h index e9ec45c118fb..335d4983dc52 100644 --- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.h +++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.h @@ -1393,7 +1393,7 @@ struct mmphw_ctrl { /* platform related, get from config */ const char *name; int irq; - void *reg_base; + void __iomem *reg_base; struct clk *clk; /* sys info */ @@ -1429,7 +1429,7 @@ static inline struct mmphw_ctrl *overlay_to_ctrl(struct mmp_overlay *overlay) return path_to_ctrl(overlay->path); } -static inline void *ctrl_regs(struct mmp_path *path) +static inline void __iomem *ctrl_regs(struct mmp_path *path) { return path_to_ctrl(path)->reg_base; } @@ -1438,11 +1438,11 @@ static inline void *ctrl_regs(struct mmp_path *path) static inline struct lcd_regs *path_regs(struct mmp_path *path) { if (path->id == PATH_PN) - return (struct lcd_regs *)(ctrl_regs(path) + 0xc0); + return (struct lcd_regs __force *)(ctrl_regs(path) + 0xc0); else if (path->id == PATH_TV) - return (struct lcd_regs *)ctrl_regs(path); + return (struct lcd_regs __force *)ctrl_regs(path); else if (path->id == PATH_P2) - return (struct lcd_regs *)(ctrl_regs(path) + 0x200); + return (struct lcd_regs __force *)(ctrl_regs(path) + 0x200); else { dev_err(path->dev, "path id %d invalid\n", path->id); BUG_ON(1); diff --git a/drivers/video/fbdev/mmp/hw/mmp_spi.c b/drivers/video/fbdev/mmp/hw/mmp_spi.c index bbb75de5e441..1911a47769b6 100644 --- a/drivers/video/fbdev/mmp/hw/mmp_spi.c +++ b/drivers/video/fbdev/mmp/hw/mmp_spi.c @@ -31,7 +31,7 @@ static inline int lcd_spi_write(struct spi_device *spi, u32 data) { int timeout = 100000, isr, ret = 0; u32 tmp; - void *reg_base = + void __iomem *reg_base = (void __iomem *) *(void **)spi_master_get_devdata(spi->master); /* clear ISR */ @@ -80,7 +80,7 @@ static inline int lcd_spi_write(struct spi_device *spi, u32 data) static int lcd_spi_setup(struct spi_device *spi) { - void *reg_base = + void __iomem *reg_base = (void __iomem *) *(void **)spi_master_get_devdata(spi->master); u32 tmp; @@ -146,7 +146,7 @@ int lcd_spi_register(struct mmphw_ctrl *ctrl) return -ENOMEM; } p_regbase = spi_master_get_devdata(master); - *p_regbase = ctrl->reg_base; + *p_regbase = (void __force *)ctrl->reg_base; /* set bus num to 5 to avoid conflict with other spi hosts */ master->bus_num = 5; -- cgit v1.2.3 From 691f50ab2742556aea467a946e10393da2e8d9ef Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Tue, 27 Aug 2019 11:09:21 +0000 Subject: fbdev: fbmem: allow overriding the number of bootup logos Probably most useful if you want no logo at all, or if you only want one logo regardless of how many CPU cores you have. Signed-off-by: Peter Rosin Reviewed-by: Geert Uytterhoeven Cc: Jonathan Corbet Cc: Matthew Wilcox Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20190827110854.12574-3-peda@axentia.se --- Documentation/fb/fbcon.rst | 5 +++++ drivers/video/fbdev/core/fbcon.c | 7 +++++++ drivers/video/fbdev/core/fbmem.c | 12 +++++++++--- include/linux/fb.h | 1 + 4 files changed, 22 insertions(+), 3 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/Documentation/fb/fbcon.rst b/Documentation/fb/fbcon.rst index 65ba40255137..e57a3d1d085a 100644 --- a/Documentation/fb/fbcon.rst +++ b/Documentation/fb/fbcon.rst @@ -174,6 +174,11 @@ C. Boot options displayed due to multiple CPUs, the collected line of logos is moved as a whole. +9. fbcon=logo-count: + + The value 'n' overrides the number of bootup logos. 0 disables the + logo, and -1 gives the default which is the number of online CPUs. + C. Attaching, Detaching and Unloading Before going on to how to attach, detach and unload the framebuffer console, an diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index c9235a2f42f8..bb6ae995c2e5 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -536,6 +536,13 @@ static int __init fb_console_setup(char *this_opt) fb_center_logo = true; continue; } + + if (!strncmp(options, "logo-count:", 11)) { + options += 11; + if (*options) + fb_logo_count = simple_strtol(options, &options, 0); + continue; + } } return 1; } diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 7ddeb90337bc..7ce21009f85d 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -56,6 +56,8 @@ EXPORT_SYMBOL(num_registered_fb); bool fb_center_logo __read_mostly; EXPORT_SYMBOL(fb_center_logo); +int fb_logo_count __read_mostly = -1; + static struct fb_info *get_fb_info(unsigned int idx) { struct fb_info *fb_info; @@ -620,7 +622,7 @@ int fb_prepare_logo(struct fb_info *info, int rotate) memset(&fb_logo, 0, sizeof(struct logo_data)); if (info->flags & FBINFO_MISC_TILEBLITTING || - info->fbops->owner) + info->fbops->owner || !fb_logo_count) return 0; if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) { @@ -686,10 +688,14 @@ int fb_prepare_logo(struct fb_info *info, int rotate) int fb_show_logo(struct fb_info *info, int rotate) { + unsigned int count; int y; - y = fb_show_logo_line(info, rotate, fb_logo.logo, 0, - num_online_cpus()); + if (!fb_logo_count) + return 0; + + count = fb_logo_count < 0 ? num_online_cpus() : fb_logo_count; + y = fb_show_logo_line(info, rotate, fb_logo.logo, 0, count); y = fb_show_extra_logos(info, y, rotate); return y; diff --git a/include/linux/fb.h b/include/linux/fb.h index 6557fabdea62..3b4b2f0c6994 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -625,6 +625,7 @@ extern int fb_new_modelist(struct fb_info *info); extern struct fb_info *registered_fb[FB_MAX]; extern int num_registered_fb; extern bool fb_center_logo; +extern int fb_logo_count; extern struct class *fb_class; #define for_each_registered_fb(i) \ -- cgit v1.2.3 From ab1c4c5e9d111a867964f4a67d9ab4a564d16b90 Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Tue, 27 Aug 2019 11:09:26 +0000 Subject: fbdev: fbmem: avoid exporting fb_center_logo The variable is only ever used from fbcon.c which is linked into the same module. Therefore, the export is not needed. Signed-off-by: Peter Rosin Reviewed-by: Geert Uytterhoeven Cc: Jonathan Corbet Cc: Matthew Wilcox Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20190827110854.12574-4-peda@axentia.se --- drivers/video/fbdev/core/fbmem.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 7ce21009f85d..5652ec0512ae 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -54,7 +54,6 @@ int num_registered_fb __read_mostly; EXPORT_SYMBOL(num_registered_fb); bool fb_center_logo __read_mostly; -EXPORT_SYMBOL(fb_center_logo); int fb_logo_count __read_mostly = -1; -- cgit v1.2.3 From 3c911fe799d1c338d94b78e7182ad452c37af897 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Sat, 31 Aug 2019 12:00:24 +0200 Subject: pxa168fb: Fix the function used to release some memory in an error handling path In the probe function, some resources are allocated using 'dma_alloc_wc()', they should be released with 'dma_free_wc()', not 'dma_free_coherent()'. We already use 'dma_free_wc()' in the remove function, but not in the error handling path of the probe function. Also, remove a useless 'PAGE_ALIGN()'. 'info->fix.smem_len' is already PAGE_ALIGNed. Fixes: 638772c7553f ("fb: add support of LCD display controller on pxa168/910 (base layer)") Signed-off-by: Christophe JAILLET Reviewed-by: Lubomir Rintel CC: YueHaibing Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20190831100024.3248-1-christophe.jaillet@wanadoo.fr --- drivers/video/fbdev/pxa168fb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/pxa168fb.c b/drivers/video/fbdev/pxa168fb.c index c672c3354a2c..362d3dfe8287 100644 --- a/drivers/video/fbdev/pxa168fb.c +++ b/drivers/video/fbdev/pxa168fb.c @@ -766,8 +766,8 @@ failed_free_cmap: failed_free_clk: clk_disable_unprepare(fbi->clk); failed_free_fbmem: - dma_free_coherent(fbi->dev, info->fix.smem_len, - info->screen_base, fbi->fb_start_dma); + dma_free_wc(fbi->dev, info->fix.smem_len, + info->screen_base, fbi->fb_start_dma); failed_free_info: kfree(info); @@ -801,7 +801,7 @@ static int pxa168fb_remove(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); - dma_free_wc(fbi->dev, PAGE_ALIGN(info->fix.smem_len), + dma_free_wc(fbi->dev, info->fix.smem_len, info->screen_base, info->fix.smem_start); clk_disable_unprepare(fbi->clk); -- cgit v1.2.3 From eaa051a0ca349a725a277ee9cec42ea751e4d57d Mon Sep 17 00:00:00 2001 From: Souptick Joarder Date: Mon, 2 Sep 2019 18:19:04 +0530 Subject: video/fbdev/68328fb: Remove dead code This is dead code since 3.15. If their is no plan to use it further, these can be removed forever. Signed-off-by: Souptick Joarder Cc: Sabyasachi Gupta Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/1567428544-8620-1-git-send-email-jrdr.linux@gmail.com --- drivers/video/fbdev/68328fb.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/68328fb.c b/drivers/video/fbdev/68328fb.c index 491fd5a82993..9811f1bad8d4 100644 --- a/drivers/video/fbdev/68328fb.c +++ b/drivers/video/fbdev/68328fb.c @@ -405,20 +405,8 @@ static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma) int __init mc68x328fb_setup(char *options) { -#if 0 - char *this_opt; -#endif - if (!options || !*options) return 1; -#if 0 - while ((this_opt = strsep(&options, ",")) != NULL) { - if (!*this_opt) - continue; - if (!strncmp(this_opt, "disable", 7)) - mc68x328fb_enable = 0; - } -#endif return 1; } -- cgit v1.2.3 From 1d47d0bb72895e754ffbdc410314ddb9c790c6fa Mon Sep 17 00:00:00 2001 From: YueHaibing Date: Wed, 4 Sep 2019 19:54:06 +0800 Subject: fbdev: omapfb: use devm_platform_ioremap_resource() to simplify code Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing Cc: Thomas Gleixner Cc: Alexios Zavras Cc: Greg Kroah-Hartman Cc: Allison Randal Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20190904115406.23880-1-yuehaibing@huawei.com --- drivers/video/fbdev/omap2/omapfb/vrfb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/omap2/omapfb/vrfb.c b/drivers/video/fbdev/omap2/omapfb/vrfb.c index 819e0bc35b2d..ee0dd4c6a646 100644 --- a/drivers/video/fbdev/omap2/omapfb/vrfb.c +++ b/drivers/video/fbdev/omap2/omapfb/vrfb.c @@ -339,9 +339,7 @@ static int __init vrfb_probe(struct platform_device *pdev) int i; /* first resource is the register res, the rest are vrfb contexts */ - - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - vrfb_base = devm_ioremap_resource(&pdev->dev, mem); + vrfb_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(vrfb_base)) return PTR_ERR(vrfb_base); -- cgit v1.2.3 From 8d5598f13fe7e2e1822825548c7dfcc6c0bb07f4 Mon Sep 17 00:00:00 2001 From: YueHaibing Date: Wed, 4 Sep 2019 19:55:23 +0800 Subject: fbdev: s3c-fb: use devm_platform_ioremap_resource() to simplify code Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing Acked-by: Jingoo Han Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20190904115523.25068-1-yuehaibing@huawei.com --- drivers/video/fbdev/s3c-fb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c index f4871c430f8d..9dc925054930 100644 --- a/drivers/video/fbdev/s3c-fb.c +++ b/drivers/video/fbdev/s3c-fb.c @@ -1411,8 +1411,7 @@ static int s3c_fb_probe(struct platform_device *pdev) pm_runtime_enable(sfb->dev); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - sfb->regs = devm_ioremap_resource(dev, res); + sfb->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(sfb->regs)) { ret = PTR_ERR(sfb->regs); goto err_lcd_clk; -- cgit v1.2.3 From 3149299e105b678bd30df63f07bb4ab54ed0c373 Mon Sep 17 00:00:00 2001 From: YueHaibing Date: Wed, 4 Sep 2019 19:57:54 +0800 Subject: fbdev/sa1100fb: use devm_platform_ioremap_resource() to simplify code Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing Cc: Maarten Lankhorst Cc: Daniel Vetter Cc: Viresh Kumar Cc: "Rafael J. Wysocki" Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20190904115754.21612-1-yuehaibing@huawei.com --- drivers/video/fbdev/sa1100fb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index 4680cc3efb81..5bb653db0cec 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c @@ -1143,7 +1143,6 @@ static struct sa1100fb_info *sa1100fb_init_fbinfo(struct device *dev) static int sa1100fb_probe(struct platform_device *pdev) { struct sa1100fb_info *fbi; - struct resource *res; int ret, irq; if (!dev_get_platdata(&pdev->dev)) { @@ -1159,8 +1158,7 @@ static int sa1100fb_probe(struct platform_device *pdev) if (!fbi) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - fbi->base = devm_ioremap_resource(&pdev->dev, res); + fbi->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(fbi->base)) return PTR_ERR(fbi->base); -- cgit v1.2.3 From 776b0aa9a645804cbae0e9adf7e3556c25707da9 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Fri, 6 Sep 2019 19:11:14 +0100 Subject: fbdev: matrox: make array wtst_xlat static const, makes object smaller Don't populate the array wtst_xlat on the stack but instead make it static const. Makes the object code smaller by 89 bytes. Before: text data bss dec hex filename 14347 840 0 15187 3b53 fbdev/matrox/matroxfb_misc.o After: text data bss dec hex filename 14162 936 0 15098 3afa fbdev/matrox/matroxfb_misc.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King [b.zolnierkie: use u8 while at it (suggested by Ville Syrjälä)] Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20190906181114.31414-1-colin.king@canonical.com --- drivers/video/fbdev/matrox/matroxfb_misc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/matrox/matroxfb_misc.c b/drivers/video/fbdev/matrox/matroxfb_misc.c index c7aaca12805e..8f159a2ad8d0 100644 --- a/drivers/video/fbdev/matrox/matroxfb_misc.c +++ b/drivers/video/fbdev/matrox/matroxfb_misc.c @@ -673,7 +673,10 @@ static int parse_pins5(struct matrox_fb_info *minfo, if (bd->pins[115] & 4) { minfo->values.reg.mctlwtst_core = minfo->values.reg.mctlwtst; } else { - u_int32_t wtst_xlat[] = { 0, 1, 5, 6, 7, 5, 2, 3 }; + static const u8 wtst_xlat[] = { + 0, 1, 5, 6, 7, 5, 2, 3 + }; + minfo->values.reg.mctlwtst_core = (minfo->values.reg.mctlwtst & ~7) | wtst_xlat[minfo->values.reg.mctlwtst & 7]; } -- cgit v1.2.3 From 4a7001f0f4e2362d8040b94764ec321ff57e1a46 Mon Sep 17 00:00:00 2001 From: Gustavo A. R. Silva Date: Wed, 11 Sep 2019 06:36:04 -0500 Subject: video: fbdev: fsl-diu-fb: mark expected switch fall-throughs Mark switch cases where we are expecting to fall through. Fix the following warnings (Building: mpc512x_defconfig powerpc): drivers/video/fbdev/fsl-diu-fb.c: In function ‘fsl_diu_ioctl’: ./include/linux/device.h:1750:2: warning: this statement may fall through [-Wimplicit-fallthrough=] _dev_warn(dev, dev_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/video/fbdev/fsl-diu-fb.c:1287:3: note: in expansion of macro ‘dev_warn’ dev_warn(info->dev, ^~~~~~~~ drivers/video/fbdev/fsl-diu-fb.c:1290:2: note: here case MFB_SET_PIXFMT: ^~~~ In file included from ./include/linux/acpi.h:15:0, from ./include/linux/i2c.h:13, from ./include/uapi/linux/fb.h:6, from ./include/linux/fb.h:6, from drivers/video/fbdev/fsl-diu-fb.c:20: ./include/linux/device.h:1750:2: warning: this statement may fall through [-Wimplicit-fallthrough=] _dev_warn(dev, dev_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/video/fbdev/fsl-diu-fb.c:1296:3: note: in expansion of macro ‘dev_warn’ dev_warn(info->dev, ^~~~~~~~ drivers/video/fbdev/fsl-diu-fb.c:1299:2: note: here case MFB_GET_PIXFMT: ^~~~ Reported-by: kbuild test robot Signed-off-by: Gustavo A. R. Silva Cc: Timur Tabi Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20190911113604.GA31512@embeddedor --- drivers/video/fbdev/fsl-diu-fb.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c index 7cacabdd5f12..67ebfe5c9f1d 100644 --- a/drivers/video/fbdev/fsl-diu-fb.c +++ b/drivers/video/fbdev/fsl-diu-fb.c @@ -1287,6 +1287,7 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd, dev_warn(info->dev, "MFB_SET_PIXFMT value of 0x%08x is deprecated.\n", MFB_SET_PIXFMT_OLD); + /* fall through */ case MFB_SET_PIXFMT: if (copy_from_user(&pix_fmt, buf, sizeof(pix_fmt))) return -EFAULT; @@ -1296,6 +1297,7 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd, dev_warn(info->dev, "MFB_GET_PIXFMT value of 0x%08x is deprecated.\n", MFB_GET_PIXFMT_OLD); + /* fall through */ case MFB_GET_PIXFMT: pix_fmt = ad->pix_fmt; if (copy_to_user(buf, &pix_fmt, sizeof(pix_fmt))) -- cgit v1.2.3 From bc2e7382890b36c8139d728509c1420073aef5a3 Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Thu, 19 Sep 2019 16:26:56 +0200 Subject: video: ocfb: Use devm_platform_ioremap_resource() in ocfb_probe() Simplify this function implementation by using a known wrapper function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Cc: Bartosz Golaszewski Cc: Himanshu Jha Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/61b75aa6-ff92-e0ed-53f2-50a95d93d1f6@web.de --- drivers/video/fbdev/ocfb.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/ocfb.c b/drivers/video/fbdev/ocfb.c index c8cee2d890dc..bfa4ed421148 100644 --- a/drivers/video/fbdev/ocfb.c +++ b/drivers/video/fbdev/ocfb.c @@ -297,7 +297,6 @@ static int ocfb_probe(struct platform_device *pdev) { int ret = 0; struct ocfb_dev *fbdev; - struct resource *res; int fbsize; fbdev = devm_kzalloc(&pdev->dev, sizeof(*fbdev), GFP_KERNEL); @@ -319,13 +318,7 @@ static int ocfb_probe(struct platform_device *pdev) ocfb_init_var(fbdev); ocfb_init_fix(fbdev); - /* Request I/O resource */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "I/O resource request failed\n"); - return -ENXIO; - } - fbdev->regs = devm_ioremap_resource(&pdev->dev, res); + fbdev->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(fbdev->regs)) return PTR_ERR(fbdev->regs); -- cgit v1.2.3 From 7610bca71ea85d6a641533a20302d80d3e63cfac Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Thu, 19 Sep 2019 16:51:38 +0200 Subject: video: pxafb: Use devm_platform_ioremap_resource() in pxafb_probe() Simplify this function implementation by using a known wrapper function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Cc: Daniel Mack Cc: Mauro Carvalho Chehab Cc: "Rafael J. Wysocki" Cc: Viresh Kumar Cc: YueHaibing Cc: Bartosz Golaszewski Cc: Himanshu Jha Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/a1b804b1-43c2-327a-d6d1-df49aebec680@web.de --- drivers/video/fbdev/pxafb.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index 6f7e9fb63190..00b96a78676e 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -2237,7 +2237,6 @@ static int pxafb_probe(struct platform_device *dev) { struct pxafb_info *fbi; struct pxafb_mach_info *inf, *pdata; - struct resource *r; int i, irq, ret; dev_dbg(&dev->dev, "pxafb_probe\n"); @@ -2303,14 +2302,7 @@ static int pxafb_probe(struct platform_device *dev) fbi->lcd_supply = NULL; } - r = platform_get_resource(dev, IORESOURCE_MEM, 0); - if (r == NULL) { - dev_err(&dev->dev, "no I/O memory resource defined\n"); - ret = -ENODEV; - goto failed; - } - - fbi->mmio_base = devm_ioremap_resource(&dev->dev, r); + fbi->mmio_base = devm_platform_ioremap_resource(dev, 0); if (IS_ERR(fbi->mmio_base)) { dev_err(&dev->dev, "failed to get I/O memory\n"); ret = -EBUSY; -- cgit v1.2.3 From 80805774fc354f9ae7755a8e649a01dedfd0dcf8 Mon Sep 17 00:00:00 2001 From: Andrew F. Davis Date: Wed, 16 Oct 2019 14:04:24 -0400 Subject: omapfb/dss: remove unneeded conversions to bool Found with scripts/coccinelle/misc/boolconv.cocci. Signed-off-by: Andrew F. Davis Cc: Jiri Kosina Signed-off-by: Bartlomiej Zolnierkiewicz Link: https://patchwork.freedesktop.org/patch/msgid/20191016180424.23907-1-afd@ti.com --- drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c index 376ee5bc3ddc..ce37da85cc45 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c @@ -1635,7 +1635,7 @@ static void dispc_ovl_set_scaling_uv(enum omap_plane plane, { int scale_x = out_width != orig_width; int scale_y = out_height != orig_height; - bool chroma_upscale = plane != OMAP_DSS_WB ? true : false; + bool chroma_upscale = plane != OMAP_DSS_WB; if (!dss_has_feature(FEAT_HANDLE_UV_SEPARATE)) return; @@ -3100,9 +3100,9 @@ static bool _dispc_mgr_pclk_ok(enum omap_channel channel, unsigned long pclk) { if (dss_mgr_is_lcd(channel)) - return pclk <= dispc.feat->max_lcd_pclk ? true : false; + return pclk <= dispc.feat->max_lcd_pclk; else - return pclk <= dispc.feat->max_tv_pclk ? true : false; + return pclk <= dispc.feat->max_tv_pclk; } bool dispc_mgr_timings_ok(enum omap_channel channel, -- cgit v1.2.3 From 2ec1431ffac9f891a11ac955a9ee914e0547215e Mon Sep 17 00:00:00 2001 From: kbuild test robot Date: Sat, 4 Jan 2020 21:43:31 +0100 Subject: video: fbdev: mmp: fix platform_get_irq.cocci warnings Remove dev_err() messages after platform_get_irq*() failures. Line 450 is redundant because platform_get_irq() already prints an error. Generated by: scripts/coccinelle/api/platform_get_irq.cocci Fixes: dd90e9ae55a1 ("video: fbdev: mmp: add COMPILE_TEST support") Signed-off-by: kbuild test robot Signed-off-by: Julia Lawall Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/alpine.DEB.2.21.2001042140310.6944@hadrien --- drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/video/fbdev') diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c index b877a606ce26..88c137f5c729 100644 --- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c +++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c @@ -456,7 +456,6 @@ static int mmphw_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) { - dev_err(&pdev->dev, "%s: no IRQ defined\n", __func__); ret = -ENOENT; goto failed; } -- cgit v1.2.3