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: d166a73503 ("spi: fspi: dynamically alloc AHB memory")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200312113154.GC20562@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Dan Carpenter 2020-03-12 14:31:54 +03:00 committed by Mark Brown
parent b562b304ef
commit 1a421ebab6
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -1019,8 +1019,8 @@ static int nxp_fspi_probe(struct platform_device *pdev)
/* find the resources - controller memory mapped space */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fspi_mmap");
if (IS_ERR(res)) {
ret = PTR_ERR(res);
if (!res) {
ret = -ENODEV;
goto err_put_ctrl;
}