diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2013-10-02 11:23:34 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-10-09 06:38:15 +0200 |
commit | 1bb72532ac260a2d3982b40bdd4c936d779d0d16 (patch) | |
tree | f0ec6e8d7d68fe8dff496f0226ac3837fb3aac3d /drivers/gpu/drm/drm_usb.c | |
parent | drm: kill ->gem_init_object() and friends (diff) | |
download | linux-1bb72532ac260a2d3982b40bdd4c936d779d0d16.tar.xz linux-1bb72532ac260a2d3982b40bdd4c936d779d0d16.zip |
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_usb.c')
-rw-r--r-- | drivers/gpu/drm/drm_usb.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_usb.c b/drivers/gpu/drm/drm_usb.c index 87664723b9ce..34ad8edfe806 100644 --- a/drivers/gpu/drm/drm_usb.c +++ b/drivers/gpu/drm/drm_usb.c @@ -7,18 +7,15 @@ int drm_get_usb_dev(struct usb_interface *interface, struct drm_driver *driver) { struct drm_device *dev; - struct usb_device *usbdev; int ret; DRM_DEBUG("\n"); - dev = kzalloc(sizeof(*dev), GFP_KERNEL); + dev = drm_dev_alloc(driver, &interface->dev); if (!dev) return -ENOMEM; - usbdev = interface_to_usbdev(interface); - dev->usbdev = usbdev; - dev->dev = &interface->dev; + dev->usbdev = interface_to_usbdev(interface); mutex_lock(&drm_global_mutex); |