summaryrefslogtreecommitdiffstats
path: root/sound/soc/sprd/sprd-mcdt.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2019-04-29 14:25:12 +0200
committerMark Brown <broonie@kernel.org>2019-05-02 04:01:17 +0200
commit7c88b92816dfe5eab224b96577b50ac00b4be68a (patch)
tree4a930f4b51e5d77faebdc27ba3a87f0df5d57c7e /sound/soc/sprd/sprd-mcdt.c
parentASoC: fsl_audmix: cache pdev->dev pointer (diff)
downloadlinux-7c88b92816dfe5eab224b96577b50ac00b4be68a.tar.xz
linux-7c88b92816dfe5eab224b96577b50ac00b4be68a.zip
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: d7bff893e04f ("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>
Diffstat (limited to 'sound/soc/sprd/sprd-mcdt.c')
-rw-r--r--sound/soc/sprd/sprd-mcdt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/sprd/sprd-mcdt.c b/sound/soc/sprd/sprd-mcdt.c
index 28f5e649733d..e9318d7a4810 100644
--- a/sound/soc/sprd/sprd-mcdt.c
+++ b/sound/soc/sprd/sprd-mcdt.c
@@ -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);