* [PATCH] spi: cadence-quadspi: Fix error return code in cqspi_probe
@ 2020-11-16 14:10 Zhihao Cheng
2020-11-16 14:11 ` Philipp Zabel
0 siblings, 1 reply; 2+ messages in thread
From: Zhihao Cheng @ 2020-11-16 14:10 UTC (permalink / raw)
To: broonie, p.zabel, tudor.ambarus, vadivel.muruganx.ramuthevar, vigneshr
Cc: linux-spi, linux-kernel, chengzhihao1, yi.zhang
Fix to return the error code from
devm_reset_control_get_optional_exclusive() instaed of 0
in cqspi_probe().
Fixes: 31fb632b5d43ca ("spi: Move cadence-quadspi driver to drivers/spi/")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
---
drivers/spi/spi-cadence-quadspi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 40938cf3806d..22d7158edb71 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1260,12 +1260,14 @@ static int cqspi_probe(struct platform_device *pdev)
/* Obtain QSPI reset control */
rstc = devm_reset_control_get_optional_exclusive(dev, "qspi");
if (IS_ERR(rstc)) {
+ ret = PTR_ERR(rstc);
dev_err(dev, "Cannot get QSPI reset.\n");
goto probe_reset_failed;
}
rstc_ocp = devm_reset_control_get_optional_exclusive(dev, "qspi-ocp");
if (IS_ERR(rstc_ocp)) {
+ ret = PTR_ERR(rstc);
dev_err(dev, "Cannot get QSPI OCP reset.\n");
goto probe_reset_failed;
}
--
2.25.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: cadence-quadspi: Fix error return code in cqspi_probe
2020-11-16 14:10 [PATCH] spi: cadence-quadspi: Fix error return code in cqspi_probe Zhihao Cheng
@ 2020-11-16 14:11 ` Philipp Zabel
0 siblings, 0 replies; 2+ messages in thread
From: Philipp Zabel @ 2020-11-16 14:11 UTC (permalink / raw)
To: Zhihao Cheng, broonie, tudor.ambarus,
vadivel.muruganx.ramuthevar, vigneshr
Cc: linux-spi, linux-kernel, yi.zhang
Hi Zhihao,
On Mon, 2020-11-16 at 22:10 +0800, Zhihao Cheng wrote:
> Fix to return the error code from
> devm_reset_control_get_optional_exclusive() instaed of 0
> in cqspi_probe().
>
> Fixes: 31fb632b5d43ca ("spi: Move cadence-quadspi driver to drivers/spi/")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
> ---
> drivers/spi/spi-cadence-quadspi.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
> index 40938cf3806d..22d7158edb71 100644
> --- a/drivers/spi/spi-cadence-quadspi.c
> +++ b/drivers/spi/spi-cadence-quadspi.c
> @@ -1260,12 +1260,14 @@ static int cqspi_probe(struct platform_device *pdev)
> /* Obtain QSPI reset control */
> rstc = devm_reset_control_get_optional_exclusive(dev, "qspi");
> if (IS_ERR(rstc)) {
> + ret = PTR_ERR(rstc);
> dev_err(dev, "Cannot get QSPI reset.\n");
> goto probe_reset_failed;
> }
>
> rstc_ocp = devm_reset_control_get_optional_exclusive(dev, "qspi-ocp");
> if (IS_ERR(rstc_ocp)) {
> + ret = PTR_ERR(rstc);
This should be
ret = PTR_ERR(rstc_ocp);
instead.
regards
Philipp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-16 14:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 14:10 [PATCH] spi: cadence-quadspi: Fix error return code in cqspi_probe Zhihao Cheng
2020-11-16 14:11 ` Philipp Zabel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).