提交 3f27b59f 编写于 作者: L Leonard Crestez 提交者: Yang Yingliang

PM / devfreq: Fix devfreq_notifier_call returning errno

[ Upstream commit e876e710ede23f670494331e062d643928e4142a ]

Notifier callbacks shouldn't return negative errno but one of the
NOTIFY_OK/DONE/BAD values.

The OPP core will ignore return values from notifiers but returning a
value that matches NOTIFY_STOP_MASK will stop the notification chain.

Fix by always returning NOTIFY_OK.
Signed-off-by: NLeonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: NMatthias Kaehlcke <mka@chromium.org>
Reviewed-by: NChanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 dce59b97
...@@ -538,26 +538,28 @@ static int devfreq_notifier_call(struct notifier_block *nb, unsigned long type, ...@@ -538,26 +538,28 @@ static int devfreq_notifier_call(struct notifier_block *nb, unsigned long type,
void *devp) void *devp)
{ {
struct devfreq *devfreq = container_of(nb, struct devfreq, nb); struct devfreq *devfreq = container_of(nb, struct devfreq, nb);
int ret; int err = -EINVAL;
mutex_lock(&devfreq->lock); mutex_lock(&devfreq->lock);
devfreq->scaling_min_freq = find_available_min_freq(devfreq); devfreq->scaling_min_freq = find_available_min_freq(devfreq);
if (!devfreq->scaling_min_freq) { if (!devfreq->scaling_min_freq)
mutex_unlock(&devfreq->lock); goto out;
return -EINVAL;
}
devfreq->scaling_max_freq = find_available_max_freq(devfreq); devfreq->scaling_max_freq = find_available_max_freq(devfreq);
if (!devfreq->scaling_max_freq) { if (!devfreq->scaling_max_freq)
mutex_unlock(&devfreq->lock); goto out;
return -EINVAL;
} err = update_devfreq(devfreq);
ret = update_devfreq(devfreq); out:
mutex_unlock(&devfreq->lock); mutex_unlock(&devfreq->lock);
if (err)
dev_err(devfreq->dev.parent,
"failed to update frequency from OPP notifier (%d)\n",
err);
return ret; return NOTIFY_OK;
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册