diff --git a/src/mod/endpoints/mod_skypopen/oss/main.c b/src/mod/endpoints/mod_skypopen/oss/main.c index 10ebfc9899..d92d2dc863 100644 --- a/src/mod/endpoints/mod_skypopen/oss/main.c +++ b/src/mod/endpoints/mod_skypopen/oss/main.c @@ -146,7 +146,11 @@ struct skypopen_listitem { /* The list of devices, and a lock to protect it */ static LIST_HEAD(skypopen_c_list); +#ifdef WANT_DEFINE_SPINLOCK +static DEFINE_SPINLOCK(skypopen_c_lock); +#else // WANT_DEFINE_SPINLOCK static spinlock_t skypopen_c_lock = SPIN_LOCK_UNLOCKED; +#endif // WANT_DEFINE_SPINLOCK /* Look for a device or create one if missing */ static struct skypopen_dev *skypopen_c_lookfor_device(dev_t key) diff --git a/src/mod/endpoints/mod_skypopen/oss/skypopen.h b/src/mod/endpoints/mod_skypopen/oss/skypopen.h index de38c791c9..dca1f8870d 100644 --- a/src/mod/endpoints/mod_skypopen/oss/skypopen.h +++ b/src/mod/endpoints/mod_skypopen/oss/skypopen.h @@ -31,6 +31,10 @@ #define WANT_HRTIMER #endif /* HRTIMER */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0) +#define WANT_DEFINE_SPINLOCK +#endif /* DEFINE_SPINLOCK */ + #define SKYPOPEN_BLK 1920 #define SKYPOPEN_SLEEP 20