summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-11-28 13:38:12 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-11-28 13:38:12 +0000
commitfe82bfbae38aab5a888c46a5c31dceaa5a298f6b (patch)
tree901fead2d5b11bb4c6626de5ce3daf848ee4298c /sys/dev/pci/drm
parent69c6c7c4151f8714cfac9558e3e7198dfbae53dc (diff)
Use mutex_trylock() rather than mixing Linux APIs with OpenBSD ones.
ok kettenis@
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/i915/i915_gem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c
index 676a2e6ea04..306db1bc0e0 100644
--- a/sys/dev/pci/drm/i915/i915_gem.c
+++ b/sys/dev/pci/drm/i915/i915_gem.c
@@ -2216,7 +2216,7 @@ i915_gem_fault(struct drm_gem_object *gem_obj, struct uvm_faultinfo *ufi,
offset -= drm_vma_node_offset_addr(&obj->base.vma_node);
- if (rw_enter(&dev->struct_mutex, RW_NOSLEEP | RW_WRITE) != 0) {
+ if (!mutex_trylock(&dev->struct_mutex)) {
uvmfault_unlockall(ufi, NULL, &obj->base.uobj, NULL);
mutex_lock(&dev->struct_mutex);
locked = uvmfault_relock(ufi);