diff options
author | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2015-06-25 16:54:25 +0100 |
---|---|---|
committer | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2015-07-06 12:56:52 +0100 |
commit | a6a4865fd9bae402b4a90263c12c111ed3830f09 (patch) | |
tree | 9b4b643eab8309f531c243d161974ba5e6ea5b96 | |
parent | 7d38b50cd040b092412b89b74cc3a9d658130e0b (diff) |
WIP: nvmem: fix kbuild warnings
This is a temporary fix.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
-rw-r--r-- | drivers/nvmem/core.c | 4 | ||||
-rw-r--r-- | include/linux/nvmem-consumer.h | 16 |
2 files changed, 9 insertions, 11 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 82b564cf6d17f..ac152f054fe5d 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -613,7 +613,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, if (!cell_np) return ERR_PTR(-EINVAL); - nvmem_np = of_get_next_parent(cell_np); + nvmem_np = of_get_parent(cell_np); if (!nvmem_np) return ERR_PTR(-EINVAL); @@ -816,7 +816,7 @@ static int __nvmem_cell_read(struct nvmem_device *nvmem, *len = cell->bytes; - return *len; + return cell->bytes; } /** * nvmem_cell_read() - Read a given nvmem cell diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index f9acc43e2abce..7e1631439939a 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -30,7 +30,8 @@ struct nvmem_cell_info { /* Cell based interface */ struct nvmem_cell *nvmem_cell_get(struct device *dev, const char *name); struct nvmem_cell *devm_nvmem_cell_get(struct device *dev, const char *name); -void nvmem_cell_put(struct nvmem_cell *cell); +struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, + const char *name); void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell); void *nvmem_cell_read(struct nvmem_cell *cell, ssize_t *len); int nvmem_cell_write(struct nvmem_cell *cell, void *buf, ssize_t len); @@ -39,6 +40,9 @@ int nvmem_cell_write(struct nvmem_cell *cell, void *buf, ssize_t len); struct nvmem_device *nvmem_device_get(struct device *dev, const char *name); struct nvmem_device *devm_nvmem_device_get(struct device *dev, const char *name); +struct nvmem_device *of_nvmem_device_get(struct device_node *np, + const char *name); +void nvmem_cell_put(struct nvmem_cell *cell); void nvmem_device_put(struct nvmem_device *nvmem); void devm_nvmem_device_put(struct device *dev, struct nvmem_device *nvmem); int nvmem_device_read(struct nvmem_device *nvmem, unsigned int offset, @@ -130,14 +134,7 @@ static inline int nvmem_device_write(struct nvmem_device *nvmem, { return -ENOSYS; } -#endif /* CONFIG_NVMEM */ -#if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF) -struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, - const char *name); -struct nvmem_device *of_nvmem_device_get(struct device_node *np, - const char *name); -#else static inline struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, const char *name) { @@ -149,6 +146,7 @@ static inline struct nvmem_device *of_nvmem_device_get(struct device_node *np, { return ERR_PTR(-ENOSYS); } -#endif /* CONFIG_NVMEM && CONFIG_OF */ +#endif /* CONFIG_NVMEM */ + #endif /* ifndef _LINUX_NVMEM_CONSUMER_H */ |