]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/nouveau: use container_of to resolve nouveau_fbdev from drm_fb_helper
authorFabian Frederick <fabf@skynet.be>
Sun, 14 Sep 2014 16:40:17 +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/nouveau/nouveau_fbcon.c

index f0ae10ca3ba9d1446f42689eaec7061626f2db49..dc1753c368e3096a46929ea6dda35a46ed0b9e2e 100644 (file)
@@ -308,7 +308,8 @@ static int
 nouveau_fbcon_create(struct drm_fb_helper *helper,
                     struct drm_fb_helper_surface_size *sizes)
 {
-       struct nouveau_fbdev *fbcon = (struct nouveau_fbdev *)helper;
+       struct nouveau_fbdev *fbcon =
+               container_of(helper, struct nouveau_fbdev, helper);
        struct drm_device *dev = fbcon->dev;
        struct nouveau_drm *drm = nouveau_drm(dev);
        struct nvif_device *device = &drm->device;