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>
This commit is contained in:
parent
840c4cba92
commit
2abb128f2e
2 changed files with 14 additions and 0 deletions
|
@ -79,9 +79,16 @@ static int mtdsplit_parse_lzma(struct mtd_info *master,
|
||||||
return LZMA_NR_PARTS;
|
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 = {
|
static struct mtd_part_parser mtdsplit_lzma_parser = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.name = "lzma-fw",
|
.name = "lzma-fw",
|
||||||
|
.of_match_table = mtdsplit_lzma_of_match_table,
|
||||||
.parse_fn = mtdsplit_parse_lzma,
|
.parse_fn = mtdsplit_parse_lzma,
|
||||||
.type = MTD_PARSER_TYPE_FIRMWARE,
|
.type = MTD_PARSER_TYPE_FIRMWARE,
|
||||||
};
|
};
|
||||||
|
|
|
@ -107,9 +107,16 @@ static int mtdsplit_parse_wrgg(struct mtd_info *master,
|
||||||
return WRGG_NR_PARTS;
|
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 = {
|
static struct mtd_part_parser mtdsplit_wrgg_parser = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.name = "wrgg-fw",
|
.name = "wrgg-fw",
|
||||||
|
.of_match_table = mtdsplit_wrgg_of_match_table,
|
||||||
.parse_fn = mtdsplit_parse_wrgg,
|
.parse_fn = mtdsplit_parse_wrgg,
|
||||||
.type = MTD_PARSER_TYPE_FIRMWARE,
|
.type = MTD_PARSER_TYPE_FIRMWARE,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue