Skip to content

Commit

Permalink
spi: sprd-adi: checking for NULL instead of IS_ERR()
Browse files Browse the repository at this point in the history
devm_ioremap_resource() returns error pointers, it never returns NULL.

Fixes: 7e2903c ("spi: Add ADI driver for Spreadtrum platform")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Dan Carpenter authored and Mark Brown committed Sep 25, 2017
1 parent 7e2903c commit 04063a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-sprd-adi.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ static int sprd_adi_probe(struct platform_device *pdev)

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
sadi->base = devm_ioremap_resource(&pdev->dev, res);
if (!sadi->base) {
ret = -ENOMEM;
if (IS_ERR(sadi->base)) {
ret = PTR_ERR(sadi->base);
goto put_ctlr;
}

Expand Down

0 comments on commit 04063a0

Please sign in to comment.