nvmem_register() calls device_initialize() and later device_add(),
which is exactly the content of device_register(). Upon error
after device_add(), we currently call device_put(), whereas
device_unregister would call both device_del() and device_put().
I would expect device_del() to be first called upon error before
device_put() *after* device_add() has succeded, no?
I also see the layout_np below should be freed before jumping in the
error section.
you mean missing of_node_put()?
Yes, I need to call of_node_put() before jumping into the error path.
Thanks,
Miquèl