phy: qcom-qmp: fix return value check in qcom_qmp_phy_create()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 25 Apr 2017 03:14:54 +0000 (03:14 +0000)
committerKishon Vijay Abraham I <kishon@ti.com>
Fri, 19 May 2017 08:43:39 +0000 (14:13 +0530)
In case of error, the function of_iomap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.

Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-qcom-qmp.c

index 727e23be7cac40cfff7ac7103fcf75e6e176c420..a25c29d5fdf6afd3be0370b44dd473928896fd04 100644 (file)
@@ -983,16 +983,16 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id)
         * Resources are indexed as: tx -> 0; rx -> 1; pcs -> 2.
         */
        qphy->tx = of_iomap(np, 0);
-       if (IS_ERR(qphy->tx))
-               return PTR_ERR(qphy->tx);
+       if (!qphy->tx)
+               return -ENOMEM;
 
        qphy->rx = of_iomap(np, 1);
-       if (IS_ERR(qphy->rx))
-               return PTR_ERR(qphy->rx);
+       if (!qphy->rx)
+               return -ENOMEM;
 
        qphy->pcs = of_iomap(np, 2);
-       if (IS_ERR(qphy->pcs))
-               return PTR_ERR(qphy->pcs);
+       if (!qphy->pcs)
+               return -ENOMEM;
 
        /*
         * Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3