drm/linux: Improve the implementation of mutex_lock_interruptible()
authorFrançois Tigeot <ftigeot@wolfpond.org>
Thu, 21 May 2015 18:47:46 +0000 (20:47 +0200)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Thu, 21 May 2015 18:48:20 +0000 (20:48 +0200)
sys/dev/drm/include/linux/mutex.h

index 9fd986b..ebd05ba 100644 (file)
 
 #define mutex_trylock(lock)    lockmgr(lock, LK_EXCLUSIVE|LK_NOWAIT)
 
-#define mutex_lock_interruptible(lock) lockmgr((lock), LK_EXCLUSIVE|LK_SLEEPFAIL)
+static inline int
+mutex_lock_interruptible(struct lock *lock)
+{
+       if (lockmgr(lock, LK_EXCLUSIVE|LK_SLEEPFAIL))
+               return -EINTR;
+
+       return 0;
+}
 
 #endif /* _LINUX_MUTEX_H_ */