From patchwork Tue Oct 2 09:45:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 10623321 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 E333E15A6 for ; Tue, 2 Oct 2018 09:46:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D94ED287D4 for ; Tue, 2 Oct 2018 09:46:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD4EC287DB; Tue, 2 Oct 2018 09:46:54 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 53431287D4 for ; Tue, 2 Oct 2018 09:46:54 +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:References: In-Reply-To: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:List-Owner; bh=/48O/Tj1kCUQCkbC/GSTrubiQgPML8vzcDCeH5I0y1g=; b=Ozqfn7VhVxUA5MbH5XfbJqTzDI 64Jf3V9vj17B2cQOjt7/yMLf3UnDTJnUsdAzJzEjaaFlfpFaBN80MDOM0DJgvbh1JPH6HP5JDp4tQ cH3n4x8Y2UoXRI1K2vUaNmEJAfZJt59+AaqFp1fGz3WZWP08DGhOuT/oI6IbdIuij1jTUFhCfB+4d EtiVOS+sCWQb9fMVcFBAUPXAhe4stV3nha1C5X588kY2ruNYqYfjhwSCFbjvHMPtY64Wzw9Y2RzxW qjM9o/XGa1GjTf9CwlDlhXqtVExeNFKQyaCDnkD5ymd6w1pyKAaj0SRclnEhq5EgZiznnQPAe/rwL s93AUJyg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g7HGL-0001zN-LA; Tue, 02 Oct 2018 09:46:41 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g7HGG-0001xM-SP for linux-arm-kernel@bombadil.infradead.org; Tue, 02 Oct 2018 09:46:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Z+hdxFOSe32oMBUjUZfltaG93mOopNPMP9Hnk0qjLPI=; b=my39Sx9P13wgGSIDowe8HuOao +GJH8g0JukPnHh1KLCwrC3pHGp2sg3klwv8pe1xSYP3jJAckUd7eT5aAj1xnsfwCVOF5aFC3Hp+WI zbfwKk3oa8RhXAH959R+LL50pJgo5Y5nLLkV6HHhjpz8UTmUUWF5xc4lB4sCKzqL0E2v863dcJXJ5 Jrt11MwoFlehGe3XRwYNX/z3Or7mtd1sGGPjm1WcFewPoQ3itsvp4j7fOZ//XmyYhQW34TwYBEzxi FXu26uSPG6UWdveBrGcs397MEUFwEvFYyRc3ySmwKBHDVr+4jpJGp2FA5gLQgLrJ3/vxxlf9n5MeJ j1CgxMHug==; Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g7HE2-0002NU-6A for linux-arm-kernel@lists.infradead.org; Tue, 02 Oct 2018 09:44:19 +0000 Received: by mail-lf1-x141.google.com with SMTP id w21-v6so926886lff.6 for ; Tue, 02 Oct 2018 02:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z+hdxFOSe32oMBUjUZfltaG93mOopNPMP9Hnk0qjLPI=; b=EEu6NqWyOT6HKwzp1+ad/5E7tTIbAs11gTtQ0nZaSsr1o1pmTKqSySJn1510U9QVeM ObKmxzZ7LEstIW2+lwiv+2Dc3l+kN8+VkwRkXQj1z36Tz8MjLJHrQnLUYpDXG1rMY9ah ms4iV1Z1E0JTQHT4XFZeQPfwzn1pTv1rHxoDUzq202QDmEAEJJDpbetv2bNwd3v1O/n/ 3jtG+XMUarXbbP6WcAqB8wfWISsgRd0vzUKvIqadbWe/fRXfVLDLaM5BiPe2amYpRmPK 9V5iS8v9pBYcNZqsb+h9gR3cJvuCbRO+NYbC/cvg+CphVIiZynW+XgReHoeIfH6m6sZo /XbQ== 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:in-reply-to :references; bh=Z+hdxFOSe32oMBUjUZfltaG93mOopNPMP9Hnk0qjLPI=; b=K6QOY1hnqCgAYBbM36GLBiQQ8MOBG2ezEZvmq31kA6gzl9iGND3MK8IUph19ddAk4P araER4nF/sEvJ9NChBT8UI1PHDUMJ8gdyKGyfjSxn8KWUO0mE7CC7FXIgrJzp6YMI3+y CDzLTp/krqvYUMTjM6S6qKiWDvNYy2KbggBoo4wElsUE5RBW6KJt2PHA/jKxfz+8hVOL SFtbOrcGhS122p/CWFO/L0ZZty4CKXnVOznCVClMUi3ejHw1fucny4UXGslRg/ZW8OaH DCQEpHmPYKeRm7RJJ8774GMgxTxQEol0rqdP6nRZfMkF3K2GavflJwmyhGj691zUJEEy QzIg== X-Gm-Message-State: ABuFfogYL1njM1dpE+LUfdfdpJtkkq7IM0rrasNlot9Gc0x8J9Cx5alx KtZ2+Ar7tS/Gs2+sU6ILB7I= X-Google-Smtp-Source: ACcGV609RoIYSvKGmguJsAkxX2XfrpiW8yQY+ISk6FjHNCWyj09WJf4dzuNcPHfLMcC2Ni1g8CSVrw== X-Received: by 2002:a19:518a:: with SMTP id g10-v6mr8300461lfl.63.1538473445730; Tue, 02 Oct 2018 02:44:05 -0700 (PDT) Received: from z50.intranet (78-10-164-223.static.ip.netia.com.pl. [78.10.164.223]) by smtp.gmail.com with ESMTPSA id s140-v6sm3111029lfs.91.2018.10.02.02.44.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 02:44:04 -0700 (PDT) From: Janusz Krzysztofik To: Tony Lindgren Subject: [PATCH] ARM: OMAP1: ams-delta: Fix impossible .irq < 0 Date: Tue, 2 Oct 2018 11:45:29 +0200 Message-Id: <20181002094529.30564-1-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20181001102453.GA18947@mwanda> References: <20181001102453.GA18947@mwanda> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181002_104418_216839_5B5C8C88 X-CRM114-Status: GOOD ( 17.90 ) 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: Aaro Koskinen , Janusz Krzysztofik , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, Dan Carpenter 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 the very beginning, unsigned int .irq member of struct plat_serial8250_port introduced by commit eff443df679e ("OMAP1: AMS_DELTA: add modem support") was statically initialized to a negative value -EINVAL. Moreover, commit 0812db943748 ("ARM: OMAP1: ams-delta: assign MODEM IRQ from GPIO descriptor") has introduced some new code which checks for that member carrying a negative value which is impossible. Use IRQ_NOTCONNECTED instead of -EINVAL. Also, drop the valueless check and let the modem device be registered regardless of .irq value, and the value handled by "serial8250" driver. Fixes: 0812db943748 ("ARM: OMAP1: ams-delta: assign MODEM IRQ from GPIO descriptor") Reported-by: Dan Carpenter Signed-off-by: Janusz Krzysztofik Acked-by: Aaro Koskinen --- arch/arm/mach-omap1/board-ams-delta.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index af318d958fd2..3d191fd52910 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -773,7 +773,7 @@ static struct plat_serial8250_port ams_delta_modem_ports[] = { { .membase = IOMEM(MODEM_VIRT), .mapbase = MODEM_PHYS, - .irq = -EINVAL, /* changed later */ + .irq = IRQ_NOTCONNECTED, /* changed later */ .flags = UPF_BOOT_AUTOCONF, .irqflags = IRQF_TRIGGER_RISING, .iotype = UPIO_MEM, @@ -864,8 +864,7 @@ static int __init modem_nreset_init(void) /* - * This function expects MODEM IRQ number already assigned to the port - * and fails if it's not. + * This function expects MODEM IRQ number already assigned to the port. * The MODEM device requires its RESET# pin kept high during probe. * That requirement can be fulfilled in several ways: * - with a descriptor of already functional modem_nreset regulator @@ -888,9 +887,6 @@ static int __init ams_delta_modem_init(void) if (!machine_is_ams_delta()) return -ENODEV; - if (ams_delta_modem_ports[0].irq < 0) - return ams_delta_modem_ports[0].irq; - omap_cfg_reg(M14_1510_GPIO2); /* Initialize the modem_nreset regulator consumer before use */