提交 e5905ff1 编写于 作者: C Chuanxiao Dong 提交者: Ulf Hansson

mmc: debugfs: Add a restriction to mmc debugfs clock setting

Clock frequency values written to an mmc host should not be less than
the minimum clock frequency which the mmc host supports.
Signed-off-by: NYuan Juntao <juntaox.yuan@intel.com>
Signed-off-by: NPawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 1d6ad057
......@@ -220,7 +220,7 @@ static int mmc_clock_opt_set(void *data, u64 val)
struct mmc_host *host = data;
/* We need this check due to input value is u64 */
if (val > host->f_max)
if (val != 0 && (val > host->f_max || val < host->f_min))
return -EINVAL;
mmc_claim_host(host);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册