diff options
author | Michal Simek <michal.simek@xilinx.com> | 2015-04-13 10:34:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-28 08:26:21 -0400 |
commit | 5c90c07b98c02198d9777a7c4f3047b0a94bf7ed (patch) | |
tree | 8acd947d49a45f01888b9607787fde0816004b21 | |
parent | 10afbe346bba125e2eedfd1a89b7bd5c92900859 (diff) |
serial: xilinx: Use platform_get_irq to get irq description structure
For systems with CONFIG_SERIAL_OF_PLATFORM=y and device_type =
"serial"; property in DT of_serial.c driver maps and unmaps IRQ (because
driver probe fails). Then a driver is called but irq mapping is not
created that's why driver is failing again in again on request_irq().
Based on this use platform_get_irq() instead of platform_get_resource()
which is doing irq_desc allocation and driver itself can request IRQ.
Fix both xilinx serial drivers in the tree.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/uartlite.c | 11 | ||||
-rw-r--r-- | drivers/tty/serial/xilinx_uartps.c | 12 |
2 files changed, 12 insertions, 11 deletions
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index 708eead850b0..b1c6bd3d483f 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c | |||
@@ -632,7 +632,8 @@ MODULE_DEVICE_TABLE(of, ulite_of_match); | |||
632 | 632 | ||
633 | static int ulite_probe(struct platform_device *pdev) | 633 | static int ulite_probe(struct platform_device *pdev) |
634 | { | 634 | { |
635 | struct resource *res, *res2; | 635 | struct resource *res; |
636 | int irq; | ||
636 | int id = pdev->id; | 637 | int id = pdev->id; |
637 | #ifdef CONFIG_OF | 638 | #ifdef CONFIG_OF |
638 | const __be32 *prop; | 639 | const __be32 *prop; |
@@ -646,11 +647,11 @@ static int ulite_probe(struct platform_device *pdev) | |||
646 | if (!res) | 647 | if (!res) |
647 | return -ENODEV; | 648 | return -ENODEV; |
648 | 649 | ||
649 | res2 = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 650 | irq = platform_get_irq(pdev, 0); |
650 | if (!res2) | 651 | if (irq <= 0) |
651 | return -ENODEV; | 652 | return -ENXIO; |
652 | 653 | ||
653 | return ulite_assign(&pdev->dev, id, res->start, res2->start); | 654 | return ulite_assign(&pdev->dev, id, res->start, irq); |
654 | } | 655 | } |
655 | 656 | ||
656 | static int ulite_remove(struct platform_device *pdev) | 657 | static int ulite_remove(struct platform_device *pdev) |
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index f218ec658f5d..3ddbac767db3 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c | |||
@@ -1331,9 +1331,9 @@ static SIMPLE_DEV_PM_OPS(cdns_uart_dev_pm_ops, cdns_uart_suspend, | |||
1331 | */ | 1331 | */ |
1332 | static int cdns_uart_probe(struct platform_device *pdev) | 1332 | static int cdns_uart_probe(struct platform_device *pdev) |
1333 | { | 1333 | { |
1334 | int rc, id; | 1334 | int rc, id, irq; |
1335 | struct uart_port *port; | 1335 | struct uart_port *port; |
1336 | struct resource *res, *res2; | 1336 | struct resource *res; |
1337 | struct cdns_uart *cdns_uart_data; | 1337 | struct cdns_uart *cdns_uart_data; |
1338 | 1338 | ||
1339 | cdns_uart_data = devm_kzalloc(&pdev->dev, sizeof(*cdns_uart_data), | 1339 | cdns_uart_data = devm_kzalloc(&pdev->dev, sizeof(*cdns_uart_data), |
@@ -1380,9 +1380,9 @@ static int cdns_uart_probe(struct platform_device *pdev) | |||
1380 | goto err_out_clk_disable; | 1380 | goto err_out_clk_disable; |
1381 | } | 1381 | } |
1382 | 1382 | ||
1383 | res2 = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 1383 | irq = platform_get_irq(pdev, 0); |
1384 | if (!res2) { | 1384 | if (irq <= 0) { |
1385 | rc = -ENODEV; | 1385 | rc = -ENXIO; |
1386 | goto err_out_clk_disable; | 1386 | goto err_out_clk_disable; |
1387 | } | 1387 | } |
1388 | 1388 | ||
@@ -1411,7 +1411,7 @@ static int cdns_uart_probe(struct platform_device *pdev) | |||
1411 | * and triggers invocation of the config_port() entry point. | 1411 | * and triggers invocation of the config_port() entry point. |
1412 | */ | 1412 | */ |
1413 | port->mapbase = res->start; | 1413 | port->mapbase = res->start; |
1414 | port->irq = res2->start; | 1414 | port->irq = irq; |
1415 | port->dev = &pdev->dev; | 1415 | port->dev = &pdev->dev; |
1416 | port->uartclk = clk_get_rate(cdns_uart_data->uartclk); | 1416 | port->uartclk = clk_get_rate(cdns_uart_data->uartclk); |
1417 | port->private_data = cdns_uart_data; | 1417 | port->private_data = cdns_uart_data; |