aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2018-12-09 13:58:54 +0100
committerRafał Miłecki <rafal@milecki.pl>2018-12-09 13:58:54 +0100
commit4d3a53b9ef8f47d308875fe0be20585fa40726d0 (patch)
tree45364944d992477eaaee8efb6eca895ae960b6cb /target/linux/generic/files
parentf939598b7a7ce2079722295603e2dcee93ad310d (diff)
downloadupstream-4d3a53b9ef8f47d308875fe0be20585fa40726d0.tar.gz
upstream-4d3a53b9ef8f47d308875fe0be20585fa40726d0.tar.bz2
upstream-4d3a53b9ef8f47d308875fe0be20585fa40726d0.zip
kernel: add DT binding support to the TRX and minor parsers
It allows specifying those parsers directly in the DT. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic/files')
-rw-r--r--target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_minor.c13
-rw-r--r--target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_trx.c13
2 files changed, 26 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_minor.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_minor.c
index f971f0a650..d709a13cf6 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_minor.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_minor.c
@@ -100,9 +100,22 @@ static int mtdsplit_parse_minor(struct mtd_info *master,
return MINOR_NR_PARTS;
}
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+static const struct of_device_id mtdsplit_minor_of_match_table[] = {
+ { .compatible = "mikrotik,minor" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, mtdsplit_minor_of_match_table);
+#endif
+
static struct mtd_part_parser mtdsplit_minor_parser = {
.owner = THIS_MODULE,
.name = "minor-fw",
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ .of_match_table = mtdsplit_minor_of_match_table,
+#endif
.parse_fn = mtdsplit_parse_minor,
.type = MTD_PARSER_TYPE_FIRMWARE,
};
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_trx.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_trx.c
index 53aebc5987..d5e33727b5 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_trx.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_trx.c
@@ -130,9 +130,22 @@ err:
return ret;
}
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+static const struct of_device_id trx_parser_of_match_table[] = {
+ { .compatible = "openwrt,trx" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, trx_parser_of_match_table);
+#endif
+
static struct mtd_part_parser trx_parser = {
.owner = THIS_MODULE,
.name = "trx-fw",
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ .of_match_table = trx_parser_of_match_table,
+#endif
.parse_fn = mtdsplit_parse_trx,
.type = MTD_PARSER_TYPE_FIRMWARE,
};