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

index d1da339843cafb263b21030bc546b5f3d285b394..8cbcb4589bd34db8fd35e8186eed1700dd9ba8cb 100644 (file)
@@ -472,7 +472,8 @@ udl_framebuffer_init(struct drm_device *dev,
 static int udlfb_create(struct drm_fb_helper *helper,
                        struct drm_fb_helper_surface_size *sizes)
 {
-       struct udl_fbdev *ufbdev = (struct udl_fbdev *)helper;
+       struct udl_fbdev *ufbdev =
+               container_of(helper, struct udl_fbdev, helper);
        struct drm_device *dev = ufbdev->helper.dev;
        struct fb_info *info;
        struct device *device = dev->dev;