]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
remoteproc: qcom: wcnss: Fix return value check in wcnss_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Sun, 21 Aug 2016 14:39:30 +0000 (14:39 +0000)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 23 Aug 2016 04:36:43 +0000 (21:36 -0700)
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().

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/remoteproc/qcom_wcnss.c

index 14c458519f84e704882d5954b798374b38be3328..1917de7db91c2d57372cecf906e08bb51cfb55c8 100644 (file)
@@ -528,8 +528,8 @@ static int wcnss_probe(struct platform_device *pdev)
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pmu");
        mmio = devm_ioremap_resource(&pdev->dev, res);
-       if (!mmio) {
-               ret = -ENOMEM;
+       if (IS_ERR(mmio)) {
+               ret = PTR_ERR(mmio);
                goto free_rproc;
        };