drm/bridge: tc358768: Fix tc358768_ns_to_cnt()
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Wed, 6 Sep 2023 06:50:58 +0000 (09:50 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:59:10 +0000 (11:59 +0100)
commit2755e3757585e8cf1b0a33267eab7519f1c307d8
treef0250abeaaf0dcff61202e5a3099d377def2b717
parent697665d7c2faad6eaed5054219dd02861726dda5
drm/bridge: tc358768: Fix tc358768_ns_to_cnt()

[ Upstream commit f1dabbe645065d20ca863c8d446c74c59ca1ca9d ]

The tc358768_ns_to_cnt() is, most likely, supposed to do a div-round-up
operation, but it misses subtracting one from the dividend.

Fix this by just using DIV_ROUND_UP().

Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver")
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Tested-by: Maxim Schwalm <maxim.schwalm@gmail.com> # Asus TF700T
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-11-31725f008a50@ideasonboard.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/bridge/tc358768.c