summaryrefslogtreecommitdiff
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2020-03-24 17:15:58 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-25 18:56:38 +0100
commitf60442ddc40c21a99720ee990d5924c80a24728d (patch)
tree9103f865dd5e86957a032bd92659014cd02c95e9 /drivers/nvmem
parente6de179d7a88b833ccadd18da5099d435acdac65 (diff)
downloadlinux-f60442ddc40c21a99720ee990d5924c80a24728d.tar.gz
nvmem: core: use device_register and device_unregister
use device_register/unregister instead of spliting them with no use. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200324171600.15606-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/core.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index acf75939df4d..7d28e1cca4e0 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -398,11 +398,9 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
nvmem->dev.groups = nvmem_sysfs_get_groups(nvmem, config);
- device_initialize(&nvmem->dev);
-
dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name);
- rval = device_add(&nvmem->dev);
+ rval = device_register(&nvmem->dev);
if (rval)
goto err_put_device;
@@ -456,8 +454,7 @@ static void nvmem_device_release(struct kref *kref)
device_remove_bin_file(nvmem->base_dev, &nvmem->eeprom);
nvmem_device_remove_all_cells(nvmem);
- device_del(&nvmem->dev);
- put_device(&nvmem->dev);
+ device_unregister(&nvmem->dev);
}
/**