serial: sh-sci: Fix range check of bit-rate for HSCIF
authorNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Mon, 14 Jul 2014 07:09:59 +0000 (16:09 +0900)
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>
Wed, 4 Feb 2015 10:15:32 +0000 (11:15 +0100)
commit5e6e7859a17a15f777b1084f7ef5c85560e260f3
tree1952b917de83a18785f1bb54cb5605b454bf02b0
parentce2e1058ad485ab9d10cd93524b5de4870db10c0
serial: sh-sci: Fix range check of bit-rate for HSCIF

If bit-rate calculation result of HSCIF is expect 255 from 0,
driver does not calculate error bit. However, we need to round
the value to calculate error bit in the case of negative value.
This rounds the value of bit-rate using clamp(), and bit-rate is the
case of negative value, it enables the calculation of the error bit.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit bcb9973a6097652a12660958449301aada41de9c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/tty/serial/sh-sci.c