commit | df6922adec987b1c7f07870a00f899fbc9a7d4cc | [log] [tgz] |
---|---|---|
author | Boris BREZILLON <boris.brezillon@free-electrons.com> | Thu Dec 18 21:05:30 2014 +0100 |
committer | Thierry Reding <thierry.reding@gmail.com> | Fri Jan 30 12:16:00 2015 +0100 |
tree | 75bad2f5ed22e5c7fb71fee2a8151ce00e5f2968 | |
parent | d2048c49152a414efcf8b2696896bc8803ef2f1e [diff] |
pwm: atmel-hlcdc: Prevent division by zero The slow and system clock should never return a rate of zero, but this might happen if the clocks property defined in the DT is referencing the wrong clocks. Prevent any division by zero from happening by testing the clk_freq value before calling do_div(). Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>