diff options
author | John Stultz <john.stultz@linaro.org> | 2011-10-26 13:48:49 -0700 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2011-10-26 13:48:49 -0700 |
commit | 2216773fc021964a413409141d439de4f6a108f7 (patch) | |
tree | 7b2f8cdcdf5fb05d75bd92f0c8d9ac635ceec48c /drivers/tty/serial/imx.c | |
parent | 42ac8ca89aef66618e8ae2d6e48e3f523bfcd69d (diff) | |
parent | af1bdb79ca64ceadc7b44b11929b384eff66ce59 (diff) |
Merge branch 'upstream/linaro-3.1' into linaro-android-3.1-agreen-rebaselinux-linaro-3.1-2011.10-2-android-0
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 7e91b3d368c..99898773706 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1286,17 +1286,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; |