ASoC: amd: fix an IS_ERR() vs NULL bug in probe

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

Fixes: e550339ee6 ("ASoC: amd: add vangogh i2s controller driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210727081756.GA19121@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Dan Carpenter 2021-07-27 11:17:56 +03:00 committed by Mark Brown
parent 89d751d8f9
commit 37108ef45a
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 2 additions and 2 deletions

View File

@ -399,8 +399,8 @@ static int acp5x_dai_probe(struct platform_device *pdev)
} }
adata->acp5x_base = devm_ioremap(&pdev->dev, res->start, adata->acp5x_base = devm_ioremap(&pdev->dev, res->start,
resource_size(res)); resource_size(res));
if (IS_ERR(adata->acp5x_base)) if (!adata->acp5x_base)
return PTR_ERR(adata->acp5x_base); return -ENOMEM;
adata->master_mode = I2S_MASTER_MODE_ENABLE; adata->master_mode = I2S_MASTER_MODE_ENABLE;
dev_set_drvdata(&pdev->dev, adata); dev_set_drvdata(&pdev->dev, adata);