]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: SOF: imx8: Fix return value check in imx8_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 26 Aug 2019 12:00:03 +0000 (12:00 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 27 Aug 2019 18:21:54 +0000 (19:21 +0100)
In case of error, the function devm_ioremap_wc() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: f8612cb94e5f ("ASoC: SOF: imx: Add i.MX8 HW support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20190826120003.183279-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/imx/imx8.c

index 640472491037f39c78a474e66b32b31e3316355a..c9d849ced54a8ed83e1beaba5f82a43aa9c2441a 100644 (file)
@@ -296,10 +296,10 @@ static int imx8_probe(struct snd_sof_dev *sdev)
        sdev->bar[SOF_FW_BLK_TYPE_SRAM] = devm_ioremap_wc(sdev->dev, res.start,
                                                          res.end - res.start +
                                                          1);
-       if (IS_ERR(sdev->bar[SOF_FW_BLK_TYPE_SRAM])) {
+       if (!sdev->bar[SOF_FW_BLK_TYPE_SRAM]) {
                dev_err(sdev->dev, "failed to ioremap mem 0x%x size 0x%x\n",
                        base, size);
-               ret = PTR_ERR(sdev->bar[SOF_FW_BLK_TYPE_SRAM]);
+               ret = -ENOMEM;
                goto exit_pdev_unregister;
        }
        sdev->mailbox_bar = SOF_FW_BLK_TYPE_SRAM;