diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-27 10:35:41 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-27 10:35:41 +0400 |
commit | 5fffb9513cb7fdd39e03c4cab1cda9c2f2694576 (patch) | |
tree | f28f1c232dd5774c9157ba257df37e66d4097870 /drivers/tty/serial/imx.c | |
parent | b96d71571f7745216ef63f13770b5a10b94ddd34 (diff) | |
parent | ae97159aed6eff68f4ac86472b018985f071fed5 (diff) | |
download | linux-5fffb9513cb7fdd39e03c4cab1cda9c2f2694576.tar.xz |
Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6
* 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6:
of_mdio: Don't phy_scan_fixups() twice
Devicetree: Expand on ARM Primecell binding documentation
dt: Add empty of_match_node() macro
dt: add empty dt helpers for non-dt build
devicetree: fix build error on drivers/tty/serial/altera_jtaguart.c
devicetree: Add ARM pl022 spi controller binding doc
devicetree: Add ARM pl061 gpio controller binding doc
of/irq: of_irq_find_parent: check for parent equal to child
MAINTAINERS: update devicetree maintainers
dt: add helper to read 64-bit integers
tty: use of_match_ptr() for of_match_table entry
OF: Add of_match_ptr() macro
dt: add empty for_each_child_of_node, of_find_property
devicetree: Document Qualcomm and Atmel prefixes
serial/imx: add of_alias_get_id() reference back
dt: add of_alias_scan and of_alias_get_id
devicetree: Add a registry of vendor prefixes
Diffstat (limited to 'drivers/tty/serial/imx.c')
-rw-r--r-- | drivers/tty/serial/imx.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 54ffdc6243f9..163fc9021f5a 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1290,17 +1290,20 @@ static int serial_imx_resume(struct platform_device *dev) static int serial_imx_probe_dt(struct imx_port *sport, struct platform_device *pdev) { - static int portnum = 0; struct device_node *np = pdev->dev.of_node; const struct of_device_id *of_id = of_match_device(imx_uart_dt_ids, &pdev->dev); + int ret; if (!np) return -ENODEV; - sport->port.line = portnum++; - if (sport->port.line >= UART_NR) - return -EINVAL; + ret = of_alias_get_id(np, "serial"); + if (ret < 0) { + dev_err(&pdev->dev, "failed to get alias id, errno %d\n", ret); + return -ENODEV; + } + sport->port.line = ret; if (of_get_property(np, "fsl,uart-has-rtscts", NULL)) sport->have_rtscts = 1; |