diff options
author | David Brown <davidb@codeaurora.org> | 2011-08-02 12:02:49 -0400 |
---|---|---|
committer | David Brown <davidb@codeaurora.org> | 2011-08-29 15:47:35 -0400 |
commit | 886a451bd2491de3551c2aea2a2f155f159716c8 (patch) | |
tree | da20c3ccf2fffaf59f04d77e2aefa70279cb3675 /drivers/tty | |
parent | c6a389f123b9f68d605bb7e0f9b32ec1e3e14132 (diff) |
msm_serial: Use relative resources for iomem
Device tree iomem resources are only accessible by index, and not by
name. The msm_serial devices always have either 1 or 2 iomem
resources, that are always in the same order. Convert the
platform_get_resource_byname into just platform_get_resource to
facilitate device tree conversion.
Change-Id: I4fd0f1037e07f2725a2a25c7b07dea2ca9397db7
Signed-off-by: David Brown <davidb@codeaurora.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/msm_serial.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index e6ba83876508..d9863b2c2bc8 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c | |||
@@ -589,9 +589,8 @@ static void msm_release_port(struct uart_port *port) | |||
589 | iowrite32(GSBI_PROTOCOL_IDLE, msm_port->gsbi_base + | 589 | iowrite32(GSBI_PROTOCOL_IDLE, msm_port->gsbi_base + |
590 | GSBI_CONTROL); | 590 | GSBI_CONTROL); |
591 | 591 | ||
592 | gsbi_resource = platform_get_resource_byname(pdev, | 592 | gsbi_resource = platform_get_resource(pdev, |
593 | IORESOURCE_MEM, | 593 | IORESOURCE_MEM, 1); |
594 | "gsbi_resource"); | ||
595 | 594 | ||
596 | if (unlikely(!gsbi_resource)) | 595 | if (unlikely(!gsbi_resource)) |
597 | return; | 596 | return; |
@@ -612,8 +611,7 @@ static int msm_request_port(struct uart_port *port) | |||
612 | resource_size_t size; | 611 | resource_size_t size; |
613 | int ret; | 612 | int ret; |
614 | 613 | ||
615 | uart_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, | 614 | uart_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
616 | "uart_resource"); | ||
617 | if (unlikely(!uart_resource)) | 615 | if (unlikely(!uart_resource)) |
618 | return -ENXIO; | 616 | return -ENXIO; |
619 | 617 | ||
@@ -628,8 +626,7 @@ static int msm_request_port(struct uart_port *port) | |||
628 | goto fail_release_port; | 626 | goto fail_release_port; |
629 | } | 627 | } |
630 | 628 | ||
631 | gsbi_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, | 629 | gsbi_resource = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
632 | "gsbi_resource"); | ||
633 | /* Is this a GSBI-based port? */ | 630 | /* Is this a GSBI-based port? */ |
634 | if (gsbi_resource) { | 631 | if (gsbi_resource) { |
635 | size = resource_size(gsbi_resource); | 632 | size = resource_size(gsbi_resource); |
@@ -875,7 +872,7 @@ static int __init msm_serial_probe(struct platform_device *pdev) | |||
875 | port->dev = &pdev->dev; | 872 | port->dev = &pdev->dev; |
876 | msm_port = UART_TO_MSM(port); | 873 | msm_port = UART_TO_MSM(port); |
877 | 874 | ||
878 | if (platform_get_resource_byname(pdev, IORESOURCE_MEM, "gsbi_resource")) | 875 | if (platform_get_resource(pdev, IORESOURCE_MEM, 1)) |
879 | msm_port->is_uartdm = 1; | 876 | msm_port->is_uartdm = 1; |
880 | else | 877 | else |
881 | msm_port->is_uartdm = 0; | 878 | msm_port->is_uartdm = 0; |
@@ -899,8 +896,7 @@ static int __init msm_serial_probe(struct platform_device *pdev) | |||
899 | printk(KERN_INFO "uartclk = %d\n", port->uartclk); | 896 | printk(KERN_INFO "uartclk = %d\n", port->uartclk); |
900 | 897 | ||
901 | 898 | ||
902 | resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, | 899 | resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
903 | "uart_resource"); | ||
904 | if (unlikely(!resource)) | 900 | if (unlikely(!resource)) |
905 | return -ENXIO; | 901 | return -ENXIO; |
906 | port->mapbase = resource->start; | 902 | port->mapbase = resource->start; |