]> git.baikalelectronics.ru Git - kernel.git/commit
drm/sun4i: rgb: Fix potential division by zero
authorMaxime Ripard <maxime.ripard@bootlin.com>
Wed, 21 Feb 2018 12:57:02 +0000 (13:57 +0100)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Tue, 6 Mar 2018 15:27:31 +0000 (16:27 +0100)
commite2a50cf2ead0ceee8387a96041339756d5262a46
treeba9ca9d2f7d5446c2fe1283cb9c07829cbc8fce0
parenta46327305107f2d31e0d96fce3feea9969000d43
drm/sun4i: rgb: Fix potential division by zero

In the case where mode_valid callback of our RGB connector was called
before mode_set was being called, the range of dividers would not be set,
resulting in a division by zero later on in the clk_round_rate logic.

Set the range of dividers before calling clk_round_rate to fix this.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Tested-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180221125703.4595-2-maxime.ripard@bootlin.com
drivers/gpu/drm/sun4i/sun4i_rgb.c