浏览代码

kernel: add DT binding support to the Seama parser

It allows specifying that parser directly in the DT.

Signed-off-by: Rafał Miłecki <[email protected]>
Rafał Miłecki 7 年之前
父节点
当前提交
dab5a93086
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c

+ 13 - 0
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seama.c

@@ -93,9 +93,22 @@ static int mtdsplit_parse_seama(struct mtd_info *master,
 	return SEAMA_NR_PARTS;
 }
 
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+static const struct of_device_id mtdsplit_seama_of_match_table[] = {
+	{ .compatible = "seama" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mtdsplit_seama_of_match_table);
+#endif
+
 static struct mtd_part_parser mtdsplit_seama_parser = {
 	.owner = THIS_MODULE,
 	.name = "seama-fw",
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+	.of_match_table = mtdsplit_seama_of_match_table,
+#endif
 	.parse_fn = mtdsplit_parse_seama,
 	.type = MTD_PARSER_TYPE_FIRMWARE,
 };