1 From 104af6a5b199eb4dc7970d1304aef38ac5a6ed54 Mon Sep 17 00:00:00 2001
2 From: Miquel Raynal <miquel.raynal@bootlin.com>
3 Date: Tue, 8 Aug 2023 08:29:26 +0200
4 Subject: [PATCH] nvmem: core: Create all cells before adding the nvmem device
6 Let's pack all the cells creation in one place, so they are all created
7 before we add the nvmem device.
9 Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
10 Reviewed-by: Michael Walle <michael@walle.cc>
11 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
13 drivers/nvmem/core.c | 10 +++++-----
14 1 file changed, 5 insertions(+), 5 deletions(-)
16 --- a/drivers/nvmem/core.c
17 +++ b/drivers/nvmem/core.c
18 @@ -998,17 +998,17 @@ struct nvmem_device *nvmem_register(cons
20 goto err_remove_cells;
22 - dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name);
24 - rval = device_add(&nvmem->dev);
25 + rval = nvmem_add_cells_from_fixed_layout(nvmem);
27 goto err_remove_cells;
29 - rval = nvmem_add_cells_from_fixed_layout(nvmem);
30 + rval = nvmem_add_cells_from_layout(nvmem);
32 goto err_remove_cells;
34 - rval = nvmem_add_cells_from_layout(nvmem);
35 + dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name);
37 + rval = device_add(&nvmem->dev);
39 goto err_remove_cells;