]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
pwm: atmel-hlcdc: Prevent division by zero
authorBoris BREZILLON <boris.brezillon@free-electrons.com>
Thu, 18 Dec 2014 20:05:30 +0000 (21:05 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Fri, 30 Jan 2015 11:16:00 +0000 (12:16 +0100)
commitdf6922adec987b1c7f07870a00f899fbc9a7d4cc
tree75bad2f5ed22e5c7fb71fee2a8151ce00e5f2968
parentd2048c49152a414efcf8b2696896bc8803ef2f1e
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>
drivers/pwm/pwm-atmel-hlcdc.c