From patchwork Fri Mar 3 14:22:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 9602917 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E854460414 for ; Fri, 3 Mar 2017 14:22:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D818428631 for ; Fri, 3 Mar 2017 14:22:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBF5C28633; Fri, 3 Mar 2017 14:22:40 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5CC4728631 for ; Fri, 3 Mar 2017 14:22:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=rlN3LlUxAMJ3u0X3tNDS0UYY8dAK+kIn9B21/AidzHE=; b=NjC c8c7Ir2rAmdUaybHgnmzIdWjcp3o3hnpzxyGwFmL+ogy9W/YlUMglUIhxAWRKfZMyK/LK5hHe7mo3 LVvygL3ttmH2u8VafVsO+c7VYz/ENcxOm+Gg1DD5VtLUtRuV57k+m4rrcrwmQ5ygm0T+DswUiugkM 1mfDIcDEQ9RFbcRJKwv5IeDON+87Gor972STayJMVqGBu2BFK5/0u099debol46BwuHSRx4vvxKHY UuIAUaOeIgW10LyLZpFxTIBMiixvL61SXp5kM2/2E43YEpqpH1XL1jn4JKVk7M4p541P4BYa6+2cE AOObZt/4QhudaQ1IbiFcA96ap+etR8A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cjo6S-0002aw-4t; Fri, 03 Mar 2017 14:22:40 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cjo6N-0002XU-Ul for linux-arm-kernel@lists.infradead.org; Fri, 03 Mar 2017 14:22:37 +0000 Received: by mail-wr0-x243.google.com with SMTP id u108so9537084wrb.2 for ; Fri, 03 Mar 2017 06:22:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=gJFd4zKscsGS63P9L5QXTZkCrBTPofiaDjqOvRBjuzs=; b=uqMrAqOBrdKDsJRVn2JBHJknOgx5DmlN9E2o5pt32y/AUdlllGi8gpdggL64TLTCjJ 8nKy6UK1ZYvSOYboWDabqQ7rg0oy/pfz7ZmN/s8vxa1nWvfGIjxNA1h6y5zyssuPIXx6 yw0bKSD/J2FqKZQOPcbcU9V4swASBFKslDWYKcwmsvF1Uqoz5nCznU9XFf90LbQYW3Qz A79SynFy4WJPOaPyBXX27bVZXsTP8K6qrCZQ3WI7VybzNB+m5xKJe1IyenfPun/W2SoF mHu0DzoygU7uUCMPZ8HW+RvN4AX2ZjARJFgqZVPpK3yXwEeTAsbFOpCBC1cHhY7pmC6V K3PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gJFd4zKscsGS63P9L5QXTZkCrBTPofiaDjqOvRBjuzs=; b=PblZFHfZmHPl3v/uLb/WrKgcNMg9n/8ZrYK35A7AvFlbux/issuY46Ku/bzACd7nyV 77+m6Ao5ENB6FKDQAm+pHRQGGqC9LSayP7bsHxZ9psZzcfmsKyBEMeCiQ18PUySYdCwC ZNppHhLl2L2P4kMQ6agg2T1Q48+aiO4guogpy6IhJ82St5CRzHarTpC9yRTf38fcMlUN hW/wsfVGr1xf9NWTb/Xw/2V0fbJ+1CPQoqkrG2xil2qMmz3Aca0qxHQ7trLnvbrP7Gpd riCec3ozk48QNa5XJVWFVTuSwz+JLdOZn5Za0h2qzNFfOLQoabRQRbn4P8dqiXE4GrUf qftw== X-Gm-Message-State: AMke39nDj1Rf2U4dxCSog5pwv0RXEamG49VXHUCS/tLKRQgQSy/J3Gtf/BlbInu+YUUb5w== X-Received: by 10.223.161.204 with SMTP id v12mr3166396wrv.36.1488550934221; Fri, 03 Mar 2017 06:22:14 -0800 (PST) Received: from localhost ([46.227.18.67]) by smtp.gmail.com with ESMTPSA id u7sm4286750wru.56.2017.03.03.06.22.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Mar 2017 06:22:13 -0800 (PST) From: Richard Genoud To: Greg Kroah-Hartman Subject: [PATCH 4/4] tty/serial: sh-sci: remove uneeded IS_ERR_OR_NULL calls Date: Fri, 3 Mar 2017 15:22:01 +0100 Message-Id: <20170303142201.16452-1-richard.genoud@gmail.com> X-Mailer: git-send-email 2.11.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170303_062236_144541_184AA272 X-CRM114-Status: GOOD ( 10.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Geert Uytterhoeven , Richard Genoud , Nicolas Ferre , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; }