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 <[email protected]> Reviewed-by: Michael Walle <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1006ebe commit f4d1d17

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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)