From: Frank Mori Hess Date: Wed, 23 Nov 2005 12:59:44 +0000 (+0000) Subject: Deal with varying return type for kref_put in newer kernels. X-Git-Tag: r0_7_71~117 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=596ecdecc692627884311dc9f01a62f74886d522;p=comedi.git Deal with varying return type for kref_put in newer kernels. --- diff --git a/include/linux/kref.h b/include/linux/kref.h index f7a51121..20d4aa38 100644 --- 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)