Skip to content

Commit 0d38f00

Browse files
committed
drm/i915: [sparse] __iomem fixes for debugfs
These were mostly straight forward. No forced casting needed. Signed-off-by: Ben Widawsky <[email protected]> [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 <[email protected]>
1 parent 75020bc commit 0d38f00

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

drivers/gpu/drm/i915/i915_debugfs.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,17 +1290,25 @@ static int i915_opregion(struct seq_file *m, void *unused)
12901290
struct drm_device *dev = node->minor->dev;
12911291
drm_i915_private_t *dev_priv = dev->dev_private;
12921292
struct intel_opregion *opregion = &dev_priv->opregion;
1293+
void *data = kmalloc(OPREGION_SIZE, GFP_KERNEL);
12931294
int ret;
12941295

1296+
if (data == NULL)
1297+
return -ENOMEM;
1298+
12951299
ret = mutex_lock_interruptible(&dev->struct_mutex);
12961300
if (ret)
1297-
return ret;
1301+
goto out;
12981302

1299-
if (opregion->header)
1300-
seq_write(m, opregion->header, OPREGION_SIZE);
1303+
if (opregion->header) {
1304+
memcpy_fromio(data, opregion->header, OPREGION_SIZE);
1305+
seq_write(m, data, OPREGION_SIZE);
1306+
}
13011307

13021308
mutex_unlock(&dev->struct_mutex);
13031309

1310+
out:
1311+
kfree(data);
13041312
return 0;
13051313
}
13061314

0 commit comments

Comments
 (0)