diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-09-17 15:00:18 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-09-30 06:06:01 -0400 |
commit | 29ebebb4b525ca080e0758e7445c416927dd4eeb (patch) | |
tree | decc37404effdb96ea9cd56da17d6290dfef185f /drivers/video/fbdev | |
parent | 46ffbe20d299bc80a0d4f5c2229c8eaf250a85f3 (diff) |
video: fbdev: pxafb.c: use container_of to resolve pxafb_info/layer 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>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r-- | drivers/video/fbdev/pxafb.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index 1ecd9cec2921..a5acca88fa63 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c | |||
@@ -138,7 +138,7 @@ static int | |||
138 | pxafb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue, | 138 | pxafb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue, |
139 | u_int trans, struct fb_info *info) | 139 | u_int trans, struct fb_info *info) |
140 | { | 140 | { |
141 | struct pxafb_info *fbi = (struct pxafb_info *)info; | 141 | struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); |
142 | u_int val; | 142 | u_int val; |
143 | 143 | ||
144 | if (regno >= fbi->palette_size) | 144 | if (regno >= fbi->palette_size) |
@@ -183,7 +183,7 @@ static int | |||
183 | pxafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | 183 | pxafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, |
184 | u_int trans, struct fb_info *info) | 184 | u_int trans, struct fb_info *info) |
185 | { | 185 | { |
186 | struct pxafb_info *fbi = (struct pxafb_info *)info; | 186 | struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); |
187 | unsigned int val; | 187 | unsigned int val; |
188 | int ret = 1; | 188 | int ret = 1; |
189 | 189 | ||
@@ -456,7 +456,7 @@ static int pxafb_adjust_timing(struct pxafb_info *fbi, | |||
456 | */ | 456 | */ |
457 | static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | 457 | static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) |
458 | { | 458 | { |
459 | struct pxafb_info *fbi = (struct pxafb_info *)info; | 459 | struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); |
460 | struct pxafb_mach_info *inf = dev_get_platdata(fbi->dev); | 460 | struct pxafb_mach_info *inf = dev_get_platdata(fbi->dev); |
461 | int err; | 461 | int err; |
462 | 462 | ||
@@ -494,7 +494,7 @@ static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
494 | */ | 494 | */ |
495 | static int pxafb_set_par(struct fb_info *info) | 495 | static int pxafb_set_par(struct fb_info *info) |
496 | { | 496 | { |
497 | struct pxafb_info *fbi = (struct pxafb_info *)info; | 497 | struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); |
498 | struct fb_var_screeninfo *var = &info->var; | 498 | struct fb_var_screeninfo *var = &info->var; |
499 | 499 | ||
500 | if (var->bits_per_pixel >= 16) | 500 | if (var->bits_per_pixel >= 16) |
@@ -533,7 +533,7 @@ static int pxafb_set_par(struct fb_info *info) | |||
533 | static int pxafb_pan_display(struct fb_var_screeninfo *var, | 533 | static int pxafb_pan_display(struct fb_var_screeninfo *var, |
534 | struct fb_info *info) | 534 | struct fb_info *info) |
535 | { | 535 | { |
536 | struct pxafb_info *fbi = (struct pxafb_info *)info; | 536 | struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); |
537 | struct fb_var_screeninfo newvar; | 537 | struct fb_var_screeninfo newvar; |
538 | int dma = DMA_MAX + DMA_BASE; | 538 | int dma = DMA_MAX + DMA_BASE; |
539 | 539 | ||
@@ -566,7 +566,7 @@ static int pxafb_pan_display(struct fb_var_screeninfo *var, | |||
566 | */ | 566 | */ |
567 | static int pxafb_blank(int blank, struct fb_info *info) | 567 | static int pxafb_blank(int blank, struct fb_info *info) |
568 | { | 568 | { |
569 | struct pxafb_info *fbi = (struct pxafb_info *)info; | 569 | struct pxafb_info *fbi = container_of(info, struct pxafb_info, fb); |
570 | int i; | 570 | int i; |
571 | 571 | ||
572 | switch (blank) { | 572 | switch (blank) { |
@@ -725,7 +725,7 @@ static struct pxafb_layer_ops ofb_ops[] = { | |||
725 | 725 | ||
726 | static int overlayfb_open(struct fb_info *info, int user) | 726 | static int overlayfb_open(struct fb_info *info, int user) |
727 | { | 727 | { |
728 | struct pxafb_layer *ofb = (struct pxafb_layer *)info; | 728 | struct pxafb_layer *ofb = container_of(info, struct pxafb_layer, fb); |
729 | 729 | ||
730 | /* no support for framebuffer console on overlay */ | 730 | /* no support for framebuffer console on overlay */ |
731 | if (user == 0) | 731 | if (user == 0) |
@@ -743,7 +743,7 @@ static int overlayfb_open(struct fb_info *info, int user) | |||
743 | 743 | ||
744 | static int overlayfb_release(struct fb_info *info, int user) | 744 | static int overlayfb_release(struct fb_info *info, int user) |
745 | { | 745 | { |
746 | struct pxafb_layer *ofb = (struct pxafb_layer*) info; | 746 | struct pxafb_layer *ofb = container_of(info, struct pxafb_layer, fb); |
747 | 747 | ||
748 | if (ofb->usage == 1) { | 748 | if (ofb->usage == 1) { |
749 | ofb->ops->disable(ofb); | 749 | ofb->ops->disable(ofb); |
@@ -760,7 +760,7 @@ static int overlayfb_release(struct fb_info *info, int user) | |||
760 | static int overlayfb_check_var(struct fb_var_screeninfo *var, | 760 | static int overlayfb_check_var(struct fb_var_screeninfo *var, |
761 | struct fb_info *info) | 761 | struct fb_info *info) |
762 | { | 762 | { |
763 | struct pxafb_layer *ofb = (struct pxafb_layer *)info; | 763 | struct pxafb_layer *ofb = container_of(info, struct pxafb_layer, fb); |
764 | struct fb_var_screeninfo *base_var = &ofb->fbi->fb.var; | 764 | struct fb_var_screeninfo *base_var = &ofb->fbi->fb.var; |
765 | int xpos, ypos, pfor, bpp; | 765 | int xpos, ypos, pfor, bpp; |
766 | 766 | ||
@@ -836,7 +836,7 @@ static int overlayfb_check_video_memory(struct pxafb_layer *ofb) | |||
836 | 836 | ||
837 | static int overlayfb_set_par(struct fb_info *info) | 837 | static int overlayfb_set_par(struct fb_info *info) |
838 | { | 838 | { |
839 | struct pxafb_layer *ofb = (struct pxafb_layer *)info; | 839 | struct pxafb_layer *ofb = container_of(info, struct pxafb_layer, fb); |
840 | struct fb_var_screeninfo *var = &info->var; | 840 | struct fb_var_screeninfo *var = &info->var; |
841 | int xpos, ypos, pfor, bpp, ret; | 841 | int xpos, ypos, pfor, bpp, ret; |
842 | 842 | ||