diff options
author | Brian Behlendorf <[email protected]> | 2009-03-13 13:38:43 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-03-13 13:38:43 -0700 |
commit | 8123ac4f0d7409cae209858d01803fb2744b51b6 (patch) | |
tree | 7e2c28b3215d47eff289fcd309a62224427621fb /include/spl-device.h | |
parent | a0b5ae8acaaf63fa2378a6d062e66fdf99387625 (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 'include/spl-device.h')
-rw-r--r-- | include/spl-device.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/spl-device.h b/include/spl-device.h index d18aedf07..c82f65dfe 100644 --- a/include/spl-device.h +++ b/include/spl-device.h @@ -13,8 +13,15 @@ typedef struct device spl_device; #define spl_class_create(mod, name) class_create(mod, name) #define spl_class_destroy(cls) class_destroy(cls) -#define spl_device_create(cls, parent, devt, device, fmt, args...) \ + +# ifdef HAVE_5ARGS_DEVICE_CREATE +# define spl_device_create(cls, parent, devt, drvdata, fmt, args...) \ + device_create(cls, parent, devt, drvdata, fmt, ## args) +# else +# define spl_device_create(cls, parent, devt, drvdata, fmt, args...) \ device_create(cls, parent, devt, fmt, ## args) +# endif + #define spl_device_destroy(cls, cls_dev, devt) \ device_destroy(cls, devt) |