drm/drv: drm_dev_unplug(): Move out drm_dev_put() call
authorNoralf Trønnes <noralf@tronnes.org>
Fri, 8 Feb 2019 14:01:03 +0000 (15:01 +0100)
committerNoralf Trønnes <noralf@tronnes.org>
Thu, 21 Feb 2019 11:11:58 +0000 (12:11 +0100)
This makes it possible to use drm_dev_unplug() with the upcoming
devm_drm_dev_init() which will do drm_dev_put() in its release callback.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: David (ChunMing) Zhou <David1.Zhou@amd.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Sean Paul <sean@poorly.run>
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190208140103.28919-3-noralf@tronnes.org
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/drm_drv.c
drivers/gpu/drm/udl/udl_drv.c
drivers/gpu/drm/xen/xen_drm_front.c

index 7f3aa7b..a9b3a4a 100644 (file)
@@ -973,6 +973,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
 
        DRM_ERROR("Device removal is currently not supported outside of fbcon\n");
        drm_dev_unplug(dev);
+       drm_dev_put(dev);
        pci_disable_device(pdev);
        pci_set_drvdata(pdev, NULL);
 }
index f2d5a41..53e8f4e 100644 (file)
@@ -376,7 +376,6 @@ void drm_dev_unplug(struct drm_device *dev)
        synchronize_srcu(&drm_unplug_srcu);
 
        drm_dev_unregister(dev);
-       drm_dev_put(dev);
 }
 EXPORT_SYMBOL(drm_dev_unplug);
 
index 22cd2d1..53b7b8c 100644 (file)
@@ -107,6 +107,7 @@ static void udl_usb_disconnect(struct usb_interface *interface)
        udl_fbdev_unplug(dev);
        udl_drop_usb(dev);
        drm_dev_unplug(dev);
+       drm_dev_put(dev);
 }
 
 /*
index 3e78a83..84aa4d6 100644 (file)
@@ -582,6 +582,7 @@ static void xen_drm_drv_fini(struct xen_drm_front_info *front_info)
 
        drm_kms_helper_poll_fini(dev);
        drm_dev_unplug(dev);
+       drm_dev_put(dev);
 
        front_info->drm_info = NULL;