summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-08-06 13:58:58 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2023-08-28 09:44:06 +0200
commit17397471d80ec0aa058d3cd1767aca8caa7e291f (patch)
tree76795762c2501e4be3f9896368f3af62b47d60ea
parent6e4241347b656e43c73ce6ebfb5f2961f0cdf4a0 (diff)
downloadlinux-stable-17397471d80ec0aa058d3cd1767aca8caa7e291f.tar.gz
linux-stable-17397471d80ec0aa058d3cd1767aca8caa7e291f.tar.bz2
linux-stable-17397471d80ec0aa058d3cd1767aca8caa7e291f.zip
fbdev/cg6: Use initializer macro for struct fb_ops
Initialize struct fb_ops to the correct default values with the internal __FB_DEFAULT_SBUS_OPS_*() macros. Rename the ioctl and mmap callbacks to use the infix _sbusfb_. This makes them fit the SBUS helpers' naming pattern. It is not possible to use set all defaults via FB_DEAFULT_SBUS_OPS(), as cg6 provides its own implementation of fb_fillrect, fb_copyarea, and fb_imageblit. Hence we also avoid FB_SBUS_HELPERS, but let the driver select its dependencies individually instead. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-8-tzimmermann@suse.de
-rw-r--r--drivers/video/fbdev/cg6.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/video/fbdev/cg6.c b/drivers/video/fbdev/cg6.c
index e6cb55be7d8b..894907045789 100644
--- a/drivers/video/fbdev/cg6.c
+++ b/drivers/video/fbdev/cg6.c
@@ -36,16 +36,18 @@ static void cg6_imageblit(struct fb_info *, const struct fb_image *);
static void cg6_fillrect(struct fb_info *, const struct fb_fillrect *);
static void cg6_copyarea(struct fb_info *info, const struct fb_copyarea *area);
static int cg6_sync(struct fb_info *);
-static int cg6_mmap(struct fb_info *, struct vm_area_struct *);
-static int cg6_ioctl(struct fb_info *, unsigned int, unsigned long);
static int cg6_pan_display(struct fb_var_screeninfo *, struct fb_info *);
+static int cg6_sbusfb_mmap(struct fb_info *info, struct vm_area_struct *vma);
+static int cg6_sbusfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg);
+
/*
* Frame buffer operations
*/
static const struct fb_ops cg6_ops = {
.owner = THIS_MODULE,
+ __FB_DEFAULT_SBUS_OPS_RDWR(cg6),
.fb_setcolreg = cg6_setcolreg,
.fb_blank = cg6_blank,
.fb_pan_display = cg6_pan_display,
@@ -53,11 +55,8 @@ static const struct fb_ops cg6_ops = {
.fb_copyarea = cg6_copyarea,
.fb_imageblit = cg6_imageblit,
.fb_sync = cg6_sync,
- .fb_mmap = cg6_mmap,
- .fb_ioctl = cg6_ioctl,
-#ifdef CONFIG_COMPAT
- .fb_compat_ioctl = sbusfb_compat_ioctl,
-#endif
+ __FB_DEFAULT_SBUS_OPS_IOCTL(cg6),
+ __FB_DEFAULT_SBUS_OPS_MMAP(cg6),
};
/* Offset of interesting structures in the OBIO space */
@@ -589,7 +588,7 @@ static struct sbus_mmap_map cg6_mmap_map[] = {
{ .size = 0 }
};
-static int cg6_mmap(struct fb_info *info, struct vm_area_struct *vma)
+static int cg6_sbusfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
struct cg6_par *par = (struct cg6_par *)info->par;
@@ -598,7 +597,7 @@ static int cg6_mmap(struct fb_info *info, struct vm_area_struct *vma)
par->which_io, vma);
}
-static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
+static int cg6_sbusfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
{
return sbusfb_ioctl_helper(cmd, arg, info,
FBTYPE_SUNFAST_COLOR, 8, info->fix.smem_len);