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>
This commit is contained in:
@@ -589,9 +589,8 @@ static void msm_release_port(struct uart_port *port)
|
|||||||
iowrite32(GSBI_PROTOCOL_IDLE, msm_port->gsbi_base +
|
iowrite32(GSBI_PROTOCOL_IDLE, msm_port->gsbi_base +
|
||||||
GSBI_CONTROL);
|
GSBI_CONTROL);
|
||||||
|
|
||||||
gsbi_resource = platform_get_resource_byname(pdev,
|
gsbi_resource = platform_get_resource(pdev,
|
||||||
IORESOURCE_MEM,
|
IORESOURCE_MEM, 1);
|
||||||
"gsbi_resource");
|
|
||||||
|
|
||||||
if (unlikely(!gsbi_resource))
|
if (unlikely(!gsbi_resource))
|
||||||
return;
|
return;
|
||||||
@@ -612,8 +611,7 @@ static int msm_request_port(struct uart_port *port)
|
|||||||
resource_size_t size;
|
resource_size_t size;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
uart_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
uart_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
"uart_resource");
|
|
||||||
if (unlikely(!uart_resource))
|
if (unlikely(!uart_resource))
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
|
|
||||||
@@ -628,8 +626,7 @@ static int msm_request_port(struct uart_port *port)
|
|||||||
goto fail_release_port;
|
goto fail_release_port;
|
||||||
}
|
}
|
||||||
|
|
||||||
gsbi_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
gsbi_resource = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
||||||
"gsbi_resource");
|
|
||||||
/* Is this a GSBI-based port? */
|
/* Is this a GSBI-based port? */
|
||||||
if (gsbi_resource) {
|
if (gsbi_resource) {
|
||||||
size = resource_size(gsbi_resource);
|
size = resource_size(gsbi_resource);
|
||||||
@@ -875,7 +872,7 @@ static int __init msm_serial_probe(struct platform_device *pdev)
|
|||||||
port->dev = &pdev->dev;
|
port->dev = &pdev->dev;
|
||||||
msm_port = UART_TO_MSM(port);
|
msm_port = UART_TO_MSM(port);
|
||||||
|
|
||||||
if (platform_get_resource_byname(pdev, IORESOURCE_MEM, "gsbi_resource"))
|
if (platform_get_resource(pdev, IORESOURCE_MEM, 1))
|
||||||
msm_port->is_uartdm = 1;
|
msm_port->is_uartdm = 1;
|
||||||
else
|
else
|
||||||
msm_port->is_uartdm = 0;
|
msm_port->is_uartdm = 0;
|
||||||
@@ -899,8 +896,7 @@ static int __init msm_serial_probe(struct platform_device *pdev)
|
|||||||
printk(KERN_INFO "uartclk = %d\n", port->uartclk);
|
printk(KERN_INFO "uartclk = %d\n", port->uartclk);
|
||||||
|
|
||||||
|
|
||||||
resource = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
"uart_resource");
|
|
||||||
if (unlikely(!resource))
|
if (unlikely(!resource))
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
port->mapbase = resource->start;
|
port->mapbase = resource->start;
|
||||||
|
Reference in New Issue
Block a user