drm: qxl: Drop duplicated device pointer attribute
authorGabriel Krisman Bertazi <krisman@collabora.co.uk>
Fri, 27 Jan 2017 01:05:46 +0000 (23:05 -0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 2 Feb 2017 09:02:34 +0000 (10:02 +0100)
qxl_device duplicates a pointer to struct device, which is not needed
since we already have it in the drm_device structure.  Clean it up.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170127010548.27970-2-krisman@collabora.co.uk
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
drivers/gpu/drm/qxl/qxl_drv.h
drivers/gpu/drm/qxl/qxl_kms.c
drivers/gpu/drm/qxl/qxl_object.c
drivers/gpu/drm/qxl/qxl_object.h

index 0d877fa6116273af8a9f1336cacdde453090c941..a022de20513495837ecfe6d812c556edf9b8a0c1 100644 (file)
@@ -242,7 +242,6 @@ void qxl_debugfs_remove_files(struct qxl_device *qdev);
 struct qxl_device;
 
 struct qxl_device {
-       struct device                   *dev;
        struct drm_device               *ddev;
        struct pci_dev                  *pdev;
        unsigned long flags;
index d0666f5dccd6af9727160d0473572796c10cd59a..7632e38493fcbbd05561ec0442f070396d7da9a7 100644 (file)
@@ -122,7 +122,6 @@ int qxl_device_init(struct qxl_device *qdev,
 {
        int r, sb;
 
-       qdev->dev = &pdev->dev;
        qdev->ddev = ddev;
        qdev->pdev = pdev;
        qdev->flags = flags;
index fa5440dc9a19764af3051c401b630cafd15d2314..adaa131d1588f531bee4b3e6cfcbce93bbfa3240 100644 (file)
@@ -113,7 +113,7 @@ int qxl_bo_create(struct qxl_device *qdev,
                        NULL, NULL, &qxl_ttm_bo_destroy);
        if (unlikely(r != 0)) {
                if (r != -ERESTARTSYS)
-                       dev_err(qdev->dev,
+                       dev_err(qdev->ddev->dev,
                                "object_init failed for (%lu, 0x%08X)\n",
                                size, domain);
                return r;
@@ -223,7 +223,7 @@ struct qxl_bo *qxl_bo_ref(struct qxl_bo *bo)
 
 int qxl_bo_pin(struct qxl_bo *bo, u32 domain, u64 *gpu_addr)
 {
-       struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
+       struct drm_device *ddev = bo->gem_base.dev;
        int r;
 
        if (bo->pin_count) {
@@ -240,17 +240,17 @@ int qxl_bo_pin(struct qxl_bo *bo, u32 domain, u64 *gpu_addr)
                        *gpu_addr = qxl_bo_gpu_offset(bo);
        }
        if (unlikely(r != 0))
-               dev_err(qdev->dev, "%p pin failed\n", bo);
+               dev_err(ddev->dev, "%p pin failed\n", bo);
        return r;
 }
 
 int qxl_bo_unpin(struct qxl_bo *bo)
 {
-       struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
+       struct drm_device *ddev = bo->gem_base.dev;
        int r, i;
 
        if (!bo->pin_count) {
-               dev_warn(qdev->dev, "%p unpin not necessary\n", bo);
+               dev_warn(ddev->dev, "%p unpin not necessary\n", bo);
                return 0;
        }
        bo->pin_count--;
@@ -260,7 +260,7 @@ int qxl_bo_unpin(struct qxl_bo *bo)
                bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
        r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
        if (unlikely(r != 0))
-               dev_err(qdev->dev, "%p validate failed for unpin\n", bo);
+               dev_err(ddev->dev, "%p validate failed for unpin\n", bo);
        return r;
 }
 
@@ -270,9 +270,9 @@ void qxl_bo_force_delete(struct qxl_device *qdev)
 
        if (list_empty(&qdev->gem.objects))
                return;
-       dev_err(qdev->dev, "Userspace still has active objects !\n");
+       dev_err(qdev->ddev->dev, "Userspace still has active objects !\n");
        list_for_each_entry_safe(bo, n, &qdev->gem.objects, list) {
-               dev_err(qdev->dev, "%p %p %lu %lu force free\n",
+               dev_err(qdev->ddev->dev, "%p %p %lu %lu force free\n",
                        &bo->gem_base, bo, (unsigned long)bo->gem_base.size,
                        *((unsigned long *)&bo->gem_base.refcount));
                mutex_lock(&qdev->gem.mutex);
index 4d8311373ba3ee6116256c6a1d5d32b86cc3e9b4..0374fd93f4d662525946c8618054d137712b25aa 100644 (file)
@@ -34,8 +34,8 @@ static inline int qxl_bo_reserve(struct qxl_bo *bo, bool no_wait)
        r = ttm_bo_reserve(&bo->tbo, true, no_wait, NULL);
        if (unlikely(r != 0)) {
                if (r != -ERESTARTSYS) {
-                       struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
-                       dev_err(qdev->dev, "%p reserve failed\n", bo);
+                       struct drm_device *ddev = bo->gem_base.dev;
+                       dev_err(ddev->dev, "%p reserve failed\n", bo);
                }
                return r;
        }
@@ -70,8 +70,8 @@ static inline int qxl_bo_wait(struct qxl_bo *bo, u32 *mem_type,
        r = ttm_bo_reserve(&bo->tbo, true, no_wait, NULL);
        if (unlikely(r != 0)) {
                if (r != -ERESTARTSYS) {
-                       struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;
-                       dev_err(qdev->dev, "%p reserve failed for wait\n",
+                       struct drm_device *ddev = bo->gem_base.dev;
+                       dev_err(ddev->dev, "%p reserve failed for wait\n",
                                bo);
                }
                return r;