drm: qxl: Drop duplicated device pointer attribute

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>
This commit is contained in:
Gabriel Krisman Bertazi 2017-01-26 23:05:46 -02:00 committed by Gerd Hoffmann
parent 768851b92c
commit 5472bdee3f
4 changed files with 12 additions and 14 deletions

View 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;

View 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;

View 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);

View 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;