Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f53297fb authored by Nobuhiro Iwamatsu's avatar Nobuhiro Iwamatsu Committed by Greg Kroah-Hartman
Browse files

serial: sh-sci: Change checking for error rate of HSCIF



This changes negative values of error rate to be checked, because these
values are valid as error rate. And this changes in the process of adopting
a value close to 0.

Signed-off-by: default avatarNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 681b05f5
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -1812,9 +1812,6 @@ static void sci_baud_calc_hscif(unsigned int bps, unsigned long freq,
			err = DIV_ROUND_CLOSEST(freq, ((br + 1) * bps * sr *
					       (1 << (2 * c + 1)) / 1000)) -
					       1000;
			if (err < 0)
				continue;

			/* Calc recv margin
			 * M: Receive margin (%)
			 * N: Ratio of bit rate to clock (N = sampling rate)
@@ -1829,7 +1826,7 @@ static void sci_baud_calc_hscif(unsigned int bps, unsigned long freq,
			 */
			recv_margin = abs((500 -
					DIV_ROUND_CLOSEST(1000, sr << 1)) / 10);
			if (min_err > err) {
			if (abs(min_err) > abs(err)) {
				min_err = err;
				recv_max_margin = recv_margin;
			} else if ((min_err == err) &&