Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53bf9590 authored by Wei Yongjun's avatar Wei Yongjun Committed by Kishon Vijay Abraham I
Browse files

phy: qcom-qmp: fix return value check in qcom_qmp_phy_create()



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: e78f3d15 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
Reviewed-by: default avatarVivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent 2ea659a9
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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