linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: richard.genoud@gmail.com (Richard Genoud)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] tty/serial: sh-sci: remove uneeded IS_ERR_OR_NULL calls
Date: Fri,  3 Mar 2017 15:22:01 +0100	[thread overview]
Message-ID: <20170303142201.16452-1-richard.genoud@gmail.com> (raw)

Since commit 1d267ea6539f ("serial: mctrl-gpio: simplify init routine"),
the mctrl_gpio_to_gpiod() function can't return an error anymore.
So, just testing for a NULL pointer is ok.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
---
 drivers/tty/serial/sh-sci.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 9a47cc4f16a2..36fde6f24040 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1934,12 +1934,12 @@ static unsigned int sci_get_mctrl(struct uart_port *port)
 	if (s->autorts) {
 		if (sci_get_cts(port))
 			mctrl |= TIOCM_CTS;
-	} else if (IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(gpios, UART_GPIO_CTS))) {
+	} else if (!mctrl_gpio_to_gpiod(gpios, UART_GPIO_CTS)) {
 		mctrl |= TIOCM_CTS;
 	}
-	if (IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(gpios, UART_GPIO_DSR)))
+	if (!mctrl_gpio_to_gpiod(gpios, UART_GPIO_DSR))
 		mctrl |= TIOCM_DSR;
-	if (IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(gpios, UART_GPIO_DCD)))
+	if (!mctrl_gpio_to_gpiod(gpios, UART_GPIO_DCD))
 		mctrl |= TIOCM_CAR;
 
 	return mctrl;
@@ -3072,10 +3072,8 @@ static int sci_probe_single(struct platform_device *dev,
 		return PTR_ERR(sciport->gpios);
 
 	if (sciport->has_rtscts) {
-		if (!IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(sciport->gpios,
-							UART_GPIO_CTS)) ||
-		    !IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(sciport->gpios,
-							UART_GPIO_RTS))) {
+		if (mctrl_gpio_to_gpiod(sciport->gpios, UART_GPIO_CTS) ||
+		    mctrl_gpio_to_gpiod(sciport->gpios, UART_GPIO_RTS)) {
 			dev_err(&dev->dev, "Conflicting RTS/CTS config\n");
 			return -EINVAL;
 		}

             reply	other threads:[~2017-03-03 14:22 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03 14:22 Richard Genoud [this message]
2017-03-03 18:58 ` [PATCH 4/4] tty/serial: sh-sci: remove uneeded IS_ERR_OR_NULL calls Geert Uytterhoeven
2017-03-03 19:12   ` Uwe Kleine-König
2017-03-03 19:21     ` Geert Uytterhoeven
2017-03-03 19:44       ` Uwe Kleine-König
2017-03-04 15:35         ` Geert Uytterhoeven
2017-03-04 17:48           ` Uwe Kleine-König
2017-03-06  8:49             ` Geert Uytterhoeven
2017-03-06  8:58               ` Uwe Kleine-König
2017-03-06  9:09                 ` Geert Uytterhoeven
2017-03-06  9:30                   ` Uwe Kleine-König
2017-03-06  9:53                     ` Geert Uytterhoeven
2017-03-06 10:02                       ` Uwe Kleine-König
2017-03-14 15:32                         ` Linus Walleij
2017-03-16 15:18                         ` Linus Walleij
2017-03-16 16:37                           ` Uwe Kleine-König
2017-03-16 16:38                           ` Geert Uytterhoeven
2017-03-20  9:56                             ` Geert Uytterhoeven
2017-03-20 10:03                               ` Geert Uytterhoeven
2017-03-20 10:31                               ` Uwe Kleine-König
2017-03-20 10:38                                 ` Geert Uytterhoeven
2017-03-20 11:07                                   ` Uwe Kleine-König
2017-03-23  9:32                                     ` Linus Walleij
2017-03-23 10:10                                       ` Uwe Kleine-König
2017-03-23 10:20                                         ` Geert Uytterhoeven
2017-03-23 11:11                                           ` Uwe Kleine-König
2017-03-23 12:03                                             ` Geert Uytterhoeven
2017-03-23 12:34                                               ` Uwe Kleine-König
2017-03-23 12:44                                                 ` Geert Uytterhoeven
2017-03-23 13:41                                                 ` Linus Walleij
2017-03-23 14:43                                                   ` Dmitry Torokhov
2017-03-23 15:44                                                     ` Dmitry Torokhov
2017-03-23 19:10                                                       ` Uwe Kleine-König
2017-03-23 19:58                                                         ` Dmitry Torokhov
2017-03-24  8:00                                                           ` Uwe Kleine-König
2017-03-24  8:29                                                             ` Geert Uytterhoeven
2017-03-24  8:39                                                               ` Uwe Kleine-König
2017-03-24  8:59                                                                 ` Geert Uytterhoeven
2017-03-24  9:15                                                                   ` Uwe Kleine-König
2017-03-24  9:44                                                                     ` Geert Uytterhoeven
2017-03-24 10:01                                                                       ` Uwe Kleine-König
2017-03-24  8:58                                                         ` Linus Walleij
2017-03-23 15:55                                             ` Dmitry Torokhov
2017-03-23 13:37                                         ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170303142201.16452-1-richard.genoud@gmail.com \
    --to=richard.genoud@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).