CRIS: locking: fix the return value of arch_read_trylock()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 17 Oct 2012 14:54:27 +0000 (16:54 +0200)
committerJesper Nilsson <jesper@jni.nu>
Thu, 20 Dec 2012 11:51:19 +0000 (12:51 +0100)
arch_write_trylock() should return 'ret' instead of always
return 1.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
arch/cris/include/arch-v32/arch/spinlock.h

index f171a6600fbcac6424376d65aeb35424d57e2b6e..f13275522f4d688ed5dff599045395be62b529d1 100644 (file)
@@ -118,7 +118,7 @@ static  inline int arch_write_trylock(arch_rwlock_t *rw)
                ret = 1;
        }
        arch_spin_unlock(&rw->slock);
-       return 1;
+       return ret;
 }
 
 #define _raw_read_lock_flags(lock, flags) _raw_read_lock(lock)