aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/imx.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2008-07-05 04:02:45 -0400
committerRobert Schwebel <r.schwebel@pengutronix.de>2008-07-05 04:02:45 -0400
commit2582d8c1655f2eda42d5358a242b256fd6e88571 (patch)
tree4752d862dc8aa94d0a59f084106538850e09d5de /drivers/serial/imx.c
parent036bb15ec94216e28cb1550af0fdcdfb90c549df (diff)
IMX UART: Add board specific init/exit functions
Add platform specific init functions. Also rename the struct platform_device dev into pdev. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial/imx.c')
-rw-r--r--drivers/serial/imx.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index 6226e66c7966..77968432b81e 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -1078,30 +1078,40 @@ static int serial_imx_resume(struct platform_device *dev)
1078 return 0; 1078 return 0;
1079} 1079}
1080 1080
1081static int serial_imx_probe(struct platform_device *dev) 1081static int serial_imx_probe(struct platform_device *pdev)
1082{ 1082{
1083 struct imxuart_platform_data *pdata; 1083 struct imxuart_platform_data *pdata;
1084 1084
1085 imx_ports[dev->id].port.dev = &dev->dev; 1085 imx_ports[pdev->id].port.dev = &pdev->dev;
1086 1086
1087 pdata = (struct imxuart_platform_data *)dev->dev.platform_data; 1087 pdata = pdev->dev.platform_data;
1088 if(pdata && (pdata->flags & IMXUART_HAVE_RTSCTS)) 1088 if(pdata && (pdata->flags & IMXUART_HAVE_RTSCTS))
1089 imx_ports[dev->id].have_rtscts = 1; 1089 imx_ports[pdev->id].have_rtscts = 1;
1090
1091 if (pdata->init)
1092 pdata->init(pdev);
1093
1094 uart_add_one_port(&imx_reg, &imx_ports[pdev->id].port);
1095 platform_set_drvdata(pdev, &imx_ports[pdev->id]);
1090 1096
1091 uart_add_one_port(&imx_reg, &imx_ports[dev->id].port);
1092 platform_set_drvdata(dev, &imx_ports[dev->id]);
1093 return 0; 1097 return 0;
1094} 1098}
1095 1099
1096static int serial_imx_remove(struct platform_device *dev) 1100static int serial_imx_remove(struct platform_device *pdev)
1097{ 1101{
1098 struct imx_port *sport = platform_get_drvdata(dev); 1102 struct imxuart_platform_data *pdata;
1103 struct imx_port *sport = platform_get_drvdata(pdev);
1099 1104
1100 platform_set_drvdata(dev, NULL); 1105 pdata = pdev->dev.platform_data;
1106
1107 platform_set_drvdata(pdev, NULL);
1101 1108
1102 if (sport) 1109 if (sport)
1103 uart_remove_one_port(&imx_reg, &sport->port); 1110 uart_remove_one_port(&imx_reg, &sport->port);
1104 1111
1112 if (pdata->exit)
1113 pdata->exit(pdev);
1114
1105 return 0; 1115 return 0;
1106} 1116}
1107 1117