summaryrefslogtreecommitdiffstats
path: root/config/spl-build.m4
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-03-13 13:38:43 -0700
committerBrian Behlendorf <[email protected]>2009-03-13 13:38:43 -0700
commit8123ac4f0d7409cae209858d01803fb2744b51b6 (patch)
tree7e2c28b3215d47eff289fcd309a62224427621fb /config/spl-build.m4
parenta0b5ae8acaaf63fa2378a6d062e66fdf99387625 (diff)
Added SPL_AC_5ARGS_DEVICE_CREATE autoconf configure check
As of 2.6.27 kernels the device_create() API changed to include a private data argument. This check detects which version of device_create() function the kernel has and properly defines spl_device_create() to use the correct prototype.
Diffstat (limited to 'config/spl-build.m4')
-rw-r--r--config/spl-build.m422
1 files changed, 22 insertions, 0 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4
index f2dc7fa9e..d0cf86d9a 100644
--- a/config/spl-build.m4
+++ b/config/spl-build.m4
@@ -504,6 +504,28 @@ AC_DEFUN([SPL_AC_DEVICE_CREATE], [
])
dnl #
+dnl # 2.6.27 API change,
+dnl # device_create() uses 5 args, new 'drvdata' argument.
+dnl #
+AC_DEFUN([SPL_AC_5ARGS_DEVICE_CREATE], [
+ AC_MSG_CHECKING([whether device_create() wants 5 args])
+ tmp_flags="$EXTRA_KCFLAGS"
+ EXTRA_KCFLAGS="-Werror"
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/device.h>
+ ],[
+ device_create(NULL, NULL, 0, NULL, "%d", 1);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_5ARGS_DEVICE_CREATE, 1,
+ [device_create wants 5 args])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ EXTRA_KCFLAGS="$tmp_flags"
+])
+
+dnl #
dnl # 2.6.13 API change, check whether class_device_create() is available.
dnl # Class_device_create() was introduced in 2.6.13 and depricated
dnl # class_simple_device_add() which was fully removed in 2.6.13.