]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/gpu/drm/drm_drv.c
Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm-next
[linux.git] / drivers / gpu / drm / drm_drv.c
index fc29f46b7c326cc14856f70fe01d7a247b781fd6..e2ffecd5e45379c80ed067c93b49215e78c25967 100644 (file)
@@ -476,8 +476,6 @@ static void drm_fs_inode_free(struct inode *inode)
  * The initial ref-count of the object is 1. Use drm_dev_get() and
  * drm_dev_put() to take and drop further ref-counts.
  *
- * Note that for purely virtual devices @parent can be NULL.
- *
  * Drivers that do not want to allocate their own device struct
  * embedding &struct drm_device can call drm_dev_alloc() instead. For drivers
  * that do embed &struct drm_device it must be placed first in the overall
@@ -502,6 +500,8 @@ int drm_dev_init(struct drm_device *dev,
                return -ENODEV;
        }
 
+       BUG_ON(!parent);
+
        kref_init(&dev->ref);
        dev->dev = parent;
        dev->driver = driver;
@@ -556,9 +556,7 @@ int drm_dev_init(struct drm_device *dev,
                }
        }
 
-       /* Use the parent device name as DRM device unique identifier, but fall
-        * back to the driver name for virtual devices like vgem. */
-       ret = drm_dev_set_unique(dev, parent ? dev_name(parent) : driver->name);
+       ret = drm_dev_set_unique(dev, dev_name(parent));
        if (ret)
                goto err_setunique;