ASoC: sprd: Fix return value check in sprd_mcdt_probe()

In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Fixes: d7bff893e0 ("ASoC: sprd: Add Spreadtrum multi-channel data transfer support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Wei Yongjun 2019-04-29 12:25:12 +00:00 committed by Mark Brown
parent 62be484f7a
commit 7c88b92816
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 2 additions and 2 deletions

View File

@ -951,8 +951,8 @@ static int sprd_mcdt_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
mcdt->base = devm_ioremap_resource(&pdev->dev, res);
if (!mcdt->base)
return -ENOMEM;
if (IS_ERR(mcdt->base))
return PTR_ERR(mcdt->base);
mcdt->dev = &pdev->dev;
spin_lock_init(&mcdt->lock);