Skip to content

Commit

Permalink
mtd: parser_imagetag: add of_match_table support
Browse files Browse the repository at this point in the history
Allow matching the imagetag parser for fixed partitions defined in the
device tree.

Reviewed-by: Rob Herring <[email protected]>
Signed-off-by: Jonas Gorski <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
KanjiMonster authored and richardweinberger committed May 6, 2019
1 parent 6744ebb commit fb899d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/mtd/parsers/parser_imagetag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -200,9 +201,16 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master,
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);

Expand Down

0 comments on commit fb899d3

Please sign in to comment.