Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Miquel Raynal and committed by
Greg Kroah-Hartman
1b7c298a ec9c08a1

+6 -10
+1 -1
drivers/nvmem/core.c
··· 816 816 int ret; 817 817 818 818 if (layout && layout->add_cells) { 819 - ret = layout->add_cells(&nvmem->dev, nvmem, layout); 819 + ret = layout->add_cells(&nvmem->dev, nvmem); 820 820 if (ret) 821 821 return ret; 822 822 }
+1 -2
drivers/nvmem/layouts/onie-tlv.c
··· 182 182 return true; 183 183 } 184 184 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) 187 186 { 188 187 struct onie_tlv_hdr hdr; 189 188 size_t table_len, data_len, hdr_len;
+1 -2
drivers/nvmem/layouts/sl28vpd.c
··· 80 80 return 0; 81 81 } 82 82 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) 85 84 { 86 85 const struct nvmem_cell_info *pinfo; 87 86 struct nvmem_cell_info info = {0};
+3 -5
include/linux/nvmem-provider.h
··· 156 156 * 157 157 * @name: Layout name. 158 158 * @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(). 162 161 * @fixup_cell_info: Will be called before a cell is added. Can be 163 162 * used to modify the nvmem_cell_info. 164 163 * @owner: Pointer to struct module. ··· 171 172 struct nvmem_layout { 172 173 const char *name; 173 174 const struct of_device_id *of_match_table; 174 - int (*add_cells)(struct device *dev, struct nvmem_device *nvmem, 175 - struct nvmem_layout *layout); 175 + int (*add_cells)(struct device *dev, struct nvmem_device *nvmem); 176 176 void (*fixup_cell_info)(struct nvmem_device *nvmem, 177 177 struct nvmem_layout *layout, 178 178 struct nvmem_cell_info *cell);