Commit 1a421eba authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown

spi: spi-nxp-fspi: Fix a NULL vs IS_ERR() check in probe

The platform_get_resource_byname() function returns NULL on error, it
doesn't return error pointers.

Fixes: d166a735 ("spi: fspi: dynamically alloc AHB memory")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200312113154.GC20562@mwandaSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b562b304
...@@ -1019,8 +1019,8 @@ static int nxp_fspi_probe(struct platform_device *pdev) ...@@ -1019,8 +1019,8 @@ static int nxp_fspi_probe(struct platform_device *pdev)
/* find the resources - controller memory mapped space */ /* find the resources - controller memory mapped space */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fspi_mmap"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fspi_mmap");
if (IS_ERR(res)) { if (!res) {
ret = PTR_ERR(res); ret = -ENODEV;
goto err_put_ctrl; goto err_put_ctrl;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment