diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2015-11-03 12:14:10 -0500 |
---|---|---|
committer | Geert Uytterhoeven <geert+renesas@glider.be> | 2015-12-17 05:18:10 -0500 |
commit | dcafbb47bdfde32b9f3c275aa4b435c120d02f15 (patch) | |
tree | 1bc92686374d97e8f8d9f648f7a9f41ae73e4caf /drivers/tty | |
parent | 176ae5f674ebd2049f99e97eb8319200f1d211b6 (diff) |
serial: sh-sci: Drop useless check for zero sampling_rate
sci_port.sampling_rate is always non-zero, except for HSCIF, which uses
sci_baud_calc_hscif() instead of sci_scbrr_calc().
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index cc6fa55231ba..dfee7a2f51f1 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -1863,13 +1863,7 @@ static void sci_shutdown(struct uart_port *port) | |||
1863 | static unsigned int sci_scbrr_calc(struct sci_port *s, unsigned int bps, | 1863 | static unsigned int sci_scbrr_calc(struct sci_port *s, unsigned int bps, |
1864 | unsigned long freq) | 1864 | unsigned long freq) |
1865 | { | 1865 | { |
1866 | if (s->sampling_rate) | 1866 | return DIV_ROUND_CLOSEST(freq, s->sampling_rate * bps) - 1; |
1867 | return DIV_ROUND_CLOSEST(freq, s->sampling_rate * bps) - 1; | ||
1868 | |||
1869 | /* Warn, but use a safe default */ | ||
1870 | WARN_ON(1); | ||
1871 | |||
1872 | return ((freq + 16 * bps) / (32 * bps) - 1); | ||
1873 | } | 1867 | } |
1874 | 1868 | ||
1875 | /* calculate frame length from SMR */ | 1869 | /* calculate frame length from SMR */ |