aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c
diff options
context:
space:
mode:
authorKoen Vandeputte <koen.vandeputte@ncentric.com>2018-08-22 13:00:22 +0200
committerJohn Crispin <john@phrozen.org>2018-08-22 13:11:59 +0200
commit3b1ea0996f83690695e06d11e0214110b6f7201f (patch)
tree2617787bec7747583520be2b19dc1726f229e232 /target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c
parent743654f30dde7659d11280e9cd34da2f1ddad0bc (diff)
downloadupstream-3b1ea0996f83690695e06d11e0214110b6f7201f.tar.gz
upstream-3b1ea0996f83690695e06d11e0214110b6f7201f.tar.bz2
upstream-3b1ea0996f83690695e06d11e0214110b6f7201f.zip
ar71xx: fix build error due to bad include
While "rawnand.h" is available in kernel 4.14, the default for this target is kernel 4.9 in which "nand.h" should be used. Add an extra check to include the correct file depending on kernel version Fixes these build errors: drivers/mtd/nand/ar934x_nfc.c:16:10: fatal error: linux/mtd/rawnand.h: No such file or directory #include <linux/mtd/rawnand.h> ^~~~~~~~~~~~~~~~~~~~~ compilation terminated. Fixes: 318e19ba6755 ("ar71xx: add v4.14 support") Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c')
-rw-r--r--target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c b/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c
index 0b6ba1fcec..26f14fdac6 100644
--- a/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c
+++ b/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c
@@ -8,17 +8,21 @@
* by the Free Software Foundation.
*/
+#include <linux/version.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/dma-mapping.h>
#include <linux/mtd/mtd.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
+#include <linux/mtd/nand.h>
+#else
#include <linux/mtd/rawnand.h>
+#endif
#include <linux/mtd/partitions.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/slab.h>
-#include <linux/version.h>
#include <linux/platform/ar934x_nfc.h>