bcm63xx: copy files to kernel 5.4
[openwrt/staging/wigyori.git] / target / linux / bcm63xx / patches-5.4 / 122-mtd-bcm63xxpart-add-of_match_table.patch
1 From 89cd5efa4a0d342b860a726bb1d382e4db4b96a4 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Wed, 28 Jun 2017 18:34:42 +0200
4 Subject: [PATCH 1/2] mtd: bcm63xxpart: add of_match_table
5
6 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
7 ---
8 drivers/mtd/bcm63xxpart.c | 8 ++++++++
9 1 file changed, 8 insertions(+)
10
11 --- a/drivers/mtd/bcm63xxpart.c
12 +++ b/drivers/mtd/bcm63xxpart.c
13 @@ -34,6 +34,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 #define BCM963XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */
20
21 @@ -172,9 +173,16 @@ out:
22 return ret;
23 };
24
25 +static const struct of_device_id parse_bcm63xx_cfe_match_table[] = {
26 + { .compatible = "brcm,bcm963xx-cfe-nor-partitions" },
27 + {},
28 +};
29 +MODULE_DEVICE_TABLE(of, parse_bcm63xx_cfe_match_table);
30 +
31 static struct mtd_part_parser bcm63xx_cfe_parser = {
32 .parse_fn = bcm63xx_parse_cfe_partitions,
33 .name = "bcm63xxpart",
34 + .of_match_table = parse_bcm63xx_cfe_match_table,
35 };
36 module_mtd_part_parser(bcm63xx_cfe_parser);
37