brcm63xx: rename target to bcm63xx
[openwrt/openwrt.git] / target / linux / bcm63xx / patches-4.19 / 123-mtd-parser_bcm63xx_imagetag-add-of_match_table-suppo.patch
1 From 3303dd9f5b197cc2efd9cbd7b9b45fc1e510a393 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Wed, 28 Jun 2017 18:37:12 +0200
4 Subject: [PATCH 2/2] mtd: parser_bcm63xx_imagetag: add of_match_table support
5
6 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
7 ---
8 drivers/mtd/parsers/parser_imagetag.c | 8 ++++++++
9 1 file changed, 8 insertions(+)
10
11 --- a/drivers/mtd/parsers/parser_imagetag.c
12 +++ b/drivers/mtd/parsers/parser_imagetag.c
13 @@ -24,6 +24,7 @@
14 #include <linux/vmalloc.h>
15 #include <linux/mtd/mtd.h>
16 #include <linux/mtd/partitions.h>
17 +#include <linux/of.h>
18
19 /* Ensure strings read from flash structs are null terminated */
20 #define STR_NULL_TERMINATE(x) \
21 @@ -200,9 +201,16 @@ out:
22 return nrparts;
23 }
24
25 +static const struct of_device_id parse_bcm963xx_imagetag_match_table[] = {
26 + { .compatible = "brcm,bcm963xx-imagetag" },
27 + {},
28 +};
29 +MODULE_DEVICE_TABLE(of, parse_bcm963xx_imagetag_match_table);
30 +
31 static struct mtd_part_parser bcm963xx_imagetag_parser = {
32 .parse_fn = bcm963xx_parse_imagetag_partitions,
33 .name = "bcm963xx-imagetag",
34 + .of_match_table = parse_bcm963xx_imagetag_match_table,
35 };
36 module_mtd_part_parser(bcm963xx_imagetag_parser);
37