[PATCH 2/2] nvmem: core: Call put_device() in nvmem_unregister()

From: Andrey Smirnov
Date: Tue Apr 18 2017 - 10:25:31 EST


Call put_device() in nvmem_unregister() to make sure nvmem_release
gets called freeing up allocated resources.

Cc: cphealy@xxxxxxxxx
Cc: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
Cc: Maxime Ripard <maxime.ripard@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
drivers/nvmem/core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 095e3fc..4bec82e 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -530,6 +530,7 @@ int nvmem_unregister(struct nvmem_device *nvmem)

nvmem_device_remove_all_cells(nvmem);
device_del(&nvmem->dev);
+ put_device(&nvmem->dev);

return 0;
}
--
2.9.3