Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1391108

[PATCH v2 05/11] serial: sh-sci: Do not open-code sci_getreg()

From Geert Uytterhoeven <geert+renesas@glider.be>
Newsgroups linux.kernel
Subject [PATCH v2 05/11] serial: sh-sci: Do not open-code sci_getreg()
Date 2016-04-29 15:10 +0200
Message-ID <rtgld-6wl-21@gated-at.bofh.it> (permalink)
References <rtgbx-69i-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Replace open-coded variants of sci_getreg() by function calls, and drop
intermediate variables where appropriate.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
  - New.
---
 drivers/tty/serial/sh-sci.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index bf3780a7f700cad8..ce7bd165929ea078 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -703,7 +703,6 @@ static void sci_poll_put_char(struct uart_port *port, unsigned char c)
 static void sci_init_pins(struct uart_port *port, unsigned int cflag)
 {
 	struct sci_port *s = to_sci_port(port);
-	const struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + SCSPTR;
 
 	/*
 	 * Use port-specific handler if provided.
@@ -717,7 +716,7 @@ static void sci_init_pins(struct uart_port *port, unsigned int cflag)
 	 * For the generic path SCSPTR is necessary. Bail out if that's
 	 * unavailable, too.
 	 */
-	if (!reg->size)
+	if (!sci_getreg(port, SCSPTR)->size)
 		return;
 
 	if ((s->cfg->capabilities & SCIx_HAVE_RTSCTS) &&
@@ -1866,12 +1865,10 @@ static void sci_enable_ms(struct uart_port *port)
 
 static void sci_break_ctl(struct uart_port *port, int break_state)
 {
-	struct sci_port *s = to_sci_port(port);
-	const struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + SCSPTR;
 	unsigned short scscr, scsptr;
 
 	/* check wheter the port has SCSPTR */
-	if (!reg->size) {
+	if (!sci_getreg(port, SCSPTR)->size) {
 		/*
 		 * Not supported by hardware. Most parts couple break and rx
 		 * interrupts together, with break detection always enabled.
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/11] serial: sh-sci: Hardware Flow Control Updates Geert Uytterhoeven <geert+renesas@glider.be> - 2016-04-29 15:00 +0200
  [PATCH v2 02/11] serial: sh-sci: Update DT binding documentation for dedicated RTS/CTS Geert Uytterhoeven <geert+renesas@glider.be> - 2016-04-29 15:10 +0200
    Re: [PATCH v2 02/11] serial: sh-sci: Update DT binding documentation  for dedicated RTS/CTS Rob Herring <robh@kernel.org> - 2016-05-03 20:10 +0200
  [PATCH v2 08/11] serial: sh-sci: Correct pin initialization on (H)SCIF Geert Uytterhoeven <geert+renesas@glider.be> - 2016-04-29 15:10 +0200
    Re: [PATCH v2 08/11] serial: sh-sci: Correct pin initialization on  (H)SCIF Peter Hurley <peter@hurleysoftware.com> - 2016-04-29 18:00 +0200
      Re: [PATCH v2 08/11] serial: sh-sci: Correct pin initialization on (H)SCIF Geert Uytterhoeven <geert@linux-m68k.org> - 2016-04-29 22:10 +0200
  [PATCH v2 11/11] serial: sh-sci: Add DT support for dedicated RTS/CTS Geert Uytterhoeven <geert+renesas@glider.be> - 2016-04-29 15:10 +0200
  [PATCH v2 01/11] serial: sh-sci: Update DT binding documentation for GPIO modem lines Geert Uytterhoeven <geert+renesas@glider.be> - 2016-04-29 15:10 +0200
  [PATCH v2 05/11] serial: sh-sci: Do not open-code sci_getreg() Geert Uytterhoeven <geert+renesas@glider.be> - 2016-04-29 15:10 +0200
    Re: [PATCH v2 05/11] serial: sh-sci: Do not open-code sci_getreg() Peter Hurley <peter@hurleysoftware.com> - 2016-04-29 17:40 +0200
  [PATCH v2 04/11] serial: sh-sci: Add support for GPIO-controlled modem lines Geert Uytterhoeven <geert+renesas@glider.be> - 2016-04-29 15:10 +0200
  [PATCH v2 06/11] serial: sh-sci: Add more Serial Port Register documentation Geert Uytterhoeven <geert+renesas@glider.be> - 2016-04-29 15:10 +0200
  [PATCH v2 03/11] serial: sh-sci: Always set TIOCM_CTS in .get_mctrl() callback Geert Uytterhoeven <geert+renesas@glider.be> - 2016-04-29 15:10 +0200
    Re: [PATCH v2 03/11] serial: sh-sci: Always set TIOCM_CTS in  .get_mctrl() callback Peter Hurley <peter@hurleysoftware.com> - 2016-04-29 17:40 +0200
  [PATCH v2 09/11] serial: sh-sci: Add pin initialization for SCIFA/SCIFB Geert Uytterhoeven <geert+renesas@glider.be> - 2016-04-29 15:10 +0200
  [PATCH v2 07/11] serial: sh-sci: Add more Serial Port Control/Data Register documentation Geert Uytterhoeven <geert+renesas@glider.be> - 2016-04-29 15:10 +0200

csiph-web