summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_platform.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-10-02 11:23:34 +0200
committerDave Airlie <airlied@redhat.com>2013-10-09 14:38:15 +1000
commit1bb72532ac260a2d3982b40bdd4c936d779d0d16 (patch)
treef0ec6e8d7d68fe8dff496f0226ac3837fb3aac3d /drivers/gpu/drm/drm_platform.c
parent16eb5f4379b2097438a224381be3b4d9e56ac979 (diff)
drm: add drm_dev_alloc() helper
Instead of managing device allocation+initialization in each bus-driver, we should do that in a central place. drm_fill_in_dev() already does most of it, but also requires the global drm lock for partial AGP device registration. Split both apart so we have a clean device initialization/allocation phase, and a registration phase. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_platform.c')
-rw-r--r--drivers/gpu/drm/drm_platform.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c
index f7a18c6ba4c4..fb2721738a8a 100644
--- a/drivers/gpu/drm/drm_platform.c
+++ b/drivers/gpu/drm/drm_platform.c
@@ -47,12 +47,11 @@ static int drm_get_platform_dev(struct platform_device *platdev,
DRM_DEBUG("\n");
- dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+ dev = drm_dev_alloc(driver, &platdev->dev);
if (!dev)
return -ENOMEM;
dev->platformdev = platdev;
- dev->dev = &platdev->dev;
mutex_lock(&drm_global_mutex);