summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/parsers
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2019-03-28 15:19:10 +0100
committerRichard Weinberger <richard@nod.at>2019-05-06 21:46:45 +0200
commitfb899d3b2a622874cbb5daf9eb8c0fba19844648 (patch)
treebc60f600fa571e9d6033c5b6869042c552d68c1a /drivers/mtd/parsers
parent6744ebb0c798ac3717ceb5da1a479d9314dd641c (diff)
downloadlinux-fb899d3b2a622874cbb5daf9eb8c0fba19844648.tar.bz2
mtd: parser_imagetag: add of_match_table support
Allow matching the imagetag parser for fixed partitions defined in the device tree. Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd/parsers')
-rw-r--r--drivers/mtd/parsers/parser_imagetag.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mtd/parsers/parser_imagetag.c b/drivers/mtd/parsers/parser_imagetag.c
index 74b66d009b5c..9537c183a3be 100644
--- a/drivers/mtd/parsers/parser_imagetag.c
+++ b/drivers/mtd/parsers/parser_imagetag.c
@@ -24,6 +24,7 @@
#include <linux/vmalloc.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
+#include <linux/of.h>
/* Ensure strings read from flash structs are null terminated */
#define STR_NULL_TERMINATE(x) \
@@ -200,9 +201,16 @@ out:
return nrparts;
}
+static const struct of_device_id parse_bcm963xx_imagetag_match_table[] = {
+ { .compatible = "brcm,bcm963xx-imagetag" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, parse_bcm963xx_imagetag_match_table);
+
static struct mtd_part_parser bcm963xx_imagetag_parser = {
.parse_fn = bcm963xx_parse_imagetag_partitions,
.name = "bcm963xx-imagetag",
+ .of_match_table = parse_bcm963xx_imagetag_match_table,
};
module_mtd_part_parser(bcm963xx_imagetag_parser);