[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230727170414.18737-1-ruc_gongyuanjun@163.com>
Date: Fri, 28 Jul 2023 01:04:14 +0800
From: Yuanjun Gong <ruc_gongyuanjun@....com>
To: NXP Linux Team <linux-imx@....com>,
Lucas Stach <l.stach@...gutronix.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Cc: Yuanjun Gong <ruc_gongyuanjun@....com>
Subject: [PATCH 1/1] nvmem: imx-ocotp: fix value check in imx_ocotp_probe()
in imx_ocotp_probe(), check the return value of clk_prepare_enable()
and return the error code if clk_prepare_enable() returns an
unexpected value.
Fixes: c33c585f1b3a ("nvmem: imx-ocotp: reset error status on probe")
Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@....com>
---
drivers/nvmem/imx-ocotp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c
index ab556c011f3e..c4d604256862 100644
--- a/drivers/nvmem/imx-ocotp.c
+++ b/drivers/nvmem/imx-ocotp.c
@@ -600,6 +600,7 @@ static int imx_ocotp_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct ocotp_priv *priv;
struct nvmem_device *nvmem;
+ int ret;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
@@ -623,7 +624,9 @@ static int imx_ocotp_probe(struct platform_device *pdev)
priv->config = &imx_ocotp_nvmem_config;
- clk_prepare_enable(priv->clk);
+ ret = clk_prepare_enable(priv->clk);
+ if (ret)
+ return ret;
imx_ocotp_clr_err_if_set(priv);
clk_disable_unprepare(priv->clk);
--
2.17.1
Powered by blists - more mailing lists