serial: lantiq: Use platform_get_irq() to get the interrupt
Use the preferred platform_get_irq() call to retrieve the interrupts. These have the advantage of working with deferred probe and gets us one step closer to removing of_irq_to_resource_table(). Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20211215224800.1984391-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
26baf4b66c
commit
f087f01ca2
1 changed files with 13 additions and 15 deletions
|
@ -16,8 +16,6 @@
|
||||||
#include <linux/ioport.h>
|
#include <linux/ioport.h>
|
||||||
#include <linux/lantiq.h>
|
#include <linux/lantiq.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of_address.h>
|
|
||||||
#include <linux/of_irq.h>
|
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
#include <linux/serial.h>
|
#include <linux/serial.h>
|
||||||
#include <linux/serial_core.h>
|
#include <linux/serial_core.h>
|
||||||
|
@ -728,19 +726,19 @@ static struct uart_driver lqasc_reg = {
|
||||||
static int fetch_irq_lantiq(struct device *dev, struct ltq_uart_port *ltq_port)
|
static int fetch_irq_lantiq(struct device *dev, struct ltq_uart_port *ltq_port)
|
||||||
{
|
{
|
||||||
struct uart_port *port = <q_port->port;
|
struct uart_port *port = <q_port->port;
|
||||||
struct resource irqres[3];
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = of_irq_to_resource_table(dev->of_node, irqres, 3);
|
ltq_port->tx_irq = platform_get_irq(pdev, 0);
|
||||||
if (ret != 3) {
|
if (ltq_port->tx_irq < 0)
|
||||||
dev_err(dev,
|
return ltq_port->tx_irq;
|
||||||
"failed to get IRQs for serial port\n");
|
ltq_port->rx_irq = platform_get_irq(pdev, 1);
|
||||||
return -ENODEV;
|
if (ltq_port->rx_irq < 0)
|
||||||
}
|
return ltq_port->rx_irq;
|
||||||
ltq_port->tx_irq = irqres[0].start;
|
ltq_port->err_irq = platform_get_irq(pdev, 2);
|
||||||
ltq_port->rx_irq = irqres[1].start;
|
if (ltq_port->err_irq < 0)
|
||||||
ltq_port->err_irq = irqres[2].start;
|
return ltq_port->err_irq;
|
||||||
port->irq = irqres[0].start;
|
|
||||||
|
port->irq = ltq_port->tx_irq;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -793,7 +791,7 @@ static int fetch_irq_intel(struct device *dev, struct ltq_uart_port *ltq_port)
|
||||||
struct uart_port *port = <q_port->port;
|
struct uart_port *port = <q_port->port;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = of_irq_get(dev->of_node, 0);
|
ret = platform_get_irq(to_platform_device(dev), 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(dev, "failed to fetch IRQ for serial port\n");
|
dev_err(dev, "failed to fetch IRQ for serial port\n");
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Reference in a new issue