forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/tty/serial/8250/8250_pxa.c
....@@ -18,7 +18,6 @@
1818 #include <linux/serial_core.h>
1919 #include <linux/serial_reg.h>
2020 #include <linux/of.h>
21
-#include <linux/of_irq.h>
2221 #include <linux/of_platform.h>
2322 #include <linux/platform_device.h>
2423 #include <linux/slab.h>
....@@ -93,12 +92,15 @@
9392 {
9493 struct uart_8250_port uart = {};
9594 struct pxa8250_data *data;
96
- struct resource *mmres, *irqres;
97
- int ret;
95
+ struct resource *mmres;
96
+ int irq, ret;
97
+
98
+ irq = platform_get_irq(pdev, 0);
99
+ if (irq < 0)
100
+ return irq;
98101
99102 mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
100
- irqres = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
101
- if (!mmres || !irqres)
103
+ if (!mmres)
102104 return -ENODEV;
103105
104106 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
....@@ -121,9 +123,9 @@
121123 uart.port.iotype = UPIO_MEM32;
122124 uart.port.mapbase = mmres->start;
123125 uart.port.regshift = 2;
124
- uart.port.irq = irqres->start;
126
+ uart.port.irq = irq;
125127 uart.port.fifosize = 64;
126
- uart.port.flags = UPF_IOREMAP | UPF_SKIP_TEST;
128
+ uart.port.flags = UPF_IOREMAP | UPF_SKIP_TEST | UPF_FIXED_TYPE;
127129 uart.port.dev = &pdev->dev;
128130 uart.port.uartclk = clk_get_rate(data->clk);
129131 uart.port.pm = serial_pxa_pm;