drm/i915: Use drm_i915_private directly from debugfs
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 7 Apr 2017 19:42:20 +0000 (20:42 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 10 Apr 2017 11:04:23 +0000 (12:04 +0100)
The void *data passed to debugfs callbacks is actually the
drm_i915_private pointer, so use it thusly and avoid the to_i915(dev)
indirection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170407194220.821-1-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/i915/i915_debugfs.c

index d689e511744e8f2fc9508e2d7345827c6a70bbb2..870c470177b5c4fd10e81da146e3bf15e250a013 100644 (file)
@@ -2568,8 +2568,7 @@ static int i915_guc_log_dump(struct seq_file *m, void *data)
 
 static int i915_guc_log_control_get(void *data, u64 *val)
 {
-       struct drm_device *dev = data;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = data;
 
        if (!dev_priv->guc.log.vma)
                return -EINVAL;
@@ -2581,14 +2580,13 @@ static int i915_guc_log_control_get(void *data, u64 *val)
 
 static int i915_guc_log_control_set(void *data, u64 val)
 {
-       struct drm_device *dev = data;
-       struct drm_i915_private *dev_priv = to_i915(dev);
+       struct drm_i915_private *dev_priv = data;
        int ret;
 
        if (!dev_priv->guc.log.vma)
                return -EINVAL;
 
-       ret = mutex_lock_interruptible(&dev->struct_mutex);
+       ret = mutex_lock_interruptible(&dev_priv->drm.struct_mutex);
        if (ret)
                return ret;
 
@@ -2596,7 +2594,7 @@ static int i915_guc_log_control_set(void *data, u64 val)
        ret = i915_guc_log_control(dev_priv, val);
        intel_runtime_pm_put(dev_priv);
 
-       mutex_unlock(&dev->struct_mutex);
+       mutex_unlock(&dev_priv->drm.struct_mutex);
        return ret;
 }