Skip to content

Commit f4d1d17

Browse files
miquelraynalgregkh
authored andcommitted
nvmem: core: Create all cells before adding the nvmem device
Let's pack all the cells creation in one place, so they are all created before we add the nvmem device. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Michael Walle <michael@walle.cc> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230823132744.350618-20-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1006ebe commit f4d1d17

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/nvmem/core.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -997,17 +997,17 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
997997
if (rval)
998998
goto err_remove_cells;
999999

1000-
dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name);
1001-
1002-
rval = device_add(&nvmem->dev);
1000+
rval = nvmem_add_cells_from_fixed_layout(nvmem);
10031001
if (rval)
10041002
goto err_remove_cells;
10051003

1006-
rval = nvmem_add_cells_from_fixed_layout(nvmem);
1004+
rval = nvmem_add_cells_from_layout(nvmem);
10071005
if (rval)
10081006
goto err_remove_cells;
10091007

1010-
rval = nvmem_add_cells_from_layout(nvmem);
1008+
dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name);
1009+
1010+
rval = device_add(&nvmem->dev);
10111011
if (rval)
10121012
goto err_remove_cells;
10131013

0 commit comments

Comments
 (0)