Skip to content

Commit

Permalink
mmc: debugfs: Add a restriction to mmc debugfs clock setting
Browse files Browse the repository at this point in the history
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: Yuan Juntao <juntaox.yuan@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Chuanxiao Dong authored and Ulf Hansson committed Feb 29, 2016
1 parent 1d6ad05 commit e5905ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/core/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e5905ff

Please sign in to comment.