aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty/serial/imx.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-27 08:35:41 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-27 08:35:41 +0200
commit5fffb9513cb7fdd39e03c4cab1cda9c2f2694576 (patch)
treef28f1c232dd5774c9157ba257df37e66d4097870 /drivers/tty/serial/imx.c
parentb96d71571f7745216ef63f13770b5a10b94ddd34 (diff)
parentae97159aed6eff68f4ac86472b018985f071fed5 (diff)
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.c11
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;