diff options
author | Marco Felsch <m.felsch@pengutronix.de> | 2021-01-18 21:55:27 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-01-19 11:06:30 +0100 |
commit | a61b04dfce85d992786c271999fe1e43596ff3b5 (patch) | |
tree | 757e0d4972f2cff9e2e2d1c33e6eb41cc735d8da /include | |
parent | b090a12da2d01a93a090dec8fa70db674748b8ca (diff) | |
download | barebox-a61b04dfce85d992786c271999fe1e43596ff3b5.tar.gz barebox-a61b04dfce85d992786c271999fe1e43596ff3b5.tar.xz |
nvmem: make nvmem_device_write/read public
Those functions already export their symbols so make it public
available. Compared to the nvmem_device_cell_read/write() APIs these
functions are a bit easier to use.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nvmem-consumer.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index d86377bfda..5d3d72837b 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -40,6 +40,10 @@ int nvmem_cell_write(struct nvmem_cell *cell, void *buf, size_t len); /* direct nvmem device read/write interface */ struct nvmem_device *nvmem_device_get(struct device_d *dev, const char *name); void nvmem_device_put(struct nvmem_device *nvmem); +int nvmem_device_read(struct nvmem_device *nvmem, unsigned int offset, + size_t bytes, void *buf); +int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset, + size_t bytes, const void *buf); ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem, struct nvmem_cell_info *info, void *buf); int nvmem_device_cell_write(struct nvmem_device *nvmem, @@ -98,6 +102,21 @@ static inline int nvmem_device_cell_write(struct nvmem_device *nvmem, { return -EOPNOTSUPP; } + +static inline int nvmem_device_read(struct nvmem_device *nvmem, + unsigned int offset, size_t bytes, + void *buf) +{ + return -EOPNOTSUPP; +} + +static inline int nvmem_device_write(struct nvmem_device *nvmem, + unsigned int offset, size_t bytes, + const void *buf) +{ + return -EOPNOTSUPP; +} + #endif /* CONFIG_NVMEM */ #if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OFTREE) |