diff options
| author | Dudley Du <dudl@cypress.com> | 2015-04-20 13:00:05 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-04-20 13:30:09 -0400 |
| commit | a333a03ce969c18f97f1eafa3dc1072caa33454e (patch) | |
| tree | 52ff7be1cc15b1a239a0cd3bb6607f79d7791129 /drivers/input/mouse | |
| parent | 9f423801c9e849df56b37833df895685c9d8a940 (diff) | |
Input: cyapa - fix setting suspend scan rate
The suspend scan rate value should not exceed 1000, unfortunately when
implementing the limit we used max_t instead of min_t, causing the value to
be at least 1000.
Signed-off-by: Dudley Du <dudl@cypress.com>
Reviewed-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse')
| -rw-r--r-- | drivers/input/mouse/cyapa.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c index 58f4f6fa4857..efe148474e7f 100644 --- a/drivers/input/mouse/cyapa.c +++ b/drivers/input/mouse/cyapa.c | |||
| @@ -723,7 +723,7 @@ static ssize_t cyapa_update_suspend_scanrate(struct device *dev, | |||
| 723 | } else if (sysfs_streq(buf, OFF_MODE_NAME)) { | 723 | } else if (sysfs_streq(buf, OFF_MODE_NAME)) { |
| 724 | cyapa->suspend_power_mode = PWR_MODE_OFF; | 724 | cyapa->suspend_power_mode = PWR_MODE_OFF; |
| 725 | } else if (!kstrtou16(buf, 10, &sleep_time)) { | 725 | } else if (!kstrtou16(buf, 10, &sleep_time)) { |
| 726 | cyapa->suspend_sleep_time = max_t(u16, sleep_time, 1000); | 726 | cyapa->suspend_sleep_time = min_t(u16, sleep_time, 1000); |
| 727 | cyapa->suspend_power_mode = | 727 | cyapa->suspend_power_mode = |
| 728 | cyapa_sleep_time_to_pwr_cmd(cyapa->suspend_sleep_time); | 728 | cyapa_sleep_time_to_pwr_cmd(cyapa->suspend_sleep_time); |
| 729 | } else { | 729 | } else { |
| @@ -840,7 +840,7 @@ static ssize_t cyapa_update_rt_suspend_scanrate(struct device *dev, | |||
| 840 | if (error) | 840 | if (error) |
| 841 | return error; | 841 | return error; |
| 842 | 842 | ||
| 843 | cyapa->runtime_suspend_sleep_time = max_t(u16, time, 1000); | 843 | cyapa->runtime_suspend_sleep_time = min_t(u16, time, 1000); |
| 844 | cyapa->runtime_suspend_power_mode = | 844 | cyapa->runtime_suspend_power_mode = |
| 845 | cyapa_sleep_time_to_pwr_cmd(cyapa->runtime_suspend_sleep_time); | 845 | cyapa_sleep_time_to_pwr_cmd(cyapa->runtime_suspend_sleep_time); |
| 846 | 846 | ||
