kernel: add missing version.h include to the TP-LINK parser
[openwrt/openwrt.git] / target / linux / generic / files / drivers / mtd / mtdsplit / mtdsplit_tplink.c
index c346aa8130ba6284655b043bbfbca1a83d828745..ff4a474d5456b8cd88f2124c94d3cf41712dd98a 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/slab.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/version.h>
 #include <linux/byteorder/generic.h>
 
 #include "mtdsplit.h"
@@ -152,9 +153,19 @@ static int mtdsplit_parse_tplink(struct mtd_info *master,
        return TPLINK_NR_PARTS;
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+static const struct of_device_id mtdsplit_tplink_of_match_table[] = {
+       { .compatible = "tplink,firmware" },
+       {},
+};
+#endif
+
 static struct mtd_part_parser mtdsplit_tplink_parser = {
        .owner = THIS_MODULE,
        .name = "tplink-fw",
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+       .of_match_table = mtdsplit_tplink_of_match_table,
+#endif
        .parse_fn = mtdsplit_parse_tplink,
        .type = MTD_PARSER_TYPE_FIRMWARE,
 };