From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 4/5] nvmem: add nvmem_device_get_device()
Date: Mon, 11 Mar 2024 11:21:51 +0100 [thread overview]
Message-ID: <20240311102152.360762-4-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20240311102152.360762-1-s.hauer@pengutronix.de>
We'll want to add a device parameter to the imx_ocotp0 device in the
next step, but the device is private to the nvmem core. Add a getter
function for it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/nvmem/core.c | 6 ++++++
include/linux/nvmem-provider.h | 5 +++++
2 files changed, 11 insertions(+)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 67bb1d7993..ad145a4242 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -858,3 +858,9 @@ int nvmem_cell_read_variable_le_u32(struct device *dev, const char *cell_id,
return 0;
}
EXPORT_SYMBOL_GPL(nvmem_cell_read_variable_le_u32);
+
+struct device *nvmem_device_get_device(struct nvmem_device *nvmem)
+{
+ return &nvmem->dev;
+}
+EXPORT_SYMBOL_GPL(nvmem_device_get_device);
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
index 3c30e18409..b3b4372d30 100644
--- a/include/linux/nvmem-provider.h
+++ b/include/linux/nvmem-provider.h
@@ -48,6 +48,7 @@ struct nvmem_device *nvmem_regmap_register(struct regmap *regmap, const char *na
struct nvmem_device *nvmem_regmap_register_with_pp(struct regmap *regmap,
const char *name, nvmem_cell_post_process_t cell_post_process);
struct nvmem_device *nvmem_partition_register(struct cdev *cdev);
+struct device *nvmem_device_get_device(struct nvmem_device *nvmem);
#else
@@ -73,5 +74,9 @@ static inline struct nvmem_device *nvmem_partition_register(struct cdev *cdev)
return ERR_PTR(-ENOSYS);
}
+static struct device *nvmem_device_get_device(struct nvmem_device *nvmem)
+{
+ return ERR_PTR(-ENOSYS);
+}
#endif /* CONFIG_NVMEM */
#endif /* ifndef _LINUX_NVMEM_PROVIDER_H */
--
2.39.2
next prev parent reply other threads:[~2024-03-11 10:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 10:21 [PATCH 1/5] ARM: i.MX: ele: move ELE_READ_SHADOW_REQ definition Sascha Hauer
2024-03-11 10:21 ` [PATCH 2/5] ARM: i.MX: ele: add function comments Sascha Hauer
2024-03-11 10:21 ` [PATCH 3/5] ARM: i.MX: ele: add ele_write_shadow_fuse Sascha Hauer
2024-03-11 10:21 ` Sascha Hauer [this message]
2024-03-11 10:21 ` [PATCH 5/5] nvmem: imx-ocotp-ele: implement permanent write support Sascha Hauer
2024-03-13 7:42 ` [PATCH 1/5] ARM: i.MX: ele: move ELE_READ_SHADOW_REQ definition Sascha Hauer
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=20240311102152.360762-4-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.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