Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial/imx: add of_alias_get_id() reference back

As of_alias_get_id() gets fixed and ready for use, the patch adds the
of_alias_get_id() reference back to imx serial driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
[grant.likely: changed pr_err() to dev_err(), dropped unnecessary else]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

authored by

Shawn Guo and committed by
Grant Likely
ff05967a 611cad72

+7 -4
+7 -4
drivers/tty/serial/imx.c
··· 1286 1286 static int serial_imx_probe_dt(struct imx_port *sport, 1287 1287 struct platform_device *pdev) 1288 1288 { 1289 - static int portnum = 0; 1290 1289 struct device_node *np = pdev->dev.of_node; 1291 1290 const struct of_device_id *of_id = 1292 1291 of_match_device(imx_uart_dt_ids, &pdev->dev); 1292 + int ret; 1293 1293 1294 1294 if (!np) 1295 1295 return -ENODEV; 1296 1296 1297 - sport->port.line = portnum++; 1298 - if (sport->port.line >= UART_NR) 1299 - return -EINVAL; 1297 + ret = of_alias_get_id(np, "serial"); 1298 + if (ret < 0) { 1299 + dev_err(&pdev->dev, "failed to get alias id, errno %d\n", ret); 1300 + return -ENODEV; 1301 + } 1302 + sport->port.line = ret; 1300 1303 1301 1304 if (of_get_property(np, "fsl,uart-has-rtscts", NULL)) 1302 1305 sport->have_rtscts = 1;