diff options
Diffstat (limited to 'drivers/gpu/drm/drm_usb.c')
-rw-r--r-- | drivers/gpu/drm/drm_usb.c | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/drivers/gpu/drm/drm_usb.c b/drivers/gpu/drm/drm_usb.c index 34ad8edfe806..5ef353f77b5a 100644 --- a/drivers/gpu/drm/drm_usb.c +++ b/drivers/gpu/drm/drm_usb.c | |||
@@ -16,45 +16,11 @@ int drm_get_usb_dev(struct usb_interface *interface, | |||
16 | return -ENOMEM; | 16 | return -ENOMEM; |
17 | 17 | ||
18 | dev->usbdev = interface_to_usbdev(interface); | 18 | dev->usbdev = interface_to_usbdev(interface); |
19 | |||
20 | mutex_lock(&drm_global_mutex); | ||
21 | |||
22 | ret = drm_fill_in_dev(dev, NULL, driver); | ||
23 | if (ret) { | ||
24 | printk(KERN_ERR "DRM: Fill_in_dev failed.\n"); | ||
25 | goto err_g1; | ||
26 | } | ||
27 | |||
28 | usb_set_intfdata(interface, dev); | 19 | usb_set_intfdata(interface, dev); |
29 | ret = drm_get_minor(dev, &dev->control, DRM_MINOR_CONTROL); | ||
30 | if (ret) | ||
31 | goto err_g1; | ||
32 | |||
33 | if (drm_core_check_feature(dev, DRIVER_RENDER) && drm_rnodes) { | ||
34 | ret = drm_get_minor(dev, &dev->render, DRM_MINOR_RENDER); | ||
35 | if (ret) | ||
36 | goto err_g11; | ||
37 | } | ||
38 | 20 | ||
39 | ret = drm_get_minor(dev, &dev->primary, DRM_MINOR_LEGACY); | 21 | ret = drm_dev_register(dev, 0); |
40 | if (ret) | 22 | if (ret) |
41 | goto err_g2; | 23 | goto err_free; |
42 | |||
43 | if (dev->driver->load) { | ||
44 | ret = dev->driver->load(dev, 0); | ||
45 | if (ret) | ||
46 | goto err_g3; | ||
47 | } | ||
48 | |||
49 | /* setup the grouping for the legacy output */ | ||
50 | ret = drm_mode_group_init_legacy_group(dev, | ||
51 | &dev->primary->mode_group); | ||
52 | if (ret) | ||
53 | goto err_g3; | ||
54 | |||
55 | list_add_tail(&dev->driver_item, &driver->device_list); | ||
56 | |||
57 | mutex_unlock(&drm_global_mutex); | ||
58 | 24 | ||
59 | DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", | 25 | DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", |
60 | driver->name, driver->major, driver->minor, driver->patchlevel, | 26 | driver->name, driver->major, driver->minor, driver->patchlevel, |
@@ -62,16 +28,8 @@ int drm_get_usb_dev(struct usb_interface *interface, | |||
62 | 28 | ||
63 | return 0; | 29 | return 0; |
64 | 30 | ||
65 | err_g3: | 31 | err_free: |
66 | drm_put_minor(&dev->primary); | ||
67 | err_g2: | ||
68 | if (dev->render) | ||
69 | drm_put_minor(&dev->render); | ||
70 | err_g11: | ||
71 | drm_put_minor(&dev->control); | ||
72 | err_g1: | ||
73 | kfree(dev); | 32 | kfree(dev); |
74 | mutex_unlock(&drm_global_mutex); | ||
75 | return ret; | 33 | return ret; |
76 | 34 | ||
77 | } | 35 | } |