i2c: sun6i-p2wi: Prevent potential division by zero
authorAxel Lin <axel.lin@ingics.com>
Wed, 13 Apr 2016 00:54:30 +0000 (08:54 +0800)
committerWolfram Sang <wsa@kernel.org>
Sun, 29 Oct 2023 19:30:07 +0000 (20:30 +0100)
commit5ac61d26b8baff5b2e5a9f3dc1ef63297e4b53e7
tree1aca0b1b472c85598d08572784b66c8329dcfdc5
parentd9387eda56a49b2cf4487b3c4f12500190e6bb88
i2c: sun6i-p2wi: Prevent potential division by zero

Make sure we don't OOPS in case clock-frequency is set to 0 in a DT. The
variable set here is later used as a divisor.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-sun6i-p2wi.c