Skip to content

Commit

Permalink
i810: switch to vm_mmap()
Browse files Browse the repository at this point in the history
Weirdness around do_mmap() in there does not rely on ->mmap_sem for
exclusion, so no need to keep it under that.  As the result, we can
turn that do_mmap() into vm_mmap().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 31, 2012
1 parent fd65717 commit 244ca2b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/gpu/drm/i810/i810_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,10 @@ static int i810_map_buffer(struct drm_buf *buf, struct drm_file *file_priv)
return -EINVAL;

/* This is all entirely broken */
down_write(&current->mm->mmap_sem);
old_fops = file_priv->filp->f_op;
file_priv->filp->f_op = &i810_buffer_fops;
dev_priv->mmap_buffer = buf;
buf_priv->virtual = (void *)do_mmap(file_priv->filp, 0, buf->total,
buf_priv->virtual = (void *)vm_mmap(file_priv->filp, 0, buf->total,
PROT_READ | PROT_WRITE,
MAP_SHARED, buf->bus_address);
dev_priv->mmap_buffer = NULL;
Expand All @@ -145,7 +144,6 @@ static int i810_map_buffer(struct drm_buf *buf, struct drm_file *file_priv)
retcode = PTR_ERR(buf_priv->virtual);
buf_priv->virtual = NULL;
}
up_write(&current->mm->mmap_sem);

return retcode;
}
Expand Down

0 comments on commit 244ca2b

Please sign in to comment.