提交 4ea9496c 编写于 作者: T Tang Bin 提交者: Viresh Kumar

opp: Fix error check in dev_pm_opp_attach_genpd()

dev_pm_domain_attach_by_name() may return NULL in some cases,
so IS_ERR() doesn't meet the requirements. Thus fix it.

Fixes: 6319aee1 ("opp: Attach genpds to devices from within OPP core")
Signed-off-by: NTang Bin <tangbin@cmss.chinamobile.com>
[ Viresh: Replace ENODATA with ENODEV ]
Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
上级 f2906aa8
...@@ -2528,8 +2528,8 @@ struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, ...@@ -2528,8 +2528,8 @@ struct opp_table *dev_pm_opp_attach_genpd(struct device *dev,
} }
virt_dev = dev_pm_domain_attach_by_name(dev, *name); virt_dev = dev_pm_domain_attach_by_name(dev, *name);
if (IS_ERR(virt_dev)) { if (IS_ERR_OR_NULL(virt_dev)) {
ret = PTR_ERR(virt_dev); ret = PTR_ERR(virt_dev) ? : -ENODEV;
dev_err(dev, "Couldn't attach to pm_domain: %d\n", ret); dev_err(dev, "Couldn't attach to pm_domain: %d\n", ret);
goto err; goto err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册