summaryrefslogtreecommitdiff
path: root/drivers/interconnect
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2020-05-10 18:30:37 +0300
committerGeorgi Djakov <georgi.djakov@linaro.org>2020-05-10 18:30:37 +0300
commit360a10285e7e2722f6869f5dc8e81214a72b57f6 (patch)
tree41c05cf44cbd4d4854395904e084bb4aedd5f987 /drivers/interconnect
parent4b54bf4763e3725dcceaac379df4ef78df3b9fcd (diff)
interconnect: imx: Fix return value check in imx_icc_node_init_qos()
In case of error, the function of_parse_phandle() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: f0d8048525d7 ("interconnect: Add imx core driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com> Link: https://lore.kernel.org/r/20200509030214.14435-1-weiyongjun1@huawei.com Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Diffstat (limited to 'drivers/interconnect')
-rw-r--r--drivers/interconnect/imx/imx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/interconnect/imx/imx.c b/drivers/interconnect/imx/imx.c
index 6884212511f0..ac420f86008e 100644
--- a/drivers/interconnect/imx/imx.c
+++ b/drivers/interconnect/imx/imx.c
@@ -90,10 +90,10 @@ static int imx_icc_node_init_qos(struct icc_provider *provider,
node->name, node->id);
} else {
dn = of_parse_phandle(dev->of_node, adj->phandle_name, 0);
- if (IS_ERR(dn)) {
- dev_warn(dev, "Failed to parse %s: %ld\n",
- adj->phandle_name, PTR_ERR(dn));
- return PTR_ERR(dn);
+ if (!dn) {
+ dev_warn(dev, "Failed to parse %s\n",
+ adj->phandle_name);
+ return -ENODEV;
}
/* Allow scaling to be disabled on a per-node basis */
if (!dn || !of_device_is_available(dn)) {