Skip to content

Commit

Permalink
nvmem: core: use device_register and device_unregister
Browse files Browse the repository at this point in the history
use device_register/unregister instead of spliting them with no use.

Signed-off-by: Srinivas Kandagatla <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Srinivas-Kandagatla authored and gregkh committed Mar 25, 2020
1 parent e6de179 commit f60442d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/nvmem/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit f60442d

Please sign in to comment.