i2c-gpio-custom: add kernel version check
authorZoltan HERPAI <wigyori@uid0.hu>
Tue, 16 Oct 2018 14:42:20 +0000 (16:42 +0200)
committerZoltan HERPAI <wigyori@uid0.hu>
Tue, 16 Oct 2018 14:42:20 +0000 (16:42 +0200)
As i2c-gpio.h was moved into linux/platform_data in 4.18,
the include needs to be updated along with a version check.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
package/kernel/i2c-gpio-custom/src/i2c-gpio-custom.c

index 921d290d5206cd1198255a1391f2b4fbd2a1c58b..e876df6a57e3c5df5ee3de51b95c52a418cef539 100644 (file)
  */
 
 #include <linux/kernel.h>
+#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,18,0)
 #include <linux/i2c-gpio.h>
+#else
+#include <linux/platform_data/i2c-gpio.h>
+#endif
 
 #define DRV_NAME       "i2c-gpio-custom"
 #define DRV_DESC       "Custom GPIO-based I2C driver"