From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-kernel@vger.kernel.org>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Robert Marko" <robert.marko@sartura.hr>,
"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
"Michael Walle" <michael@walle.cc>,
"Rafał Miłecki" <rafal@milecki.pl>,
"Marco Felsch" <m.felsch@pengutronix.de>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Chen-Yu Tsai" <wenst@chromium.org>,
"Daniel Golle" <daniel@makrotopia.org>,
"Miquel Raynal" <miquel.raynal@bootlin.com>
Subject: [PATCH v14 4/8] nvmem: Simplify the ->add_cells() hook
Date: Wed, 29 Nov 2023 17:37:33 +0100 [thread overview]
Message-ID: <20231129163737.698317-5-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20231129163737.698317-1-miquel.raynal@bootlin.com>
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>
---
drivers/nvmem/core.c | 2 +-
drivers/nvmem/layouts/onie-tlv.c | 3 +--
drivers/nvmem/layouts/sl28vpd.c | 3 +--
include/linux/nvmem-provider.h | 8 +++-----
4 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index b5e5ce67398f..f63db5e01fca 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -816,7 +816,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;
}
diff --git a/drivers/nvmem/layouts/onie-tlv.c b/drivers/nvmem/layouts/onie-tlv.c
index 59fc87ccfcff..defd42d4375c 100644
--- a/drivers/nvmem/layouts/onie-tlv.c
+++ b/drivers/nvmem/layouts/onie-tlv.c
@@ -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;
diff --git a/drivers/nvmem/layouts/sl28vpd.c b/drivers/nvmem/layouts/sl28vpd.c
index 05671371f631..26c7cf21b523 100644
--- a/drivers/nvmem/layouts/sl28vpd.c
+++ b/drivers/nvmem/layouts/sl28vpd.c
@@ -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};
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
index e5de21516387..3939991b3c5f 100644
--- a/include/linux/nvmem-provider.h
+++ b/include/linux/nvmem-provider.h
@@ -156,9 +156,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.
@@ -172,8 +171,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);
--
2.34.1
next prev parent reply other threads:[~2023-11-29 16:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 16:37 [PATCH v14 0/8] NVMEM cells in sysfs Miquel Raynal
2023-11-29 16:37 ` [PATCH v14 1/8] of: device: Export of_device_make_bus_id() Miquel Raynal
2023-11-29 16:37 ` [PATCH v14 2/8] nvmem: Move of_nvmem_layout_get_container() in another header Miquel Raynal
2023-11-29 16:37 ` [PATCH v14 3/8] nvmem: Create a header for internal sharing Miquel Raynal
2023-11-29 16:37 ` Miquel Raynal [this message]
2023-11-29 16:37 ` [PATCH v14 5/8] nvmem: Move and rename ->fixup_cell_info() Miquel Raynal
2023-11-29 16:37 ` [PATCH v14 6/8] nvmem: core: Rework layouts to become regular devices Miquel Raynal
2023-11-29 16:37 ` [PATCH v14 7/8] ABI: sysfs-nvmem-cells: Expose cells through sysfs Miquel Raynal
2023-11-29 16:37 ` [PATCH v14 8/8] nvmem: core: " Miquel Raynal
2023-12-05 14:46 ` [PATCH v14 0/8] NVMEM cells in sysfs Luca Ceresoli
2023-12-08 10:47 ` Srinivas Kandagatla
2023-12-08 12:05 ` Miquel Raynal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231129163737.698317-5-miquel.raynal@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=daniel@makrotopia.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=m.felsch@pengutronix.de \
--cc=michael@walle.cc \
--cc=rafal@milecki.pl \
--cc=rdunlap@infradead.org \
--cc=robert.marko@sartura.hr \
--cc=srinivas.kandagatla@linaro.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=wenst@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®