Add code to parse partition information that might be specified as a part of the DT config. Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx> --- drivers/nvmem/core.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 122aac5990..25924872ef 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -92,6 +92,7 @@ static int nvmem_register_cdev(struct nvmem_device *nvmem, const char *name) struct device_d *dev = &nvmem->dev; struct cdev *cdev = &nvmem->cdev; const char *alias; + int ret; alias = of_alias_get(dev->device_node); @@ -100,7 +101,14 @@ static int nvmem_register_cdev(struct nvmem_device *nvmem, const char *name) cdev->dev = dev; cdev->size = nvmem->size; - return devfs_create(cdev); + ret = devfs_create(cdev); + if (ret) + return ret; + + of_parse_partitions(cdev, dev->device_node); + of_partitions_register_fixup(cdev); + + return 0; } static struct nvmem_device *of_nvmem_find(struct device_node *nvmem_np) -- 2.21.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox