summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-nxp-fspi.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-03-12 14:31:54 +0300
committerMark Brown <broonie@kernel.org>2020-03-12 15:09:58 +0000
commit1a421ebab6bb5bf65001743ba9fef48e94fb345a (patch)
treec3481daf1b88da5db21a399128dc6184b825631a /drivers/spi/spi-nxp-fspi.c
parentb562b304efc0922d1ef9e7d5b9d333db7497f81a (diff)
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: d166a73503ef ("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>
Diffstat (limited to 'drivers/spi/spi-nxp-fspi.c')
-rw-r--r--drivers/spi/spi-nxp-fspi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index 019f40e2917c..1ccda82da206 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -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;
}