Skip to content

Commit

Permalink
drm/i915: [sparse] __iomem fixes for debugfs
Browse files Browse the repository at this point in the history
These were mostly straight forward. No forced casting needed.

Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
[danvet: fix conflict with ringbuffer_data removal and drop the hunk
about the status page - that needs more care to fix up.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Daniel Vetter committed May 3, 2012
1 parent 75020bc commit 0d38f00
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions drivers/gpu/drm/i915/i915_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,17 +1290,25 @@ static int i915_opregion(struct seq_file *m, void *unused)
struct drm_device *dev = node->minor->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
struct intel_opregion *opregion = &dev_priv->opregion;
void *data = kmalloc(OPREGION_SIZE, GFP_KERNEL);
int ret;

if (data == NULL)
return -ENOMEM;

ret = mutex_lock_interruptible(&dev->struct_mutex);
if (ret)
return ret;
goto out;

if (opregion->header)
seq_write(m, opregion->header, OPREGION_SIZE);
if (opregion->header) {
memcpy_fromio(data, opregion->header, OPREGION_SIZE);
seq_write(m, data, OPREGION_SIZE);
}

mutex_unlock(&dev->struct_mutex);

out:
kfree(data);
return 0;
}

Expand Down

0 comments on commit 0d38f00

Please sign in to comment.