All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
To: linux-serial@vger.kernel.org,
	Tobias Klauser <tklauser@distanz.ch>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	linux-kernel@vger.kernel.org,
	Prabhakar <prabhakar.csengg@gmail.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: [PATCH 06/10] serial: altera_jtaguart: Use platform_get_irq_optional() to get the interrupt
Date: Fri, 24 Dec 2021 14:29:12 +0000	[thread overview]
Message-ID: <20211224142917.6966-7-prabhakar.mahadev-lad.rj@bp.renesas.com> (raw)
In-Reply-To: <20211224142917.6966-1-prabhakar.mahadev-lad.rj@bp.renesas.com>

platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq_optional().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/tty/serial/altera_jtaguart.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c
index 23c4e0e79694..37bffe406b18 100644
--- a/drivers/tty/serial/altera_jtaguart.c
+++ b/drivers/tty/serial/altera_jtaguart.c
@@ -418,8 +418,9 @@ static int altera_jtaguart_probe(struct platform_device *pdev)
 	struct altera_jtaguart_platform_uart *platp =
 			dev_get_platdata(&pdev->dev);
 	struct uart_port *port;
-	struct resource *res_irq, *res_mem;
+	struct resource *res_mem;
 	int i = pdev->id;
+	int irq;
 
 	/* -1 emphasizes that the platform must have one port, no .N suffix */
 	if (i == -1)
@@ -438,9 +439,11 @@ static int altera_jtaguart_probe(struct platform_device *pdev)
 	else
 		return -ENODEV;
 
-	res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (res_irq)
-		port->irq = res_irq->start;
+	irq = platform_get_irq_optional(pdev, 0);
+	if (irq < 0 && irq != -ENXIO)
+		return irq;
+	if (irq > 0)
+		port->irq = irq;
 	else if (platp)
 		port->irq = platp->irq;
 	else
-- 
2.17.1


  parent reply	other threads:[~2021-12-24 14:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-24 14:29 [PATCH 00/10] serial: Use platform_get_irq*() variants to fetch IRQ's Lad Prabhakar
2021-12-24 14:29 ` [PATCH 01/10] serial: altera: Use platform_get_irq_optional() to get the interrupt Lad Prabhakar
2021-12-24 14:29 ` [PATCH 02/10] serial: 8250_bcm7271: Use platform_get_irq() " Lad Prabhakar
2021-12-24 22:10   ` Florian Fainelli
2021-12-24 14:29 ` [PATCH 03/10] serial: 8250_bcm7271: Propagate error codes from brcmuart_probe() Lad Prabhakar
2021-12-24 22:11   ` Florian Fainelli
     [not found]   ` <CAHp75VdC+JifneoYRS3yoXoAhio+TXQzca3pku7ug=A_ewWrsg@mail.gmail.com>
2021-12-25 12:20     ` Lad, Prabhakar
2021-12-30 12:27       ` Greg Kroah-Hartman
2021-12-24 14:29 ` [PATCH 04/10] serial: meson: Use platform_get_irq() to get the interrupt Lad Prabhakar
2021-12-24 14:29   ` Lad Prabhakar
2021-12-24 14:29   ` Lad Prabhakar
2021-12-24 14:29 ` [PATCH 05/10] serial: pxa: " Lad Prabhakar
2021-12-24 14:29 ` Lad Prabhakar [this message]
2021-12-24 14:29 ` [PATCH 07/10] serial: vt8500: " Lad Prabhakar
2021-12-24 14:29   ` Lad Prabhakar
2021-12-24 14:29 ` [PATCH 08/10] serial: ar933x: " Lad Prabhakar
2021-12-24 14:29 ` [PATCH 09/10] serial: bcm63xx: " Lad Prabhakar
2021-12-24 14:29   ` Lad Prabhakar
2021-12-24 17:05   ` Florian Fainelli
2021-12-24 17:05     ` Florian Fainelli
2021-12-24 14:29 ` [PATCH 10/10] serial: pmac_zilog: " Lad Prabhakar
2021-12-24 14:29   ` Lad Prabhakar

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=20211224142917.6966-7-prabhakar.mahadev-lad.rj@bp.renesas.com \
    --to=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=prabhakar.csengg@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=tklauser@distanz.ch \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.