Skip to content

Commit 1b7c298

Browse files
miquelraynalgregkh
authored andcommitted
nvmem: Simplify the ->add_cells() hook
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>
1 parent ec9c08a commit 1b7c298

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

drivers/nvmem/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ static int nvmem_add_cells_from_layout(struct nvmem_device *nvmem)
816816
int ret;
817817

818818
if (layout && layout->add_cells) {
819-
ret = layout->add_cells(&nvmem->dev, nvmem, layout);
819+
ret = layout->add_cells(&nvmem->dev, nvmem);
820820
if (ret)
821821
return ret;
822822
}

drivers/nvmem/layouts/onie-tlv.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ static bool onie_tlv_crc_is_valid(struct device *dev, size_t table_len, u8 *tabl
182182
return true;
183183
}
184184

185-
static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *nvmem,
186-
struct nvmem_layout *layout)
185+
static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *nvmem)
187186
{
188187
struct onie_tlv_hdr hdr;
189188
size_t table_len, data_len, hdr_len;

drivers/nvmem/layouts/sl28vpd.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ static int sl28vpd_v1_check_crc(struct device *dev, struct nvmem_device *nvmem)
8080
return 0;
8181
}
8282

83-
static int sl28vpd_add_cells(struct device *dev, struct nvmem_device *nvmem,
84-
struct nvmem_layout *layout)
83+
static int sl28vpd_add_cells(struct device *dev, struct nvmem_device *nvmem)
8584
{
8685
const struct nvmem_cell_info *pinfo;
8786
struct nvmem_cell_info info = {0};

include/linux/nvmem-provider.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,8 @@ struct nvmem_cell_table {
156156
*
157157
* @name: Layout name.
158158
* @of_match_table: Open firmware match table.
159-
* @add_cells: Will be called if a nvmem device is found which
160-
* has this layout. The function will add layout
161-
* specific cells with nvmem_add_one_cell().
159+
* @add_cells: Called to populate the layout using
160+
* nvmem_add_one_cell().
162161
* @fixup_cell_info: Will be called before a cell is added. Can be
163162
* used to modify the nvmem_cell_info.
164163
* @owner: Pointer to struct module.
@@ -172,8 +171,7 @@ struct nvmem_cell_table {
172171
struct nvmem_layout {
173172
const char *name;
174173
const struct of_device_id *of_match_table;
175-
int (*add_cells)(struct device *dev, struct nvmem_device *nvmem,
176-
struct nvmem_layout *layout);
174+
int (*add_cells)(struct device *dev, struct nvmem_device *nvmem);
177175
void (*fixup_cell_info)(struct nvmem_device *nvmem,
178176
struct nvmem_layout *layout,
179177
struct nvmem_cell_info *cell);

0 commit comments

Comments
 (0)