updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / tp_smapi-builder / fix_for_2.6.37.patch
blob1f58e0fbc7b1bfdc96f83b347be9fed5edea60a9
1 # from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=602367
2 diff --git a/thinkpad_ec.c b/thinkpad_ec.c
3 --- a/thinkpad_ec.c
4 +++ b/thinkpad_ec.c
5 @@ -88,7 +88,11 @@ static u64 prefetch_jiffies;
6 #define TPC_PREFETCH_JUNK (INITIAL_JIFFIES+1) /* Ignore prefetch */
8 /* Locking: */
9 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
10 static DECLARE_MUTEX(thinkpad_ec_mutex);
11 +#else
12 +static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
13 +#endif
15 /* Kludge in case the ACPI DSDT reserves the ports we need. */
16 static int force_io; /* Willing to do IO to ports we couldn't reserve? */
17 diff --git a/tp_smapi.c b/tp_smapi.c
18 --- a/tp_smapi.c
19 +++ b/tp_smapi.c
20 @@ -109,7 +109,11 @@ static struct { u8 rc; char *msg; int re
21 #define SMAPI_PORT2 0x4F /* fixed port, meaning unclear */
22 static unsigned short smapi_port; /* APM control port, normally 0xB2 */
24 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
25 static DECLARE_MUTEX(smapi_mutex);
26 +#else
27 +static DEFINE_SEMAPHORE(smapi_mutex);
28 +#endif
30 /**
31 * find_smapi_port - read SMAPI port from NVRAM