kernel: add DT binding support to the LZMA and WRG parsers
authorRafał Miłecki <rafal@milecki.pl>
Thu, 13 Dec 2018 15:58:43 +0000 (16:58 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Thu, 13 Dec 2018 15:59:00 +0000 (16:59 +0100)
It allows specifying those parsers directly in the DT.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_lzma.c
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c

index b7f044a6dc8246102ff6ae7f22f12cf645df1dea..7bae0847dc2597725382d4bede1abe0f9f3fae05 100644 (file)
@@ -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,
 };
index 16ebd51345e8a66958446106c620555ecd6f93cf..5ce7625731d69e0989f1275d5deec68fbe8d495f 100644 (file)
@@ -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,
 };