summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChuanxiao Dong <chuanxiao.dong@intel.com>2016-01-21 15:57:51 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2016-02-29 13:02:49 +0300
commite5905ff1281f0a0f5c9863c430ac1ed5faaf5707 (patch)
tree30a9f4fb0e22da3d3781af18681e18fc02fea209 /drivers
parent1d6ad05777c27c7e8cfb32997a78c8252b85fbb4 (diff)
downloadlinux-e5905ff1281f0a0f5c9863c430ac1ed5faaf5707.tar.xz
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: Yuan Juntao <juntaox.yuan@intel.com> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/core/debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index 65cc0ac9b82d..9382a57a5aa4 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -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);