[ltp] [PATCH] tp-smapi 0.37 buildfix for 2.6.27+

Evgeni Golov linux-thinkpad@linux-thinkpad.org
Tue, 12 Aug 2008 10:53:47 +0200


--Signature=_Tue__12_Aug_2008_10_53_47_+0200_nYW=xaFeVmFFx97.
Content-Type: multipart/mixed;
 boundary="Multipart=_Tue__12_Aug_2008_10_53_47_+0200_cZd3iHjJi5P_yYAu"


--Multipart=_Tue__12_Aug_2008_10_53_47_+0200_cZd3iHjJi5P_yYAu
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Shem, hi *,

Corsac told me on IRC that tp-smapi does not compile for him with
kernels >=3D 2.6.27, so I had a quick look at that issue and came up with
the attached trivial patch.

A short explanation:
In 2.6.27 include/asm/semaphore.h (which is included by thinkpad_ec.c)
was removed. In 2.6.26 it already looked like this:
#include <linux/semaphore.h>
So I changed the include in thinkpad_ec.c accordingly, including a
fallback for older kernels, where it's really asm/semaphore.h which is
needed.

HTH
Evgeni

--Multipart=_Tue__12_Aug_2008_10_53_47_+0200_cZd3iHjJi5P_yYAu
Content-Type: text/x-diff;
 name="tp-smapi-0.37-for-2.6.27.patch"
Content-Disposition: attachment;
 filename="tp-smapi-0.37-for-2.6.27.patch"
Content-Transfer-Encoding: quoted-printable

--- tp-smapi.orig/thinkpad_ec.c	2008-04-16 12:56:27.000000000 +0200
+++ tp-smapi/thinkpad_ec.c	2008-08-12 10:51:00.000000000 +0200
@@ -36,7 +36,12 @@
 #include <linux/delay.h>
 #include "thinkpad_ec.h"
 #include <linux/jiffies.h>
-#include <asm/semaphore.h>
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+	#include <asm/semaphore.h>
+#else
+	#include <linux/semaphore.h>
+#endif
 #include <asm/io.h>
=20
 #define TP_VERSION "0.37"

--Multipart=_Tue__12_Aug_2008_10_53_47_+0200_cZd3iHjJi5P_yYAu--

--Signature=_Tue__12_Aug_2008_10_53_47_+0200_nYW=xaFeVmFFx97.
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkihT5sACgkQJKAUGKwVtQyn/wCgiCiXmeroPWG3So+tpwFMi1qT
PgMAn25ohLhDAYsmDCXrPFKeHQPgXi0u
=c2+O
-----END PGP SIGNATURE-----

--Signature=_Tue__12_Aug_2008_10_53_47_+0200_nYW=xaFeVmFFx97.--