summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2018-06-27 21:42:26 -0700
committerSascha Hauer <s.hauer@pengutronix.de>2018-06-29 07:04:47 +0200
commit8905d0f1a4cd2d15b7aeb585f8cf39137b1b9b03 (patch)
tree8e07e76de64a0103c8980b37d31aa4df84f1abed /include
parent97f22548a8e887f163af7dc1598cbc8d0f85f0da (diff)
downloadbarebox-8905d0f1a4cd2d15b7aeb585f8cf39137b1b9b03.tar.gz
barebox-8905d0f1a4cd2d15b7aeb585f8cf39137b1b9b03.tar.xz
nvmem: Introduce nvmem_cell_get_and_read()
Introduce nvmem_cell_get_and_read() that combines getting a NVMEM cell by name and reading its contents. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nvmem-consumer.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h
index 606cadb498..0ec2f05b97 100644
--- a/include/linux/nvmem-consumer.h
+++ b/include/linux/nvmem-consumer.h
@@ -32,6 +32,9 @@ struct nvmem_cell_info {
struct nvmem_cell *nvmem_cell_get(struct device_d *dev, const char *name);
void nvmem_cell_put(struct nvmem_cell *cell);
void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len);
+void *nvmem_cell_get_and_read(struct device_node *np, const char *cell_name,
+ size_t bytes);
+
int nvmem_cell_write(struct nvmem_cell *cell, void *buf, size_t len);
/* direct nvmem device read/write interface */
@@ -55,6 +58,13 @@ static inline char *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
return ERR_PTR(-ENOSYS);
}
+static inline void *nvmem_cell_get_and_read(struct device_node *np,
+ const char *cell_name,
+ size_t bytes)
+{
+ return ERR_PTR(-ENOSYS);
+}
+
static inline int nvmem_cell_write(struct nvmem_cell *cell,
const char *buf, size_t len)
{