]> git.baikalelectronics.ru Git - kernel.git/commit
clk: si5341: Avoid divide errors due to bogus register contents
authorRobert Hancock <robert.hancock@calian.com>
Thu, 25 Mar 2021 19:26:37 +0000 (13:26 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:53:35 +0000 (16:53 +0200)
commit8ca89865785a9ea2b3b35ddca57b1d7109254bbd
tree1232def0775bd5d921ee85b9963a6d20b7bff871
parentcddd3cd823fd7b46477a9eafc56ea72531d84f18
clk: si5341: Avoid divide errors due to bogus register contents

[ Upstream commit 78f6f406026d688868223d5dbeb197a4f7e9a9fd ]

If the Si5341 is being initially programmed and has no stored NVM
configuration, some of the register contents may contain unexpected
values, such as zeros, which could cause divide by zero errors during
driver initialization. Trap errors caused by zero registers or zero clock
rates which could result in divide errors later in the code.

Fixes: 10c619dadb ("clk: Add Si5341/Si5340 driver")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20210325192643.2190069-4-robert.hancock@calian.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/clk-si5341.c