diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-09-17 15:00:15 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-09-30 06:06:00 -0400 |
commit | 21f7c247035e17950f0edda2de767434f82a8886 (patch) | |
tree | 4bbacde06d31477f668bd2f7e005527db7458c8d | |
parent | 1f17a0fa681326f726505f5a662caf07f0d098e2 (diff) |
video: fbdev: sa1100fb.c: use container_of to resolve sa1100fb_info 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/sa1100fb.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index 580c444ec301..9690216d38ff 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c | |||
@@ -268,7 +268,8 @@ static int | |||
268 | sa1100fb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue, | 268 | sa1100fb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue, |
269 | u_int trans, struct fb_info *info) | 269 | u_int trans, struct fb_info *info) |
270 | { | 270 | { |
271 | struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; | 271 | struct sa1100fb_info *fbi = |
272 | container_of(info, struct sa1100fb_info, fb); | ||
272 | u_int val, ret = 1; | 273 | u_int val, ret = 1; |
273 | 274 | ||
274 | if (regno < fbi->palette_size) { | 275 | if (regno < fbi->palette_size) { |
@@ -289,7 +290,8 @@ static int | |||
289 | sa1100fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | 290 | sa1100fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, |
290 | u_int trans, struct fb_info *info) | 291 | u_int trans, struct fb_info *info) |
291 | { | 292 | { |
292 | struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; | 293 | struct sa1100fb_info *fbi = |
294 | container_of(info, struct sa1100fb_info, fb); | ||
293 | unsigned int val; | 295 | unsigned int val; |
294 | int ret = 1; | 296 | int ret = 1; |
295 | 297 | ||
@@ -366,7 +368,8 @@ static inline unsigned int sa1100fb_display_dma_period(struct fb_var_screeninfo | |||
366 | static int | 368 | static int |
367 | sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | 369 | sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) |
368 | { | 370 | { |
369 | struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; | 371 | struct sa1100fb_info *fbi = |
372 | container_of(info, struct sa1100fb_info, fb); | ||
370 | int rgbidx; | 373 | int rgbidx; |
371 | 374 | ||
372 | if (var->xres < MIN_XRES) | 375 | if (var->xres < MIN_XRES) |
@@ -433,7 +436,8 @@ static void sa1100fb_set_visual(struct sa1100fb_info *fbi, u32 visual) | |||
433 | */ | 436 | */ |
434 | static int sa1100fb_set_par(struct fb_info *info) | 437 | static int sa1100fb_set_par(struct fb_info *info) |
435 | { | 438 | { |
436 | struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; | 439 | struct sa1100fb_info *fbi = |
440 | container_of(info, struct sa1100fb_info, fb); | ||
437 | struct fb_var_screeninfo *var = &info->var; | 441 | struct fb_var_screeninfo *var = &info->var; |
438 | unsigned long palette_mem_size; | 442 | unsigned long palette_mem_size; |
439 | 443 | ||
@@ -526,7 +530,8 @@ sa1100fb_set_cmap(struct fb_cmap *cmap, int kspc, int con, | |||
526 | */ | 530 | */ |
527 | static int sa1100fb_blank(int blank, struct fb_info *info) | 531 | static int sa1100fb_blank(int blank, struct fb_info *info) |
528 | { | 532 | { |
529 | struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; | 533 | struct sa1100fb_info *fbi = |
534 | container_of(info, struct sa1100fb_info, fb); | ||
530 | int i; | 535 | int i; |
531 | 536 | ||
532 | dev_dbg(fbi->dev, "sa1100fb_blank: blank=%d\n", blank); | 537 | dev_dbg(fbi->dev, "sa1100fb_blank: blank=%d\n", blank); |
@@ -555,7 +560,8 @@ static int sa1100fb_blank(int blank, struct fb_info *info) | |||
555 | static int sa1100fb_mmap(struct fb_info *info, | 560 | static int sa1100fb_mmap(struct fb_info *info, |
556 | struct vm_area_struct *vma) | 561 | struct vm_area_struct *vma) |
557 | { | 562 | { |
558 | struct sa1100fb_info *fbi = (struct sa1100fb_info *)info; | 563 | struct sa1100fb_info *fbi = |
564 | container_of(info, struct sa1100fb_info, fb); | ||
559 | unsigned long off = vma->vm_pgoff << PAGE_SHIFT; | 565 | unsigned long off = vma->vm_pgoff << PAGE_SHIFT; |
560 | 566 | ||
561 | if (off < info->fix.smem_len) { | 567 | if (off < info->fix.smem_len) { |