Commit 98cc0343 authored by Fabian Frederick's avatar Fabian Frederick Committed by Daniel Vetter

drm/mgag200: use container_of to resolve mga_fbdev from drm_fb_helper

Use container_of instead of casting first structure member.
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent ea0622cf
......@@ -158,7 +158,8 @@ static int mgag200fb_create_object(struct mga_fbdev *afbdev,
static int mgag200fb_create(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes)
{
struct mga_fbdev *mfbdev = (struct mga_fbdev *)helper;
struct mga_fbdev *mfbdev =
container_of(helper, struct mga_fbdev, helper);
struct drm_device *dev = mfbdev->helper.dev;
struct drm_mode_fb_cmd2 mode_cmd;
struct mga_device *mdev = dev->dev_private;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment