diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-08-02 13:56:04 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-08-11 10:49:21 +0200 |
commit | 0469901ea4beaa4a326ffcc9b1d6b5baf9738a42 (patch) | |
tree | 9b4a432e0216c12ac8cbf49374192c504c35a56e /drivers/gpu/drm/drm_drv.c | |
parent | 2e45eeac7c1f80a90768e667545591a1e25ff288 (diff) | |
download | linux-0469901ea4beaa4a326ffcc9b1d6b5baf9738a42.tar.gz linux-0469901ea4beaa4a326ffcc9b1d6b5baf9738a42.tar.bz2 linux-0469901ea4beaa4a326ffcc9b1d6b5baf9738a42.zip |
drm: Clean up drm_dev_unplug
Use drm_dev_unregister to unregister the interfaces, which also allows
us to simplify the open_count == 0 case.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170802115604.12734-5-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 694040a240af..be38ac7050d4 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -381,21 +381,12 @@ static void drm_device_set_unplugged(struct drm_device *dev) */ void drm_dev_unplug(struct drm_device *dev) { - /* for a USB device */ - if (drm_core_check_feature(dev, DRIVER_MODESET)) - drm_modeset_unregister_all(dev); - - drm_minor_unregister(dev, DRM_MINOR_PRIMARY); - drm_minor_unregister(dev, DRM_MINOR_RENDER); - drm_minor_unregister(dev, DRM_MINOR_CONTROL); + drm_dev_unregister(dev); mutex_lock(&drm_global_mutex); - drm_device_set_unplugged(dev); - - if (dev->open_count == 0) { - drm_put_dev(dev); - } + if (dev->open_count == 0) + drm_dev_unref(dev); mutex_unlock(&drm_global_mutex); } EXPORT_SYMBOL(drm_dev_unplug); |