[PATCH v2] nvmem: meson-mx-efuse: Remove nvmem_device from efuse struct

Mukesh Ojha posted 1 patch 1 year, 9 months ago
drivers/nvmem/meson-mx-efuse.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH v2] nvmem: meson-mx-efuse: Remove nvmem_device from efuse struct
Posted by Mukesh Ojha 1 year, 9 months ago
nvmem_device is used at one place while registering nvmem
device and it is not required to be present in efuse struct
for just this purpose.

Drop nvmem_device and manage with nvmem device stack variable.

Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
Changes in v2:
 - Fixed compilation issue.

 drivers/nvmem/meson-mx-efuse.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nvmem/meson-mx-efuse.c b/drivers/nvmem/meson-mx-efuse.c
index 3ff04d5ca8f8..8a16f5f02657 100644
--- a/drivers/nvmem/meson-mx-efuse.c
+++ b/drivers/nvmem/meson-mx-efuse.c
@@ -43,7 +43,6 @@ struct meson_mx_efuse_platform_data {
 struct meson_mx_efuse {
 	void __iomem *base;
 	struct clk *core_clk;
-	struct nvmem_device *nvmem;
 	struct nvmem_config config;
 };
 
@@ -193,6 +192,7 @@ static int meson_mx_efuse_probe(struct platform_device *pdev)
 {
 	const struct meson_mx_efuse_platform_data *drvdata;
 	struct meson_mx_efuse *efuse;
+	struct nvmem_device *nvmem;
 
 	drvdata = of_device_get_match_data(&pdev->dev);
 	if (!drvdata)
@@ -223,9 +223,9 @@ static int meson_mx_efuse_probe(struct platform_device *pdev)
 		return PTR_ERR(efuse->core_clk);
 	}
 
-	efuse->nvmem = devm_nvmem_register(&pdev->dev, &efuse->config);
+	nvmem = devm_nvmem_register(&pdev->dev, &efuse->config);
 
-	return PTR_ERR_OR_ZERO(efuse->nvmem);
+	return PTR_ERR_OR_ZERO(nvmem);
 }
 
 static struct platform_driver meson_mx_efuse_driver = {
-- 
2.7.4
Re: [PATCH v2] nvmem: meson-mx-efuse: Remove nvmem_device from efuse struct
Posted by Srinivas Kandagatla 1 year, 8 months ago
On Tue, 12 Mar 2024 21:37:43 +0530, Mukesh Ojha wrote:
> nvmem_device is used at one place while registering nvmem
> device and it is not required to be present in efuse struct
> for just this purpose.
> 
> Drop nvmem_device and manage with nvmem device stack variable.
> 
> 
> [...]

Applied, thanks!

[1/1] nvmem: meson-mx-efuse: Remove nvmem_device from efuse struct
      commit: 9e29a1dba59bcef937af7015e53d113309f49231

Best regards,
-- 
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Re: [PATCH v2] nvmem: meson-mx-efuse: Remove nvmem_device from efuse struct
Posted by Martin Blumenstingl 1 year, 9 months ago
On Tue, Mar 12, 2024 at 5:08 PM Mukesh Ojha <quic_mojha@quicinc.com> wrote:
>
> nvmem_device is used at one place while registering nvmem
> device and it is not required to be present in efuse struct
> for just this purpose.
>
> Drop nvmem_device and manage with nvmem device stack variable.
>
> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>