diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 5dd9ae2f3489..37702dc41532 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1024,11 +1024,18 @@ static int _set_opp_level(struct device *dev, struct opp_table *opp_table, level = opp->level; } - /* Request a new performance state through the device's PM domain. */ - ret = dev_pm_genpd_set_performance_state(dev, level); - if (ret) - dev_err(dev, "Failed to set performance state %u (%d)\n", level, - ret); + /* + * This function should be a nop for devices without a PM domain. However, + * dev_pm_genpd_set_performance_state() returns an error for devices without a PM domain + * instead of returning immediately. + */ + if (dev->pm_domain) { + /* Request a new performance state through the device's PM domain. */ + ret = dev_pm_genpd_set_performance_state(dev, level); + if (ret) + dev_err(dev, "Failed to set performance state %u (%d)\n", level, + ret); + } return ret; }