Unverified Commit f58dcab6 authored by Wei Yongjun's avatar Wei Yongjun Committed by Mark Brown
Browse files

spi: spi-fsl-qspi: Fix return value check of devm_ioremap() in probe



In case of error, the function devm_ioremap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: 858e26a5 ("spi: spi-fsl-qspi: Reduce devm_ioremap size to 4 times AHB buffer size")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarAshish Kumar <Ashish.Kumar@nxp.com>
Acked-by: default avatarHan Xu <han.xu@nxp.com>
Link: https://lore.kernel.org/r/20200422014543.111070-1-weiyongjun1@huawei.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2f5f5302
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -880,8 +880,8 @@ static int fsl_qspi_probe(struct platform_device *pdev)
	/* Since there are 4 cs, map size required is 4 times ahb_buf_size */
	q->ahb_addr = devm_ioremap(dev, q->memmap_phy,
				   (q->devtype_data->ahb_buf_size * 4));
	if (IS_ERR(q->ahb_addr)) {
		ret = PTR_ERR(q->ahb_addr);
	if (!q->ahb_addr) {
		ret = -ENOMEM;
		goto err_put_ctrl;
	}