From patchwork Fri Apr 29 09:22:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 8978931 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 552ADBF29F for ; Fri, 29 Apr 2016 09:24:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FF39201C8 for ; Fri, 29 Apr 2016 09:24:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9A6D1200FF for ; Fri, 29 Apr 2016 09:24:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aw4d5-0004KA-UN; Fri, 29 Apr 2016 09:22:31 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aw4d2-0004H4-Ks for linux-arm-kernel@lists.infradead.org; Fri, 29 Apr 2016 09:22:30 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0B3CEAD6E; Fri, 29 Apr 2016 09:22:04 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Subject: [PATCH] tty: serial, return values platform_get_irq, part II. Date: Fri, 29 Apr 2016 11:22:01 +0200 Message-Id: <1461921721-30169-1-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160429_022229_062723_B30A56CA X-CRM114-Status: GOOD ( 11.75 ) X-Spam-Score: -4.2 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King - ARM Linux , linux-serial@vger.kernel.org, Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, Michal Simek , Paul Mackerras , linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Michael Ellerman , Peter Korsgaard , Jiri Slaby , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When commit "TTY: serial, handle platform_get_irq retval properly" was merged, it was pointed out, that platform_get_irq is more peculiar than it seems. platform_get_irq can actually return zero for some platforms. So reverts parts of the aforementioned commits which did the worng thing on those platforms. Signed-off-by: Jiri Slaby Cc: "Uwe Kleine-König" Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Peter Korsgaard Cc: Michal Simek Cc: "Sören Brinkmann" Cc: linux-serial@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: Russell King - ARM Linux --- drivers/tty/serial/efm32-uart.c | 4 ++-- drivers/tty/serial/pmac_zilog.c | 2 +- drivers/tty/serial/uartlite.c | 2 +- drivers/tty/serial/xilinx_uartps.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/efm32-uart.c b/drivers/tty/serial/efm32-uart.c index efadba355a20..195acc868763 100644 --- a/drivers/tty/serial/efm32-uart.c +++ b/drivers/tty/serial/efm32-uart.c @@ -724,7 +724,7 @@ static int efm32_uart_probe(struct platform_device *pdev) } ret = platform_get_irq(pdev, 0); - if (ret < 0) { + if (ret <= 0) { dev_dbg(&pdev->dev, "failed to get rx irq\n"); goto err_get_rxirq; } @@ -732,7 +732,7 @@ static int efm32_uart_probe(struct platform_device *pdev) efm_port->port.irq = ret; ret = platform_get_irq(pdev, 1); - if (ret < 0) + if (ret <= 0) ret = efm_port->port.irq + 1; efm_port->txirq = ret; diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index 0f086a2559ff..b24b0556f5a8 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c @@ -1720,7 +1720,7 @@ static int __init pmz_init_port(struct uart_pmac_port *uap) r_ports = platform_get_resource(uap->pdev, IORESOURCE_MEM, 0); irq = platform_get_irq(uap->pdev, 0); - if (!r_ports || irq < 0) + if (!r_ports || irq <= 0) return -ENODEV; uap->port.mapbase = r_ports->start; diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index 0e4e398c66c0..c9fdfc8bf47f 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -693,7 +693,7 @@ static int ulite_probe(struct platform_device *pdev) return -ENODEV; irq = platform_get_irq(pdev, 0); - if (irq < 0) + if (irq <= 0) return -ENXIO; return ulite_assign(&pdev->dev, id, res->start, irq); diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 34a705b15a4f..cd46e64c4255 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1368,7 +1368,7 @@ static int cdns_uart_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); - if (irq < 0) { + if (irq <= 0) { rc = -ENXIO; goto err_out_clk_disable; }