diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-09-17 15:00:17 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-09-30 06:06:01 -0400 |
commit | 46ffbe20d299bc80a0d4f5c2229c8eaf250a85f3 (patch) | |
tree | 6764d270f76eb98a3bfce419a7c45a8238133491 | |
parent | c4e423239ca7cbc3133e600b61b19fb8669eec57 (diff) |
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: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/video/fbdev/cyber2000fb.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c index b0a950f36970..99acf538a8b8 100644 --- a/drivers/video/fbdev/cyber2000fb.c +++ b/drivers/video/fbdev/cyber2000fb.c | |||
@@ -159,7 +159,7 @@ cyber2000_seqw(unsigned int reg, unsigned int val, struct cfb_info *cfb) | |||
159 | static void | 159 | static void |
160 | cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) | 160 | cyber2000fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) |
161 | { | 161 | { |
162 | struct cfb_info *cfb = (struct cfb_info *)info; | 162 | struct cfb_info *cfb = container_of(info, struct cfb_info, fb); |
163 | unsigned long dst, col; | 163 | unsigned long dst, col; |
164 | 164 | ||
165 | if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) { | 165 | 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 | static void | 191 | static void |
192 | cyber2000fb_copyarea(struct fb_info *info, const struct fb_copyarea *region) | 192 | cyber2000fb_copyarea(struct fb_info *info, const struct fb_copyarea *region) |
193 | { | 193 | { |
194 | struct cfb_info *cfb = (struct cfb_info *)info; | 194 | struct cfb_info *cfb = container_of(info, struct cfb_info, fb); |
195 | unsigned int cmd = CO_CMD_L_PATTERN_FGCOL; | 195 | unsigned int cmd = CO_CMD_L_PATTERN_FGCOL; |
196 | unsigned long src, dst; | 196 | unsigned long src, dst; |
197 | 197 | ||
@@ -241,7 +241,7 @@ cyber2000fb_imageblit(struct fb_info *info, const struct fb_image *image) | |||
241 | 241 | ||
242 | static int cyber2000fb_sync(struct fb_info *info) | 242 | static int cyber2000fb_sync(struct fb_info *info) |
243 | { | 243 | { |
244 | struct cfb_info *cfb = (struct cfb_info *)info; | 244 | struct cfb_info *cfb = container_of(info, struct cfb_info, fb); |
245 | int count = 100000; | 245 | int count = 100000; |
246 | 246 | ||
247 | if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) | 247 | if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) |
@@ -276,7 +276,7 @@ static int | |||
276 | cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | 276 | cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, |
277 | u_int transp, struct fb_info *info) | 277 | u_int transp, struct fb_info *info) |
278 | { | 278 | { |
279 | struct cfb_info *cfb = (struct cfb_info *)info; | 279 | struct cfb_info *cfb = container_of(info, struct cfb_info, fb); |
280 | struct fb_var_screeninfo *var = &cfb->fb.var; | 280 | struct fb_var_screeninfo *var = &cfb->fb.var; |
281 | u32 pseudo_val; | 281 | u32 pseudo_val; |
282 | int ret = 1; | 282 | int ret = 1; |
@@ -758,7 +758,7 @@ cyber2000fb_decode_clock(struct par_info *hw, struct cfb_info *cfb, | |||
758 | static int | 758 | static int |
759 | cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | 759 | cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) |
760 | { | 760 | { |
761 | struct cfb_info *cfb = (struct cfb_info *)info; | 761 | struct cfb_info *cfb = container_of(info, struct cfb_info, fb); |
762 | struct par_info hw; | 762 | struct par_info hw; |
763 | unsigned int mem; | 763 | unsigned int mem; |
764 | int err; | 764 | int err; |
@@ -861,7 +861,7 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
861 | 861 | ||
862 | static int cyber2000fb_set_par(struct fb_info *info) | 862 | static int cyber2000fb_set_par(struct fb_info *info) |
863 | { | 863 | { |
864 | struct cfb_info *cfb = (struct cfb_info *)info; | 864 | struct cfb_info *cfb = container_of(info, struct cfb_info, fb); |
865 | struct fb_var_screeninfo *var = &cfb->fb.var; | 865 | struct fb_var_screeninfo *var = &cfb->fb.var; |
866 | struct par_info hw; | 866 | struct par_info hw; |
867 | unsigned int mem; | 867 | unsigned int mem; |
@@ -971,7 +971,7 @@ static int cyber2000fb_set_par(struct fb_info *info) | |||
971 | static int | 971 | static int |
972 | cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) | 972 | cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) |
973 | { | 973 | { |
974 | struct cfb_info *cfb = (struct cfb_info *)info; | 974 | struct cfb_info *cfb = container_of(info, struct cfb_info, fb); |
975 | 975 | ||
976 | if (cyber2000fb_update_start(cfb, var)) | 976 | if (cyber2000fb_update_start(cfb, var)) |
977 | return -EINVAL; | 977 | return -EINVAL; |
@@ -1007,7 +1007,7 @@ cyber2000fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) | |||
1007 | */ | 1007 | */ |
1008 | static int cyber2000fb_blank(int blank, struct fb_info *info) | 1008 | static int cyber2000fb_blank(int blank, struct fb_info *info) |
1009 | { | 1009 | { |
1010 | struct cfb_info *cfb = (struct cfb_info *)info; | 1010 | struct cfb_info *cfb = container_of(info, struct cfb_info, fb); |
1011 | unsigned int sync = 0; | 1011 | unsigned int sync = 0; |
1012 | int i; | 1012 | int i; |
1013 | 1013 | ||