aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-09-17 15:00:16 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-09-30 06:06:00 -0400
commitc4e423239ca7cbc3133e600b61b19fb8669eec57 (patch)
treecbf6098ca08d3ada3f3707d17ba86d007a200f8c
parent21f7c247035e17950f0edda2de767434f82a8886 (diff)
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: Fabian Frederick <fabf@skynet.be> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/fbdev/controlfb.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c
index fdadef979238..080fdd2a70f3 100644
--- a/drivers/video/fbdev/controlfb.c
+++ b/drivers/video/fbdev/controlfb.c
@@ -218,7 +218,8 @@ static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *i
218 */ 218 */
219static int controlfb_set_par (struct fb_info *info) 219static int controlfb_set_par (struct fb_info *info)
220{ 220{
221 struct fb_info_control *p = (struct fb_info_control *) info; 221 struct fb_info_control *p =
222 container_of(info, struct fb_info_control, info);
222 struct fb_par_control par; 223 struct fb_par_control par;
223 int err; 224 int err;
224 225
@@ -258,7 +259,8 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var,
258 struct fb_info *info) 259 struct fb_info *info)
259{ 260{
260 unsigned int xoffset, hstep; 261 unsigned int xoffset, hstep;
261 struct fb_info_control *p = (struct fb_info_control *)info; 262 struct fb_info_control *p =
263 container_of(info, struct fb_info_control, info);
262 struct fb_par_control *par = &p->par; 264 struct fb_par_control *par = &p->par;
263 265
264 /* 266 /*
@@ -309,7 +311,8 @@ static int controlfb_mmap(struct fb_info *info,
309 311
310static int controlfb_blank(int blank_mode, struct fb_info *info) 312static int controlfb_blank(int blank_mode, struct fb_info *info)
311{ 313{
312 struct fb_info_control *p = (struct fb_info_control *) info; 314 struct fb_info_control *p =
315 container_of(info, struct fb_info_control, info);
313 unsigned ctrl; 316 unsigned ctrl;
314 317
315 ctrl = ld_le32(CNTRL_REG(p,ctrl)); 318 ctrl = ld_le32(CNTRL_REG(p,ctrl));
@@ -342,7 +345,8 @@ static int controlfb_blank(int blank_mode, struct fb_info *info)
342static int controlfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, 345static int controlfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
343 u_int transp, struct fb_info *info) 346 u_int transp, struct fb_info *info)
344{ 347{
345 struct fb_info_control *p = (struct fb_info_control *) info; 348 struct fb_info_control *p =
349 container_of(info, struct fb_info_control, info);
346 __u8 r, g, b; 350 __u8 r, g, b;
347 351
348 if (regno > 255) 352 if (regno > 255)
@@ -833,7 +837,8 @@ static int control_var_to_par(struct fb_var_screeninfo *var,
833 unsigned hperiod, hssync, hsblank, hesync, heblank, piped, heq, hlfln, 837 unsigned hperiod, hssync, hsblank, hesync, heblank, piped, heq, hlfln,
834 hserr, vperiod, vssync, vesync, veblank, vsblank, vswin, vewin; 838 hserr, vperiod, vssync, vesync, veblank, vsblank, vswin, vewin;
835 unsigned long pixclock; 839 unsigned long pixclock;
836 struct fb_info_control *p = (struct fb_info_control *) fb_info; 840 struct fb_info_control *p =
841 container_of(fb_info, struct fb_info_control, info);
837 struct control_regvals *r = &par->regvals; 842 struct control_regvals *r = &par->regvals;
838 843
839 switch (var->bits_per_pixel) { 844 switch (var->bits_per_pixel) {