drm/radeon: use container_of to resolve radeon_fbdev from drm_fb_helper
authorFabian Frederick <fabf@skynet.be>
Sun, 14 Sep 2014 16:40:16 +0000 (18:40 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 24 Sep 2014 10:09:25 +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/radeon/radeon_fb.c

index 94b0f2aa3d7c870b41bdf28be5d7bca5fecf4ff2..0ea1db83d57390e70874f3182893b277b56c6f94 100644 (file)
@@ -189,7 +189,8 @@ out_unref:
 static int radeonfb_create(struct drm_fb_helper *helper,
                           struct drm_fb_helper_surface_size *sizes)
 {
-       struct radeon_fbdev *rfbdev = (struct radeon_fbdev *)helper;
+       struct radeon_fbdev *rfbdev =
+               container_of(helper, struct radeon_fbdev, helper);
        struct radeon_device *rdev = rfbdev->rdev;
        struct fb_info *info;
        struct drm_framebuffer *fb = NULL;