Commit 46ffbe20 authored by Fabian Frederick's avatar Fabian Frederick Committed by Tomi Valkeinen

video: fbdev: cyber2000fb.c: use container_of to resolve cfb_info from fb_info

Use container_of instead of casting first structure member.
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent c4e42323
...@@ -159,7 +159,7 @@ cyber2000_seqw(unsigned int reg, unsigned int val, struct cfb_info *cfb) ...@@ -159,7 +159,7 @@ cyber2000_seqw(unsigned int reg, unsigned int val, struct cfb_info *cfb)
static void static void
cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{ {
struct cfb_info *cfb = (struct cfb_info *)info; struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
unsigned long dst, col; unsigned long dst, col;
if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) { if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) {
...@@ -191,7 +191,7 @@ cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) ...@@ -191,7 +191,7 @@ cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
static void static void
cyber2000fb_copyarea(struct fb_info *info, const struct fb_copyarea *region) cyber2000fb_copyarea(struct fb_info *info, const struct fb_copyarea *region)
{ {
struct cfb_info *cfb = (struct cfb_info *)info; struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
unsigned int cmd = CO_CMD_L_PATTERN_FGCOL; unsigned int cmd = CO_CMD_L_PATTERN_FGCOL;
unsigned long src, dst; unsigned long src, dst;
...@@ -241,7 +241,7 @@ cyber2000fb_imageblit(struct fb_info *info, const struct fb_image *image) ...@@ -241,7 +241,7 @@ cyber2000fb_imageblit(struct fb_info *info, const struct fb_image *image)
static int cyber2000fb_sync(struct fb_info *info) static int cyber2000fb_sync(struct fb_info *info)
{ {
struct cfb_info *cfb = (struct cfb_info *)info; struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
int count = 100000; int count = 100000;
if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT))
...@@ -276,7 +276,7 @@ static int ...@@ -276,7 +276,7 @@ static int
cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info) u_int transp, struct fb_info *info)
{ {
struct cfb_info *cfb = (struct cfb_info *)info; struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
struct fb_var_screeninfo *var = &cfb->fb.var; struct fb_var_screeninfo *var = &cfb->fb.var;
u32 pseudo_val; u32 pseudo_val;
int ret = 1; int ret = 1;
...@@ -758,7 +758,7 @@ cyber2000fb_decode_clock(struct par_info *hw, struct cfb_info *cfb, ...@@ -758,7 +758,7 @@ cyber2000fb_decode_clock(struct par_info *hw, struct cfb_info *cfb,
static int static int
cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{ {
struct cfb_info *cfb = (struct cfb_info *)info; struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
struct par_info hw; struct par_info hw;
unsigned int mem; unsigned int mem;
int err; int err;
...@@ -861,7 +861,7 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -861,7 +861,7 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
static int cyber2000fb_set_par(struct fb_info *info) static int cyber2000fb_set_par(struct fb_info *info)
{ {
struct cfb_info *cfb = (struct cfb_info *)info; struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
struct fb_var_screeninfo *var = &cfb->fb.var; struct fb_var_screeninfo *var = &cfb->fb.var;
struct par_info hw; struct par_info hw;
unsigned int mem; unsigned int mem;
...@@ -971,7 +971,7 @@ static int cyber2000fb_set_par(struct fb_info *info) ...@@ -971,7 +971,7 @@ static int cyber2000fb_set_par(struct fb_info *info)
static int static int
cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
{ {
struct cfb_info *cfb = (struct cfb_info *)info; struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
if (cyber2000fb_update_start(cfb, var)) if (cyber2000fb_update_start(cfb, var))
return -EINVAL; return -EINVAL;
...@@ -1007,7 +1007,7 @@ cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -1007,7 +1007,7 @@ cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
*/ */
static int cyber2000fb_blank(int blank, struct fb_info *info) static int cyber2000fb_blank(int blank, struct fb_info *info)
{ {
struct cfb_info *cfb = (struct cfb_info *)info; struct cfb_info *cfb = container_of(info, struct cfb_info, fb);
unsigned int sync = 0; unsigned int sync = 0;
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment