aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/devfreq/devfreq.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-10-27 20:40:17 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-10-27 20:40:17 +0200
commit031eda1840ffd819acbf2c0c1ea7d541d5d647ca (patch)
tree9286f02a87eeca28f1b7e819125fa43b30e8f5ce /drivers/devfreq/devfreq.c
parentLinux 5.15-rc7 (diff)
parentPM / devfreq: Strengthen check for freq_table (diff)
downloadlinux-rng-031eda1840ffd819acbf2c0c1ea7d541d5d647ca.tar.xz
linux-rng-031eda1840ffd819acbf2c0c1ea7d541d5d647ca.zip
Merge tag 'devfreq-next-for-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux
Pull devfreq updates for v5.16 from Chanwoo Choi: "1. Minor update for exynos-ppmu devfreq-event driver - Devicetree naming convention requires the device node names to use hyphens instead of underlines. In order to support this requirement, changes the code with hyphens. - Simplify parsing event-type from devicetree without behavior changes. 2. Strengthen check for freq_table in devfreq core - Check whether both freq_table is not NULL and size of freq_table is not zero in order to prevent the error by mistake of devfreq driver developer. * tag 'devfreq-next-for-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux: PM / devfreq: Strengthen check for freq_table devfreq: exynos-ppmu: simplify parsing event-type from DT devfreq: exynos-ppmu: use node names with hyphens
Diffstat (limited to 'drivers/devfreq/devfreq.c')
-rw-r--r--drivers/devfreq/devfreq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 85faa7a5c7d1..06333d430382 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -827,7 +827,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
goto err_dev;
}
- if (!devfreq->profile->max_state && !devfreq->profile->freq_table) {
+ if (!devfreq->profile->max_state || !devfreq->profile->freq_table) {
mutex_unlock(&devfreq->lock);
err = set_freq_table(devfreq);
if (err < 0)