summaryrefslogtreecommitdiff
path: root/include/linux/nvmem-provider.h
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2023-04-04 20:21:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-04-05 20:41:11 +0300
commit8a134fd9f9323f4c39ec27055b3d3723cfb5c1e9 (patch)
tree6e5aaa7c3bec04736c3e1c29c129b3f66396732a /include/linux/nvmem-provider.h
parent011e40a166fdaa65fb9946b7cd91efec85b70dbb (diff)
downloadlinux-8a134fd9f9323f4c39ec27055b3d3723cfb5c1e9.tar.xz
nvmem: core: provide own priv pointer in post process callback
It doesn't make any more sense to have a opaque pointer set up by the nvmem device. Usually, the layout isn't associated with a particular nvmem device. Instead, let the caller who set the post process callback provide the priv pointer. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230404172148.82422-21-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/nvmem-provider.h')
-rw-r--r--include/linux/nvmem-provider.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
index d3d7af86a283..0cf9f9490514 100644
--- a/include/linux/nvmem-provider.h
+++ b/include/linux/nvmem-provider.h
@@ -20,7 +20,8 @@ typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset,
void *val, size_t bytes);
/* used for vendor specific post processing of cell data */
typedef int (*nvmem_cell_post_process_t)(void *priv, const char *id, int index,
- unsigned int offset, void *buf, size_t bytes);
+ unsigned int offset, void *buf,
+ size_t bytes);
enum nvmem_type {
NVMEM_TYPE_UNKNOWN = 0,
@@ -56,6 +57,7 @@ struct nvmem_keepout {
* @np: Optional device_node pointer.
* @read_post_process: Callback for optional post processing of cell data
* on reads.
+ * @priv: Opaque data passed to the read_post_process hook.
*/
struct nvmem_cell_info {
const char *name;
@@ -65,6 +67,7 @@ struct nvmem_cell_info {
unsigned int nbits;
struct device_node *np;
nvmem_cell_post_process_t read_post_process;
+ void *priv;
};
/**