diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-12-05 12:46:06 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-12-06 14:58:57 -0500 |
commit | 7280b51a29f8e6cc7d449d565182d1e1b6183907 (patch) | |
tree | 65237eab1130bbb286b98f3827c15346f7583533 /drivers/ssb/driver_extif.c | |
parent | 7ffbffe37de3979d43c1105e38eb2918bf5d35fe (diff) |
ssb: extif: add check for max value before setting watchdog register
Prevent the watchdog register on the extif core to be set to a too
high value.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb/driver_extif.c')
-rw-r--r-- | drivers/ssb/driver_extif.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/ssb/driver_extif.c b/drivers/ssb/driver_extif.c index dc47f30e9cf7..0aa4c2a85774 100644 --- a/drivers/ssb/driver_extif.c +++ b/drivers/ssb/driver_extif.c | |||
@@ -112,9 +112,10 @@ void ssb_extif_get_clockcontrol(struct ssb_extif *extif, | |||
112 | *m = extif_read32(extif, SSB_EXTIF_CLOCK_SB); | 112 | *m = extif_read32(extif, SSB_EXTIF_CLOCK_SB); |
113 | } | 113 | } |
114 | 114 | ||
115 | void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, | 115 | void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks) |
116 | u32 ticks) | ||
117 | { | 116 | { |
117 | if (ticks > SSB_EXTIF_WATCHDOG_MAX_TIMER) | ||
118 | ticks = SSB_EXTIF_WATCHDOG_MAX_TIMER; | ||
118 | extif_write32(extif, SSB_EXTIF_WATCHDOG, ticks); | 119 | extif_write32(extif, SSB_EXTIF_WATCHDOG, ticks); |
119 | } | 120 | } |
120 | 121 | ||