Linux changed the DEFINE_SEMAPHORE macro in
48380368dec14859723b9e3fbd43e042638d9a76, making it take two parameters
instead of one. Pass an explicit 1 as on 6.4+.
Linux 4.15 removed the ancient init_timer() API and changed the signature
of the timer handler function.
Signed-off-by: Jan Nordholz <jnordholz@sec.t-labs.tu-berlin.de>
Closes: #31
v2: Fix the type warning the other way round as proposed by Bjorn Mork
Fix for the following warning:
CC [M] /home/jmayer/work/thinkpad/git/thinkpad_ec.o
In file included from /usr/src/linux-3.14.1-1.geafcebd/include/linux/module.h:17:0,
from /home/jmayer/work/thinkpad/git/thinkpad_ec.c:33:
/home/jmayer/work/thinkpad/git/thinkpad_ec.c: In function ‘__check_force_io’:
/usr/src/linux-3.14.1-1.geafcebd/include/linux/moduleparam.h:349:45: warning: return from incompatible pointer type [enabled by default]
static inline type *__check_##name(void) { return(p); }
^
/usr/src/linux-3.14.1-1.geafcebd/include/linux/moduleparam.h:395:35: note: in expansion of macro ‘__param_check’
#define param_check_bool(name, p) __param_check(name, p, bool)
^
/usr/src/linux-3.14.1-1.geafcebd/include/linux/moduleparam.h:127:2: note: in expansion of macro ‘param_check_bool’
param_check_##type(name, &(value)); \
^
/home/jmayer/work/thinkpad/git/thinkpad_ec.c💯1: note: in expansion of macro ‘module_param_named’
module_param_named(force_io, force_io, bool, 0600);
^
Signed-off-by: Joerg Mayer <jmayer@loplof.de>
depmod -a requires the directory /lib/modules/<currently-running-kernel>/
to exist. If it doesn't, depmod fails to create the temp files. Fix this.
Signed-off-by: Joerg Mayer <jmayer@loplof.de>
The current Makefile always sets KVER and some other variables to the
version of the currently running kernel and does not allow overriding
this value. So installing a newer kernel and building and installing
the modules for the new version will not work before activation of the
new kernel. With this patch, the following can be done:
export KVER=<newly-installed-kernel-version>
echo "Kernel version to build for: $KVER"
export MOD_DIR=/lib/modules/${KVER}/extra/
KVER=${KVER} MOD_DIR=${MOD_DIR} HDAPS=1 make
Signed-off-by: Joerg Mayer <jmayer@loplof.de>
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.