public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvmem: fix nvmem_cell_read() return type for !CONFIG_NVMEM
@ 2016-06-08 16:26 Brian Norris
  2016-06-08 16:40 ` Brian Norris
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Norris @ 2016-06-08 16:26 UTC (permalink / raw)
  To: Srinivas Kandagatla, Maxime Ripard
  Cc: linux-kernel, Brian Norris, Greg Kroah-Hartman, Brian Norris

With CONFIG_NVMEM, nvmem_cell_read() returns void *. With !CONFIG_NVMEM
it returns char *. Let's make that consistent. Also drop the
incorrect/inconsistent comment about char * above the nvmem_cell_read()
definition.

drivers/thermal/mtk_thermal.c is already working around this by casting
to (u32 *).

Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 drivers/nvmem/core.c           | 4 ++--
 include/linux/nvmem-consumer.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 965911d9b36a..398ea7f54826 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -981,8 +981,8 @@ static int __nvmem_cell_read(struct nvmem_device *nvmem,
  * @cell: nvmem cell to be read.
  * @len: pointer to length of cell which will be populated on successful read.
  *
- * Return: ERR_PTR() on error or a valid pointer to a char * buffer on success.
- * The buffer should be freed by the consumer with a kfree().
+ * Return: ERR_PTR() on error or a valid pointer to a buffer on success. The
+ * buffer should be freed by the consumer with a kfree().
  */
 void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
 {
diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h
index 9bb77d3ed6e0..c2256d746543 100644
--- a/include/linux/nvmem-consumer.h
+++ b/include/linux/nvmem-consumer.h
@@ -74,7 +74,7 @@ static inline void nvmem_cell_put(struct nvmem_cell *cell)
 {
 }
 
-static inline char *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
+static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
 {
 	return ERR_PTR(-ENOSYS);
 }
-- 
2.8.0.rc3.226.g39d4020

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-08 20:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-08 16:26 [PATCH] nvmem: fix nvmem_cell_read() return type for !CONFIG_NVMEM Brian Norris
2016-06-08 16:40 ` Brian Norris
2016-06-08 17:40   ` Guenter Roeck
2016-06-08 18:52   ` Srinivas Kandagatla
2016-06-08 20:00     ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox