use DEFINE_SEMAPHORE in 2.6.37+

Building tp_smapi against 2.6.37 fails because 'DECLARE_MUTEX'
has been removed in 4882720b267b7b1d1b0ce08334b205f0329d4615
in torvalds/linux-2.6.git. Use DEFINE_SEMAPHORE instead.
This commit is contained in:
Tanaka Watanabe 2011-06-27 21:09:13 +02:00 committed by Evgeni Golov
parent ecd90e2a2a
commit 4b812d4f58
2 changed files with 8 additions and 0 deletions

View File

@ -88,7 +88,11 @@ static u64 prefetch_jiffies; /* time of prefetch, or: */
#define TPC_PREFETCH_JUNK (INITIAL_JIFFIES+1) /* Ignore prefetch */
/* Locking: */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
static DECLARE_MUTEX(thinkpad_ec_mutex);
#else
static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
#endif
/* Kludge in case the ACPI DSDT reserves the ports we need. */
static int force_io; /* Willing to do IO to ports we couldn't reserve? */

View File

@ -109,7 +109,11 @@ static struct { u8 rc; char *msg; int ret; } smapi_retcode[] =
#define SMAPI_PORT2 0x4F /* fixed port, meaning unclear */
static unsigned short smapi_port; /* APM control port, normally 0xB2 */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
static DECLARE_MUTEX(smapi_mutex);
#else
static DEFINE_SEMAPHORE(smapi_mutex);
#endif
/**
* find_smapi_port - read SMAPI port from NVRAM