opp: Fix error check in dev_pm_opp_attach_genpd()
[ Upstream commit4ea9496cbc] dev_pm_domain_attach_by_name() may return NULL in some cases, so IS_ERR() doesn't meet the requirements. Thus fix it. Fixes:6319aee10e("opp: Attach genpds to devices from within OPP core") Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> [ Viresh: Replace ENODATA with ENODEV ] Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0edd9f8d13
commit
13741bb88a
@ -2388,8 +2388,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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user