projects
/
comedi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7cdba88
)
Deal with varying return type for kref_put in newer kernels.
author
Frank Mori Hess
<fmhess@speakeasy.net>
Wed, 23 Nov 2005 12:59:44 +0000
(12:59 +0000)
committer
Frank Mori Hess
<fmhess@speakeasy.net>
Wed, 23 Nov 2005 12:59:44 +0000
(12:59 +0000)
include/linux/kref.h
patch
|
blob
|
history
diff --git
a/include/linux/kref.h
b/include/linux/kref.h
index f7a511214939e044abf8934e6903ac90dbedaae0..20d4aa38ac7d8686a5134e9799c7f8ed4db24f5c 100644
(file)
--- a/
include/linux/kref.h
+++ b/
include/linux/kref.h
@@
-98,7
+98,16
@@
static inline void KREF_INIT(struct kref *kref, void (*release) (struct kref *kr
static inline int KREF_PUT(struct kref *kref, void (*release) (struct kref *kref))
{
- return kref_put(kref, release);
+ int retval;
+ if(atomic_read(&kref->refcount) == 1)
+ {
+ retval = 1;
+ }else
+ {
+ retval = 0;
+ }
+ kref_put(kref, release);
+ return retval;
}
#endif // LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)