mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
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>
This commit is contained in:
parent
1006ebe9f1
commit
f4d1d17e1d
@ -997,12 +997,6 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
|
||||
if (rval)
|
||||
goto err_remove_cells;
|
||||
|
||||
dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name);
|
||||
|
||||
rval = device_add(&nvmem->dev);
|
||||
if (rval)
|
||||
goto err_remove_cells;
|
||||
|
||||
rval = nvmem_add_cells_from_fixed_layout(nvmem);
|
||||
if (rval)
|
||||
goto err_remove_cells;
|
||||
@ -1011,6 +1005,12 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
|
||||
if (rval)
|
||||
goto err_remove_cells;
|
||||
|
||||
dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name);
|
||||
|
||||
rval = device_add(&nvmem->dev);
|
||||
if (rval)
|
||||
goto err_remove_cells;
|
||||
|
||||
blocking_notifier_call_chain(&nvmem_notifier, NVMEM_ADD, nvmem);
|
||||
|
||||
return nvmem;
|
||||
|
Loading…
Reference in New Issue
Block a user