aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2018-12-13 16:58:43 +0100
committerRafał Miłecki <rafal@milecki.pl>2018-12-13 16:59:00 +0100
commit2abb128f2ecb0ad6b6144ce249b3fc3ced34f2b1 (patch)
tree7e144f2967219d58a1161792197d27c140d0018e /target/linux/generic
parent840c4cba92568d152e227b76b7522595e56d484e (diff)
downloadupstream-2abb128f2ecb0ad6b6144ce249b3fc3ced34f2b1.tar.gz
upstream-2abb128f2ecb0ad6b6144ce249b3fc3ced34f2b1.tar.bz2
upstream-2abb128f2ecb0ad6b6144ce249b3fc3ced34f2b1.zip
kernel: add DT binding support to the LZMA and WRG 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')
-rw-r--r--target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_lzma.c7
-rw-r--r--target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c7
2 files changed, 14 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_lzma.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_lzma.c
index b7f044a6dc..7bae0847dc 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_lzma.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_lzma.c
@@ -79,9 +79,16 @@ static int mtdsplit_parse_lzma(struct mtd_info *master,
return LZMA_NR_PARTS;
}
+static const struct of_device_id mtdsplit_lzma_of_match_table[] = {
+ { .compatible = "lzma" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, mtdsplit_lzma_of_match_table);
+
static struct mtd_part_parser mtdsplit_lzma_parser = {
.owner = THIS_MODULE,
.name = "lzma-fw",
+ .of_match_table = mtdsplit_lzma_of_match_table,
.parse_fn = mtdsplit_parse_lzma,
.type = MTD_PARSER_TYPE_FIRMWARE,
};
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c
index 16ebd51345..5ce7625731 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c
@@ -107,9 +107,16 @@ static int mtdsplit_parse_wrgg(struct mtd_info *master,
return WRGG_NR_PARTS;
}
+static const struct of_device_id mtdsplit_wrgg_of_match_table[] = {
+ { .compatible = "wrg" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, mtdsplit_wrgg_of_match_table);
+
static struct mtd_part_parser mtdsplit_wrgg_parser = {
.owner = THIS_MODULE,
.name = "wrgg-fw",
+ .of_match_table = mtdsplit_wrgg_of_match_table,
.parse_fn = mtdsplit_parse_wrgg,
.type = MTD_PARSER_TYPE_FIRMWARE,
};