drm/gma500: use container_of to resolve psb_fbdev from drm_fb_helper
authorFabian Frederick <fabf@skynet.be>
Sun, 14 Sep 2014 16:40:20 +0000 (18:40 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 24 Sep 2014 10:09:27 +0000 (12:09 +0200)
Use container_of instead of casting first structure member.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/gma500/framebuffer.c

index d0dd3bea8aa5a1a2d98b2505139f07dc1db57715..ddd90ddbc20097d7325379d7cf77d516854d60f6 100644 (file)
@@ -540,7 +540,8 @@ static void psbfb_gamma_get(struct drm_crtc *crtc, u16 *red,
 static int psbfb_probe(struct drm_fb_helper *helper,
                                struct drm_fb_helper_surface_size *sizes)
 {
-       struct psb_fbdev *psb_fbdev = (struct psb_fbdev *)helper;
+       struct psb_fbdev *psb_fbdev =
+               container_of(helper, struct psb_fbdev, psb_fb_helper);
        struct drm_device *dev = psb_fbdev->psb_fb_helper.dev;
        struct drm_psb_private *dev_priv = dev->dev_private;
        int bytespp;