serial: zynq: Use DIV_ROUND_CLOSEST() to calcurate divider value
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Wed, 13 Jul 2022 01:38:59 +0000 (10:38 +0900)
committerMichal Simek <michal.simek@amd.com>
Tue, 26 Jul 2022 06:23:55 +0000 (08:23 +0200)
commitc6bceb4e360d704fb9746541c18a1a08f49353fc
tree0ae75743c33c6898f5b727a5f028289e8396139d
parent65fc1697dbfbf61680e6a9cdad0a2d7dd2f9bed9
serial: zynq: Use DIV_ROUND_CLOSEST() to calcurate divider value

Since the calulation of "bgen" is rounded down, using a higher
baudrate will result in a larger difference from the actual
baudrate. Should use DIV_ROUND_CLOSEST() like the Linux driver.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/1657676339-6055-1-git-send-email-hayashi.kunihiko@socionext.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
drivers/serial/serial_zynq.c