diff options
author | Christopher Harvey <charvey@matrox.com> | 2013-04-05 20:15:30 +0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-04-12 08:07:27 +0400 |
commit | c2ed8844246dd4c46208c5f6fa79fd3cfcc671ca (patch) | |
tree | 6e367f0a2993cf2d286de5ad6f810eec0fcfa8ad /drivers/gpu/drm/mgag200/mgag200_fb.c | |
parent | 715f59cc2391cb4e28a4d464a0564a60a00ecca4 (diff) | |
download | linux-c2ed8844246dd4c46208c5f6fa79fd3cfcc671ca.tar.xz |
drm/mgag200: Convert to managed device resources where possible
Signed-off-by: Christopher Harvey <charvey@matrox.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/mgag200/mgag200_fb.c')
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_fb.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c index d2253f639481..2ebe0f635b26 100644 --- a/drivers/gpu/drm/mgag200/mgag200_fb.c +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c @@ -249,7 +249,7 @@ int mgag200_fbdev_init(struct mga_device *mdev) struct mga_fbdev *mfbdev; int ret; - mfbdev = kzalloc(sizeof(struct mga_fbdev), GFP_KERNEL); + mfbdev = devm_kzalloc(mdev->dev->dev, sizeof(struct mga_fbdev), GFP_KERNEL); if (!mfbdev) return -ENOMEM; @@ -258,10 +258,9 @@ int mgag200_fbdev_init(struct mga_device *mdev) ret = drm_fb_helper_init(mdev->dev, &mfbdev->helper, mdev->num_crtc, MGAG200FB_CONN_LIMIT); - if (ret) { - kfree(mfbdev); + if (ret) return ret; - } + drm_fb_helper_single_add_all_connectors(&mfbdev->helper); /* disable all the possible outputs/crtcs before entering KMS mode */ @@ -278,6 +277,4 @@ void mgag200_fbdev_fini(struct mga_device *mdev) return; mga_fbdev_destroy(mdev->dev, mdev->mfbdev); - kfree(mdev->mfbdev); - mdev->mfbdev = NULL; } |