Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8aae26f authored by Lucas Stach's avatar Lucas Stach Committed by Greg Kroah-Hartman
Browse files

nvmem: imx-ocotp: reset error status on probe



[ Upstream commit c33c585f1b3a99d53920bdac614aca461d8db06f ]

If software running before the OCOTP driver is loaded left the
controller with the error status pending, the driver will never
be able to complete the read timing setup. Reset the error status
on probe to make sure the controller is in usable state.

Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20191029114240.14905-6-srinivas.kandagatla@linaro.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0613a3b9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -466,6 +466,10 @@ static int imx_ocotp_probe(struct platform_device *pdev)
	if (IS_ERR(priv->clk))
		return PTR_ERR(priv->clk);

	clk_prepare_enable(priv->clk);
	imx_ocotp_clr_err_if_set(priv->base);
	clk_disable_unprepare(priv->clk);

	priv->params = of_device_get_match_data(&pdev->dev);
	imx_ocotp_nvmem_config.size = 4 * priv->params->nregs;
	imx_ocotp_nvmem_config.dev = dev;