aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2018-11-22 10:11:30 +0100
committerRafał Miłecki <rafal@milecki.pl>2018-11-22 10:13:56 +0100
commitdab5a93086400c31587f1c7c10ce96342b5c86ac (patch)
treef2fb0a0331f9ab8741c18e48b38321a5b3122c68 /target
parent1dcaef841017d805501fef19ec57e5a723cf76cd (diff)
downloadupstream-dab5a93086400c31587f1c7c10ce96342b5c86ac.tar.gz
upstream-dab5a93086400c31587f1c7c10ce96342b5c86ac.tar.bz2
upstream-dab5a93086400c31587f1c7c10ce96342b5c86ac.zip
kernel: add DT binding support to the Seama parser
It allows specifying that parser directly in the DT. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target')
-rw-r--r--target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c
index f8556e05a4..2d70f9b375 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c
@@ -93,9 +93,22 @@ static int mtdsplit_parse_seama(struct mtd_info *master,
return SEAMA_NR_PARTS;
}
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+static const struct of_device_id mtdsplit_seama_of_match_table[] = {
+ { .compatible = "seama" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, mtdsplit_seama_of_match_table);
+#endif
+
static struct mtd_part_parser mtdsplit_seama_parser = {
.owner = THIS_MODULE,
.name = "seama-fw",
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ .of_match_table = mtdsplit_seama_of_match_table,
+#endif
.parse_fn = mtdsplit_parse_seama,
.type = MTD_PARSER_TYPE_FIRMWARE,
};