From patchwork Wed Aug 14 09:29:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11093597 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A51D21395 for ; Wed, 14 Aug 2019 09:29:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90B5828722 for ; Wed, 14 Aug 2019 09:29:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 846952874F; Wed, 14 Aug 2019 09:29:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20FD428722 for ; Wed, 14 Aug 2019 09:29:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725996AbfHNJ3c (ORCPT ); Wed, 14 Aug 2019 05:29:32 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:34158 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726126AbfHNJ3c (ORCPT ); Wed, 14 Aug 2019 05:29:32 -0400 Received: from ramsan ([84.194.98.4]) by xavier.telenet-ops.be with bizsmtp id oxVS2000605gfCL01xVSWU; Wed, 14 Aug 2019 11:29:30 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1hxpaw-0003VM-3a; Wed, 14 Aug 2019 11:29:26 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1hxpaw-0003cJ-1U; Wed, 14 Aug 2019 11:29:26 +0200 From: Geert Uytterhoeven To: Greg Kroah-Hartman , Jiri Slaby Cc: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Frieder Schrempf , Richard Genoud , Shawn Guo , Sascha Hauer , Fabio Estevam , Pengutronix Kernel Team , NXP Linux Team , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 1/3] serial: atmel: Don't check for mctrl_gpio_to_gpiod() returning error Date: Wed, 14 Aug 2019 11:29:22 +0200 Message-Id: <20190814092924.13857-2-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190814092924.13857-1-geert+renesas@glider.be> References: <20190814092757.13726-1-geert+renesas@glider.be> <20190814092924.13857-1-geert+renesas@glider.be> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit 1d267ea6539f2663 ("serial: mctrl-gpio: simplify init routine"), mctrl_gpio_init() returns failure if the assignment to any member of the gpio array results in an error pointer. Since commit c359522194593815 ("serial: mctrl_gpio: Avoid probe failures in case of missing gpiolib"), mctrl_gpio_to_gpiod() returns NULL in the !CONFIG_GPIOLIB case. Hence there is no longer a need to check for mctrl_gpio_to_gpiod() returning an error value. A simple NULL check is sufficient. This follows the spirit of commit 445df7ff3fd1a0a9 ("serial: mctrl-gpio: drop usages of IS_ERR_OR_NULL") in the mctrl-gpio core. Signed-off-by: Geert Uytterhoeven --- drivers/tty/serial/atmel_serial.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 19a85d6fe3d20541..e9620a81166b7dc1 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -303,32 +303,28 @@ static unsigned int atmel_get_lines_status(struct uart_port *port) mctrl_gpio_get(atmel_port->gpios, &ret); - if (!IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(atmel_port->gpios, - UART_GPIO_CTS))) { + if (mctrl_gpio_to_gpiod(atmel_port->gpios, UART_GPIO_CTS)) { if (ret & TIOCM_CTS) status &= ~ATMEL_US_CTS; else status |= ATMEL_US_CTS; } - if (!IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(atmel_port->gpios, - UART_GPIO_DSR))) { + if (mctrl_gpio_to_gpiod(atmel_port->gpios, UART_GPIO_DSR)) { if (ret & TIOCM_DSR) status &= ~ATMEL_US_DSR; else status |= ATMEL_US_DSR; } - if (!IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(atmel_port->gpios, - UART_GPIO_RI))) { + if (mctrl_gpio_to_gpiod(atmel_port->gpios, UART_GPIO_RI)) { if (ret & TIOCM_RI) status &= ~ATMEL_US_RI; else status |= ATMEL_US_RI; } - if (!IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(atmel_port->gpios, - UART_GPIO_DCD))) { + if (mctrl_gpio_to_gpiod(atmel_port->gpios, UART_GPIO_DCD)) { if (ret & TIOCM_CD) status &= ~ATMEL_US_DCD; else