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: 318e19ba67 ("ar71xx: add v4.14 support")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
This commit is contained in:
Koen Vandeputte 2018-08-22 13:00:22 +02:00 committed by John Crispin
parent 743654f30d
commit 3b1ea0996f
4 changed files with 20 additions and 5 deletions

View file

@ -8,17 +8,21 @@
* by the Free Software Foundation. * by the Free Software Foundation.
*/ */
#include <linux/version.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/mtd/mtd.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> #include <linux/mtd/rawnand.h>
#endif
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/version.h>
#include <linux/platform/ar934x_nfc.h> #include <linux/platform/ar934x_nfc.h>

View file

@ -12,10 +12,15 @@
* by the Free Software Foundation. * by the Free Software Foundation.
*/ */
#include <linux/version.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
#include <linux/mtd/nand.h>
#else
#include <linux/mtd/rawnand.h> #include <linux/mtd/rawnand.h>
#endif
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
@ -23,7 +28,6 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/version.h>
#include <asm/mach-ath79/ath79.h> #include <asm/mach-ath79/ath79.h>
#include <asm/mach-ath79/rb4xx_cpld.h> #include <asm/mach-ath79/rb4xx_cpld.h>

View file

@ -8,15 +8,19 @@
* by the Free Software Foundation. * by the Free Software Foundation.
*/ */
#include <linux/version.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
#include <linux/mtd/nand.h>
#else
#include <linux/mtd/rawnand.h> #include <linux/mtd/rawnand.h>
#endif
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/version.h>
#include <asm/mach-ath79/ar71xx_regs.h> #include <asm/mach-ath79/ar71xx_regs.h>
#include <asm/mach-ath79/ath79.h> #include <asm/mach-ath79/ath79.h>

View file

@ -8,18 +8,21 @@
* by the Free Software Foundation. * by the Free Software Foundation.
*/ */
#include <linux/version.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/module.h> #include <linux/module.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
#include <linux/mtd/nand.h>
#else
#include <linux/mtd/rawnand.h> #include <linux/mtd/rawnand.h>
#include <linux/mtd/mtd.h> #endif#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/platform_data/rb91x_nand.h> #include <linux/platform_data/rb91x_nand.h>
#include <linux/version.h>
#include <asm/mach-ath79/ar71xx_regs.h> #include <asm/mach-ath79/ar71xx_regs.h>
#include <asm/mach-ath79/ath79.h> #include <asm/mach-ath79/ath79.h>