From: Fabian Frederick Date: Sun, 14 Sep 2014 16:40:17 +0000 (+0200) Subject: drm/nouveau: use container_of to resolve nouveau_fbdev from drm_fb_helper X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=918b7ed423ab7c423efe0e71f7670ff9139d3ee0;p=deliverable%2Flinux.git drm/nouveau: use container_of to resolve nouveau_fbdev from drm_fb_helper Use container_of instead of casting first structure member. Signed-off-by: Fabian Frederick Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index f0ae10ca3ba9..dc1753c368e3 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -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;