]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nvmem: Simplify the ->add_cells() hook
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 15 Dec 2023 11:15:30 +0000 (11:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Feb 2025 12:10:47 +0000 (04:10 -0800)
[ Upstream commit 1b7c298a4ecbc28cc6ee94005734bff55eb83d22 ]

The layout entry is not used and will anyway be made useless by the new
layout bus infrastructure coming next, so drop it. While at it, clarify
the kdoc entry.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20231215111536.316972-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 391b06ecb63e ("nvmem: imx-ocotp-ele: fix MAC address byte order")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvmem/core.c
drivers/nvmem/layouts/onie-tlv.c
drivers/nvmem/layouts/sl28vpd.c
include/linux/nvmem-provider.h

index ec35886e921a8eec3b9b4ddc90ad847fc6976fae..ed8a1cba361e2ec84c6d56e30a6c5610305fefd7 100644 (file)
@@ -815,7 +815,7 @@ static int nvmem_add_cells_from_layout(struct nvmem_device *nvmem)
        int ret;
 
        if (layout && layout->add_cells) {
-               ret = layout->add_cells(&nvmem->dev, nvmem, layout);
+               ret = layout->add_cells(&nvmem->dev, nvmem);
                if (ret)
                        return ret;
        }
index 59fc87ccfcffeb430d7a9294d01db8fd3b454ec2..defd42d4375cc16be409453f60e11c3fee62e778 100644 (file)
@@ -182,8 +182,7 @@ static bool onie_tlv_crc_is_valid(struct device *dev, size_t table_len, u8 *tabl
        return true;
 }
 
-static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *nvmem,
-                               struct nvmem_layout *layout)
+static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *nvmem)
 {
        struct onie_tlv_hdr hdr;
        size_t table_len, data_len, hdr_len;
index 05671371f63166edb28231ef12747fe40d22913d..26c7cf21b523364da542a9057f94d636b402f6d1 100644 (file)
@@ -80,8 +80,7 @@ static int sl28vpd_v1_check_crc(struct device *dev, struct nvmem_device *nvmem)
        return 0;
 }
 
-static int sl28vpd_add_cells(struct device *dev, struct nvmem_device *nvmem,
-                            struct nvmem_layout *layout)
+static int sl28vpd_add_cells(struct device *dev, struct nvmem_device *nvmem)
 {
        const struct nvmem_cell_info *pinfo;
        struct nvmem_cell_info info = {0};
index 1b81adebdb8beb366faefcd828d75381f12774f0..ecd580ee84db9f22604b731b6cf5b78923b73b7f 100644 (file)
@@ -158,9 +158,8 @@ struct nvmem_cell_table {
  *
  * @name:              Layout name.
  * @of_match_table:    Open firmware match table.
- * @add_cells:         Will be called if a nvmem device is found which
- *                     has this layout. The function will add layout
- *                     specific cells with nvmem_add_one_cell().
+ * @add_cells:         Called to populate the layout using
+ *                     nvmem_add_one_cell().
  * @fixup_cell_info:   Will be called before a cell is added. Can be
  *                     used to modify the nvmem_cell_info.
  * @owner:             Pointer to struct module.
@@ -174,8 +173,7 @@ struct nvmem_cell_table {
 struct nvmem_layout {
        const char *name;
        const struct of_device_id *of_match_table;
-       int (*add_cells)(struct device *dev, struct nvmem_device *nvmem,
-                        struct nvmem_layout *layout);
+       int (*add_cells)(struct device *dev, struct nvmem_device *nvmem);
        void (*fixup_cell_info)(struct nvmem_device *nvmem,
                                struct nvmem_layout *layout,
                                struct nvmem_cell_info *cell);