diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-03-12 12:31:54 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-03-12 16:09:58 +0100 |
commit | 1a421ebab6bb5bf65001743ba9fef48e94fb345a (patch) | |
tree | c3481daf1b88da5db21a399128dc6184b825631a | |
parent | Merge tag 'mtk-mtd-spi-move' of https://git.kernel.org/pub/scm/linux/kernel/g... (diff) | |
download | linux-1a421ebab6bb5bf65001743ba9fef48e94fb345a.tar.xz linux-1a421ebab6bb5bf65001743ba9fef48e94fb345a.zip |
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>
-rw-r--r-- | drivers/spi/spi-nxp-fspi.c | 4 |
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; } |