Commit c4e42323 authored by Fabian Frederick's avatar Fabian Frederick Committed by Tomi Valkeinen

video: fbdev: controlfb.c: use container_of to resolve fb_info_control 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 21f7c247
...@@ -218,7 +218,8 @@ static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *i ...@@ -218,7 +218,8 @@ static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *i
*/ */
static int controlfb_set_par (struct fb_info *info) static int controlfb_set_par (struct fb_info *info)
{ {
struct fb_info_control *p = (struct fb_info_control *) info; struct fb_info_control *p =
container_of(info, struct fb_info_control, info);
struct fb_par_control par; struct fb_par_control par;
int err; int err;
...@@ -258,7 +259,8 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var, ...@@ -258,7 +259,8 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info) struct fb_info *info)
{ {
unsigned int xoffset, hstep; unsigned int xoffset, hstep;
struct fb_info_control *p = (struct fb_info_control *)info; struct fb_info_control *p =
container_of(info, struct fb_info_control, info);
struct fb_par_control *par = &p->par; struct fb_par_control *par = &p->par;
/* /*
...@@ -309,7 +311,8 @@ static int controlfb_mmap(struct fb_info *info, ...@@ -309,7 +311,8 @@ static int controlfb_mmap(struct fb_info *info,
static int controlfb_blank(int blank_mode, struct fb_info *info) static int controlfb_blank(int blank_mode, struct fb_info *info)
{ {
struct fb_info_control *p = (struct fb_info_control *) info; struct fb_info_control *p =
container_of(info, struct fb_info_control, info);
unsigned ctrl; unsigned ctrl;
ctrl = ld_le32(CNTRL_REG(p,ctrl)); ctrl = ld_le32(CNTRL_REG(p,ctrl));
...@@ -342,7 +345,8 @@ static int controlfb_blank(int blank_mode, struct fb_info *info) ...@@ -342,7 +345,8 @@ static int controlfb_blank(int blank_mode, struct fb_info *info)
static int controlfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, static int controlfb_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 fb_info_control *p = (struct fb_info_control *) info; struct fb_info_control *p =
container_of(info, struct fb_info_control, info);
__u8 r, g, b; __u8 r, g, b;
if (regno > 255) if (regno > 255)
...@@ -833,7 +837,8 @@ static int control_var_to_par(struct fb_var_screeninfo *var, ...@@ -833,7 +837,8 @@ static int control_var_to_par(struct fb_var_screeninfo *var,
unsigned hperiod, hssync, hsblank, hesync, heblank, piped, heq, hlfln, unsigned hperiod, hssync, hsblank, hesync, heblank, piped, heq, hlfln,
hserr, vperiod, vssync, vesync, veblank, vsblank, vswin, vewin; hserr, vperiod, vssync, vesync, veblank, vsblank, vswin, vewin;
unsigned long pixclock; unsigned long pixclock;
struct fb_info_control *p = (struct fb_info_control *) fb_info; struct fb_info_control *p =
container_of(fb_info, struct fb_info_control, info);
struct control_regvals *r = &par->regvals; struct control_regvals *r = &par->regvals;
switch (var->bits_per_pixel) { switch (var->bits_per_pixel) {
......
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