diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-09-17 15:00:19 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-09-30 06:06:01 -0400 |
commit | 8251434bb489f4bf7fbc1825fb212051d0a030ea (patch) | |
tree | dd303cdbd5a525f6d2253571e680ba8ffdbfedd1 | |
parent | 29ebebb4b525ca080e0758e7445c416927dd4eeb (diff) |
video: fbdev: valkyriefb.c: use container_of to resolve fb_info_valkyrie 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/valkyriefb.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/video/fbdev/valkyriefb.c b/drivers/video/fbdev/valkyriefb.c index b6ed09f16355..275fb98236d3 100644 --- a/drivers/video/fbdev/valkyriefb.c +++ b/drivers/video/fbdev/valkyriefb.c | |||
@@ -136,7 +136,8 @@ static struct fb_ops valkyriefb_ops = { | |||
136 | /* Sets the video mode according to info->var */ | 136 | /* Sets the video mode according to info->var */ |
137 | static int valkyriefb_set_par(struct fb_info *info) | 137 | static int valkyriefb_set_par(struct fb_info *info) |
138 | { | 138 | { |
139 | struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info; | 139 | struct fb_info_valkyrie *p = |
140 | container_of(info, struct fb_info_valkyrie, info); | ||
140 | volatile struct valkyrie_regs __iomem *valkyrie_regs = p->valkyrie_regs; | 141 | volatile struct valkyrie_regs __iomem *valkyrie_regs = p->valkyrie_regs; |
141 | struct fb_par_valkyrie *par = info->par; | 142 | struct fb_par_valkyrie *par = info->par; |
142 | struct valkyrie_regvals *init; | 143 | struct valkyrie_regvals *init; |
@@ -194,7 +195,8 @@ valkyriefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
194 | */ | 195 | */ |
195 | static int valkyriefb_blank(int blank_mode, struct fb_info *info) | 196 | static int valkyriefb_blank(int blank_mode, struct fb_info *info) |
196 | { | 197 | { |
197 | struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info; | 198 | struct fb_info_valkyrie *p = |
199 | container_of(info, struct fb_info_valkyrie, info); | ||
198 | struct fb_par_valkyrie *par = info->par; | 200 | struct fb_par_valkyrie *par = info->par; |
199 | struct valkyrie_regvals *init = par->init; | 201 | struct valkyrie_regvals *init = par->init; |
200 | 202 | ||
@@ -226,7 +228,8 @@ static int valkyriefb_blank(int blank_mode, struct fb_info *info) | |||
226 | static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | 228 | static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, |
227 | u_int transp, struct fb_info *info) | 229 | u_int transp, struct fb_info *info) |
228 | { | 230 | { |
229 | struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) info; | 231 | struct fb_info_valkyrie *p = |
232 | container_of(info, struct fb_info_valkyrie, info); | ||
230 | volatile struct cmap_regs __iomem *cmap_regs = p->cmap_regs; | 233 | volatile struct cmap_regs __iomem *cmap_regs = p->cmap_regs; |
231 | struct fb_par_valkyrie *par = info->par; | 234 | struct fb_par_valkyrie *par = info->par; |
232 | 235 | ||
@@ -465,7 +468,8 @@ static int valkyrie_var_to_par(struct fb_var_screeninfo *var, | |||
465 | { | 468 | { |
466 | int vmode, cmode; | 469 | int vmode, cmode; |
467 | struct valkyrie_regvals *init; | 470 | struct valkyrie_regvals *init; |
468 | struct fb_info_valkyrie *p = (struct fb_info_valkyrie *) fb_info; | 471 | struct fb_info_valkyrie *p = |
472 | container_of(fb_info, struct fb_info_valkyrie, info); | ||
469 | 473 | ||
470 | if (mac_var_to_vmode(var, &vmode, &cmode) != 0) { | 474 | if (mac_var_to_vmode(var, &vmode, &cmode) != 0) { |
471 | printk(KERN_ERR "valkyriefb: can't do %dx%dx%d.\n", | 475 | printk(KERN_ERR "valkyriefb: can't do %dx%dx%d.\n", |