]> git.itanic.dy.fi Git - linux-stable/commitdiff
nvmem: core: move struct nvmem_cell_info to nvmem-provider.h
authorMichael Walle <michael@walle.cc>
Mon, 6 Feb 2023 13:43:47 +0000 (13:43 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Feb 2023 18:06:59 +0000 (19:06 +0100)
struct nvmem_cell_info is used to describe a cell. Thus this should
really be in the nvmem-provider's header. There are two (unused) nvmem
access methods which use the nvmem_cell_info to describe the cell to be
accesses. One can argue, that they will create a cell before accessing,
thus they are both a provider and a consumer.

struct nvmem_cell_info will get used more and more by nvmem-providers,
don't force them to also include the consumer header, although they are
not.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230206134356.839737-14-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/nvmem-consumer.h
include/linux/nvmem-provider.h

index 980f9c9ac0bc6d5689b1a152871e4be40ab31312..1f62f7ba71ca541ba422b708010ad2984e215f04 100644 (file)
@@ -18,15 +18,7 @@ struct device_node;
 /* consumer cookie */
 struct nvmem_cell;
 struct nvmem_device;
-
-struct nvmem_cell_info {
-       const char              *name;
-       unsigned int            offset;
-       unsigned int            bytes;
-       unsigned int            bit_offset;
-       unsigned int            nbits;
-       struct device_node      *np;
-};
+struct nvmem_cell_info;
 
 /**
  * struct nvmem_cell_lookup - cell lookup entry
index 55181d8379697bbe1ab8cea13b1f6ddd5faeb6fa..a953a3a595356e2f1b4e9c4beadfdcdec583071e 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/gpio/consumer.h>
 
 struct nvmem_device;
-struct nvmem_cell_info;
 typedef int (*nvmem_reg_read_t)(void *priv, unsigned int offset,
                                void *val, size_t bytes);
 typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset,
@@ -47,6 +46,24 @@ struct nvmem_keepout {
        unsigned char value;
 };
 
+/**
+ * struct nvmem_cell_info - NVMEM cell description
+ * @name:      Name.
+ * @offset:    Offset within the NVMEM device.
+ * @bytes:     Length of the cell.
+ * @bit_offset:        Bit offset if cell is smaller than a byte.
+ * @nbits:     Number of bits.
+ * @np:                Optional device_node pointer.
+ */
+struct nvmem_cell_info {
+       const char              *name;
+       unsigned int            offset;
+       unsigned int            bytes;
+       unsigned int            bit_offset;
+       unsigned int            nbits;
+       struct device_node      *np;
+};
+
 /**
  * struct nvmem_config - NVMEM device configuration
  *