mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
mmc: debugfs: Add a restriction to mmc debugfs clock setting
commit e5905ff128 upstream.
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>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c8816bb0ed
commit
282d5f0567
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user