From: Frank Mori Hess Date: Mon, 5 Dec 2005 01:05:18 +0000 (+0000) Subject: Patch from abbotti@mev.co.uk (Ian Abbott): X-Git-Tag: r0_7_71~110 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=34394e4e92480fd06a159c97c806ace88245bc7b;p=comedi.git Patch from abbotti@mev.co.uk (Ian Abbott): KREF_PUT can be simplified for 2.6.12 upwards - it just needs to call kref_put and pass on the return value. Also, the kref stuff first appeared in 2.6.5, not 2.6.0. --- diff --git a/include/linux/kref.h b/include/linux/kref.h index 20d4aa38..35ce9ec3 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h @@ -26,7 +26,7 @@ Copyright (C) 2002-2003 Patrick Mochel #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5) #include #include @@ -98,6 +98,7 @@ 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)) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) int retval; if(atomic_read(&kref->refcount) == 1) { @@ -108,6 +109,9 @@ static inline int KREF_PUT(struct kref *kref, void (*release) (struct kref *kref } kref_put(kref, release); return retval; +#else + return kref_put(kref, release); +#endif // LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) } #endif // LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)