From b3db17e4b864e46ad150ebef69c0e0130a1c5fca Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Fri, 11 May 2018 12:06:56 +0100 Subject: drivers: nvmem: Export nvmem_add_cells() Not all platforms use device tree. It is useful to be able to add cells to a NVMEM device from code. Export nvmem_add_cells() so making this possible. This required changing the parameters a bit, so that just the cells and the number of cells are passed, not the whole nvmem config structure. Signed-off-by: Andrew Lunn Reviewed-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman --- include/linux/nvmem-provider.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/linux/nvmem-provider.h') diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index f89598bc4e1c..24def6ad09bb 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -77,6 +77,9 @@ struct nvmem_device *devm_nvmem_register(struct device *dev, int devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem); +int nvmem_add_cells(struct nvmem_device *nvmem, + const struct nvmem_cell_info *info, + int ncells); #else static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c) @@ -99,6 +102,14 @@ static inline int devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem) { return nvmem_unregister(nvmem); + +} + +static inline int nvmem_add_cells(struct nvmem_device *nvmem, + const struct nvmem_cell_info *info, + int ncells) +{ + return -ENOSYS; } #endif /* CONFIG_NVMEM */ -- cgit v1.2.3