aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-07-30 04:06:57 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-31 20:56:15 -0400
commit574de559c1797618fd8ed03576837eb3113c5d26 (patch)
treecbc8d8eeeff81fe6de1f6b33c053feed9fb4b1be
parente26439ce03f0808f5d797ca33f180fdb8258335a (diff)
serial: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/8250/8250_core.c2
-rw-r--r--drivers/tty/serial/altera_jtaguart.c3
-rw-r--r--drivers/tty/serial/altera_uart.c2
-rw-r--r--drivers/tty/serial/amba-pl010.c2
-rw-r--r--drivers/tty/serial/amba-pl011.c14
-rw-r--r--drivers/tty/serial/ar933x_uart.c2
-rw-r--r--drivers/tty/serial/arc_uart.c2
-rw-r--r--drivers/tty/serial/atmel_serial.c10
-rw-r--r--drivers/tty/serial/bfin_sport_uart.c7
-rw-r--r--drivers/tty/serial/bfin_uart.c11
-rw-r--r--drivers/tty/serial/ifx6x60.c2
-rw-r--r--drivers/tty/serial/imx.c10
-rw-r--r--drivers/tty/serial/max3100.c2
-rw-r--r--drivers/tty/serial/mcf.c3
-rw-r--r--drivers/tty/serial/mpsc.c4
-rw-r--r--drivers/tty/serial/msm_serial_hs.c2
-rw-r--r--drivers/tty/serial/omap-serial.c6
-rw-r--r--drivers/tty/serial/samsung.c4
-rw-r--r--drivers/tty/serial/sc26xx.c2
-rw-r--r--drivers/tty/serial/serial_txx9.c2
-rw-r--r--drivers/tty/serial/sh-sci.c2
-rw-r--r--drivers/tty/serial/vr41xx_siu.c2
22 files changed, 50 insertions, 46 deletions
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 86c00b1c5583..570df9d2a5d2 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -3062,7 +3062,7 @@ void serial8250_resume_port(int line)
3062 */ 3062 */
3063static int serial8250_probe(struct platform_device *dev) 3063static int serial8250_probe(struct platform_device *dev)
3064{ 3064{
3065 struct plat_serial8250_port *p = dev->dev.platform_data; 3065 struct plat_serial8250_port *p = dev_get_platdata(&dev->dev);
3066 struct uart_8250_port uart; 3066 struct uart_8250_port uart;
3067 int ret, i, irqflag = 0; 3067 int ret, i, irqflag = 0;
3068 3068
diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c
index c6bdb943726b..2299a34225d4 100644
--- a/drivers/tty/serial/altera_jtaguart.c
+++ b/drivers/tty/serial/altera_jtaguart.c
@@ -408,7 +408,8 @@ static struct uart_driver altera_jtaguart_driver = {
408 408
409static int altera_jtaguart_probe(struct platform_device *pdev) 409static int altera_jtaguart_probe(struct platform_device *pdev)
410{ 410{
411 struct altera_jtaguart_platform_uart *platp = pdev->dev.platform_data; 411 struct altera_jtaguart_platform_uart *platp =
412 dev_get_platdata(&pdev->dev);
412 struct uart_port *port; 413 struct uart_port *port;
413 struct resource *res_irq, *res_mem; 414 struct resource *res_irq, *res_mem;
414 int i = pdev->id; 415 int i = pdev->id;
diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c
index 1d46966e2a65..fa638db9a98c 100644
--- a/drivers/tty/serial/altera_uart.c
+++ b/drivers/tty/serial/altera_uart.c
@@ -534,7 +534,7 @@ static int altera_uart_get_of_uartclk(struct platform_device *pdev,
534 534
535static int altera_uart_probe(struct platform_device *pdev) 535static int altera_uart_probe(struct platform_device *pdev)
536{ 536{
537 struct altera_uart_platform_uart *platp = pdev->dev.platform_data; 537 struct altera_uart_platform_uart *platp = dev_get_platdata(&pdev->dev);
538 struct uart_port *port; 538 struct uart_port *port;
539 struct resource *res_mem; 539 struct resource *res_mem;
540 struct resource *res_irq; 540 struct resource *res_irq;
diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
index c36840519527..8b90f0b6dfdf 100644
--- a/drivers/tty/serial/amba-pl010.c
+++ b/drivers/tty/serial/amba-pl010.c
@@ -721,7 +721,7 @@ static int pl010_probe(struct amba_device *dev, const struct amba_id *id)
721 uap->port.flags = UPF_BOOT_AUTOCONF; 721 uap->port.flags = UPF_BOOT_AUTOCONF;
722 uap->port.line = i; 722 uap->port.line = i;
723 uap->dev = dev; 723 uap->dev = dev;
724 uap->data = dev->dev.platform_data; 724 uap->data = dev_get_platdata(&dev->dev);
725 725
726 amba_ports[i] = uap; 726 amba_ports[i] = uap;
727 727
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 28b35ad9c6cd..eb38fb851b4e 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -265,7 +265,7 @@ static void pl011_sgbuf_free(struct dma_chan *chan, struct pl011_sgbuf *sg,
265static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port *uap) 265static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port *uap)
266{ 266{
267 /* DMA is the sole user of the platform data right now */ 267 /* DMA is the sole user of the platform data right now */
268 struct amba_pl011_data *plat = uap->port.dev->platform_data; 268 struct amba_pl011_data *plat = dev_get_platdata(uap->port.dev);
269 struct dma_slave_config tx_conf = { 269 struct dma_slave_config tx_conf = {
270 .dst_addr = uap->port.mapbase + UART01x_DR, 270 .dst_addr = uap->port.mapbase + UART01x_DR,
271 .dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE, 271 .dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE,
@@ -1497,10 +1497,10 @@ static int pl011_hwinit(struct uart_port *port)
1497 uap->im = readw(uap->port.membase + UART011_IMSC); 1497 uap->im = readw(uap->port.membase + UART011_IMSC);
1498 writew(UART011_RTIM | UART011_RXIM, uap->port.membase + UART011_IMSC); 1498 writew(UART011_RTIM | UART011_RXIM, uap->port.membase + UART011_IMSC);
1499 1499
1500 if (uap->port.dev->platform_data) { 1500 if (dev_get_platdata(uap->port.dev)) {
1501 struct amba_pl011_data *plat; 1501 struct amba_pl011_data *plat;
1502 1502
1503 plat = uap->port.dev->platform_data; 1503 plat = dev_get_platdata(uap->port.dev);
1504 if (plat->init) 1504 if (plat->init)
1505 plat->init(); 1505 plat->init();
1506 } 1506 }
@@ -1645,10 +1645,10 @@ static void pl011_shutdown(struct uart_port *port)
1645 /* Optionally let pins go into sleep states */ 1645 /* Optionally let pins go into sleep states */
1646 pinctrl_pm_select_sleep_state(port->dev); 1646 pinctrl_pm_select_sleep_state(port->dev);
1647 1647
1648 if (uap->port.dev->platform_data) { 1648 if (dev_get_platdata(uap->port.dev)) {
1649 struct amba_pl011_data *plat; 1649 struct amba_pl011_data *plat;
1650 1650
1651 plat = uap->port.dev->platform_data; 1651 plat = dev_get_platdata(uap->port.dev);
1652 if (plat->exit) 1652 if (plat->exit)
1653 plat->exit(); 1653 plat->exit();
1654 } 1654 }
@@ -2002,10 +2002,10 @@ static int __init pl011_console_setup(struct console *co, char *options)
2002 if (ret) 2002 if (ret)
2003 return ret; 2003 return ret;
2004 2004
2005 if (uap->port.dev->platform_data) { 2005 if (dev_get_platdata(uap->port.dev)) {
2006 struct amba_pl011_data *plat; 2006 struct amba_pl011_data *plat;
2007 2007
2008 plat = uap->port.dev->platform_data; 2008 plat = dev_get_platdata(uap->port.dev);
2009 if (plat->init) 2009 if (plat->init)
2010 plat->init(); 2010 plat->init();
2011 } 2011 }
diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c
index 9824dfb1e4fe..7aa9062153e8 100644
--- a/drivers/tty/serial/ar933x_uart.c
+++ b/drivers/tty/serial/ar933x_uart.c
@@ -629,7 +629,7 @@ static int ar933x_uart_probe(struct platform_device *pdev)
629 int id; 629 int id;
630 int ret; 630 int ret;
631 631
632 pdata = pdev->dev.platform_data; 632 pdata = dev_get_platdata(&pdev->dev);
633 if (!pdata) 633 if (!pdata)
634 return -EINVAL; 634 return -EINVAL;
635 635
diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c
index cbf1d155b7b2..2f195f0d7a11 100644
--- a/drivers/tty/serial/arc_uart.c
+++ b/drivers/tty/serial/arc_uart.c
@@ -528,7 +528,7 @@ arc_uart_init_one(struct platform_device *pdev, int dev_id)
528 unsigned long *plat_data; 528 unsigned long *plat_data;
529 struct arc_uart_port *uart = &arc_uart_ports[dev_id]; 529 struct arc_uart_port *uart = &arc_uart_ports[dev_id];
530 530
531 plat_data = ((unsigned long *)(pdev->dev.platform_data)); 531 plat_data = (unsigned long *)dev_get_platdata(&pdev->dev);
532 if (!plat_data) 532 if (!plat_data)
533 return -ENODEV; 533 return -ENODEV;
534 534
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 7e2cb31497c3..d067285a2d20 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1393,7 +1393,7 @@ static int atmel_init_property(struct atmel_uart_port *atmel_port,
1393 struct platform_device *pdev) 1393 struct platform_device *pdev)
1394{ 1394{
1395 struct device_node *np = pdev->dev.of_node; 1395 struct device_node *np = pdev->dev.of_node;
1396 struct atmel_uart_data *pdata = pdev->dev.platform_data; 1396 struct atmel_uart_data *pdata = dev_get_platdata(&pdev->dev);
1397 1397
1398 if (np) { 1398 if (np) {
1399 /* DMA/PDC usage specification */ 1399 /* DMA/PDC usage specification */
@@ -1437,7 +1437,7 @@ static void atmel_init_rs485(struct atmel_uart_port *atmel_port,
1437 struct platform_device *pdev) 1437 struct platform_device *pdev)
1438{ 1438{
1439 struct device_node *np = pdev->dev.of_node; 1439 struct device_node *np = pdev->dev.of_node;
1440 struct atmel_uart_data *pdata = pdev->dev.platform_data; 1440 struct atmel_uart_data *pdata = dev_get_platdata(&pdev->dev);
1441 1441
1442 if (np) { 1442 if (np) {
1443 u32 rs485_delay[2]; 1443 u32 rs485_delay[2];
@@ -2028,7 +2028,7 @@ static int atmel_init_port(struct atmel_uart_port *atmel_port,
2028{ 2028{
2029 int ret; 2029 int ret;
2030 struct uart_port *port = &atmel_port->uart; 2030 struct uart_port *port = &atmel_port->uart;
2031 struct atmel_uart_data *pdata = pdev->dev.platform_data; 2031 struct atmel_uart_data *pdata = dev_get_platdata(&pdev->dev);
2032 2032
2033 if (!atmel_init_property(atmel_port, pdev)) 2033 if (!atmel_init_property(atmel_port, pdev))
2034 atmel_set_ops(port); 2034 atmel_set_ops(port);
@@ -2226,7 +2226,7 @@ static int __init atmel_console_init(void)
2226 int ret; 2226 int ret;
2227 if (atmel_default_console_device) { 2227 if (atmel_default_console_device) {
2228 struct atmel_uart_data *pdata = 2228 struct atmel_uart_data *pdata =
2229 atmel_default_console_device->dev.platform_data; 2229 dev_get_platdata(&atmel_default_console_device->dev);
2230 int id = pdata->num; 2230 int id = pdata->num;
2231 struct atmel_uart_port *port = &atmel_ports[id]; 2231 struct atmel_uart_port *port = &atmel_ports[id];
2232 2232
@@ -2334,7 +2334,7 @@ static int atmel_serial_probe(struct platform_device *pdev)
2334{ 2334{
2335 struct atmel_uart_port *port; 2335 struct atmel_uart_port *port;
2336 struct device_node *np = pdev->dev.of_node; 2336 struct device_node *np = pdev->dev.of_node;
2337 struct atmel_uart_data *pdata = pdev->dev.platform_data; 2337 struct atmel_uart_data *pdata = dev_get_platdata(&pdev->dev);
2338 void *data; 2338 void *data;
2339 int ret = -ENODEV; 2339 int ret = -ENODEV;
2340 2340
diff --git a/drivers/tty/serial/bfin_sport_uart.c b/drivers/tty/serial/bfin_sport_uart.c
index 487c173b0f72..424ed36c26f1 100644
--- a/drivers/tty/serial/bfin_sport_uart.c
+++ b/drivers/tty/serial/bfin_sport_uart.c
@@ -766,7 +766,8 @@ static int sport_uart_probe(struct platform_device *pdev)
766 } 766 }
767 767
768 ret = peripheral_request_list( 768 ret = peripheral_request_list(
769 (unsigned short *)pdev->dev.platform_data, DRV_NAME); 769 (unsigned short *)dev_get_platdata(&pdev->dev),
770 DRV_NAME);
770 if (ret) { 771 if (ret) {
771 dev_err(&pdev->dev, 772 dev_err(&pdev->dev,
772 "Fail to request SPORT peripherals\n"); 773 "Fail to request SPORT peripherals\n");
@@ -843,7 +844,7 @@ out_error_unmap:
843 iounmap(sport->port.membase); 844 iounmap(sport->port.membase);
844out_error_free_peripherals: 845out_error_free_peripherals:
845 peripheral_free_list( 846 peripheral_free_list(
846 (unsigned short *)pdev->dev.platform_data); 847 (unsigned short *)dev_get_platdata(&pdev->dev));
847out_error_free_mem: 848out_error_free_mem:
848 kfree(sport); 849 kfree(sport);
849 bfin_sport_uart_ports[pdev->id] = NULL; 850 bfin_sport_uart_ports[pdev->id] = NULL;
@@ -863,7 +864,7 @@ static int sport_uart_remove(struct platform_device *pdev)
863 uart_remove_one_port(&sport_uart_reg, &sport->port); 864 uart_remove_one_port(&sport_uart_reg, &sport->port);
864 iounmap(sport->port.membase); 865 iounmap(sport->port.membase);
865 peripheral_free_list( 866 peripheral_free_list(
866 (unsigned short *)pdev->dev.platform_data); 867 (unsigned short *)dev_get_platdata(&pdev->dev));
867 kfree(sport); 868 kfree(sport);
868 bfin_sport_uart_ports[pdev->id] = NULL; 869 bfin_sport_uart_ports[pdev->id] = NULL;
869 } 870 }
diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c
index 72031d754dc0..378f3c383992 100644
--- a/drivers/tty/serial/bfin_uart.c
+++ b/drivers/tty/serial/bfin_uart.c
@@ -1240,7 +1240,8 @@ static int bfin_serial_probe(struct platform_device *pdev)
1240 */ 1240 */
1241#endif 1241#endif
1242 ret = peripheral_request_list( 1242 ret = peripheral_request_list(
1243 (unsigned short *)pdev->dev.platform_data, DRIVER_NAME); 1243 (unsigned short *)dev_get_platdata(&pdev->dev),
1244 DRIVER_NAME);
1244 if (ret) { 1245 if (ret) {
1245 dev_err(&pdev->dev, 1246 dev_err(&pdev->dev,
1246 "fail to request bfin serial peripherals\n"); 1247 "fail to request bfin serial peripherals\n");
@@ -1358,7 +1359,7 @@ out_error_unmap:
1358 iounmap(uart->port.membase); 1359 iounmap(uart->port.membase);
1359out_error_free_peripherals: 1360out_error_free_peripherals:
1360 peripheral_free_list( 1361 peripheral_free_list(
1361 (unsigned short *)pdev->dev.platform_data); 1362 (unsigned short *)dev_get_platdata(&pdev->dev));
1362out_error_free_mem: 1363out_error_free_mem:
1363 kfree(uart); 1364 kfree(uart);
1364 bfin_serial_ports[pdev->id] = NULL; 1365 bfin_serial_ports[pdev->id] = NULL;
@@ -1377,7 +1378,7 @@ static int bfin_serial_remove(struct platform_device *pdev)
1377 uart_remove_one_port(&bfin_serial_reg, &uart->port); 1378 uart_remove_one_port(&bfin_serial_reg, &uart->port);
1378 iounmap(uart->port.membase); 1379 iounmap(uart->port.membase);
1379 peripheral_free_list( 1380 peripheral_free_list(
1380 (unsigned short *)pdev->dev.platform_data); 1381 (unsigned short *)dev_get_platdata(&pdev->dev));
1381 kfree(uart); 1382 kfree(uart);
1382 bfin_serial_ports[pdev->id] = NULL; 1383 bfin_serial_ports[pdev->id] = NULL;
1383 } 1384 }
@@ -1432,7 +1433,7 @@ static int bfin_earlyprintk_probe(struct platform_device *pdev)
1432 } 1433 }
1433 1434
1434 ret = peripheral_request_list( 1435 ret = peripheral_request_list(
1435 (unsigned short *)pdev->dev.platform_data, DRIVER_NAME); 1436 (unsigned short *)dev_get_platdata(&pdev->dev), DRIVER_NAME);
1436 if (ret) { 1437 if (ret) {
1437 dev_err(&pdev->dev, 1438 dev_err(&pdev->dev,
1438 "fail to request bfin serial peripherals\n"); 1439 "fail to request bfin serial peripherals\n");
@@ -1463,7 +1464,7 @@ static int bfin_earlyprintk_probe(struct platform_device *pdev)
1463 1464
1464out_error_free_peripherals: 1465out_error_free_peripherals:
1465 peripheral_free_list( 1466 peripheral_free_list(
1466 (unsigned short *)pdev->dev.platform_data); 1467 (unsigned short *)dev_get_platdata(&pdev->dev));
1467 1468
1468 return ret; 1469 return ret;
1469} 1470}
diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c
index 8b1534c424af..af286e6713eb 100644
--- a/drivers/tty/serial/ifx6x60.c
+++ b/drivers/tty/serial/ifx6x60.c
@@ -1008,7 +1008,7 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
1008 return -ENODEV; 1008 return -ENODEV;
1009 } 1009 }
1010 1010
1011 pl_data = (struct ifx_modem_platform_data *)spi->dev.platform_data; 1011 pl_data = (struct ifx_modem_platform_data *)dev_get_platdata(&spi->dev);
1012 if (!pl_data) { 1012 if (!pl_data) {
1013 dev_err(&spi->dev, "missing platform data!"); 1013 dev_err(&spi->dev, "missing platform data!");
1014 return -ENODEV; 1014 return -ENODEV;
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 90655b875bab..a5f32c7c6c66 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1222,7 +1222,7 @@ static int imx_startup(struct uart_port *port)
1222 1222
1223 if (USE_IRDA(sport)) { 1223 if (USE_IRDA(sport)) {
1224 struct imxuart_platform_data *pdata; 1224 struct imxuart_platform_data *pdata;
1225 pdata = sport->port.dev->platform_data; 1225 pdata = dev_get_platdata(sport->port.dev);
1226 sport->irda_inv_rx = pdata->irda_inv_rx; 1226 sport->irda_inv_rx = pdata->irda_inv_rx;
1227 sport->irda_inv_tx = pdata->irda_inv_tx; 1227 sport->irda_inv_tx = pdata->irda_inv_tx;
1228 sport->trcv_delay = pdata->transceiver_delay; 1228 sport->trcv_delay = pdata->transceiver_delay;
@@ -1265,7 +1265,7 @@ static void imx_shutdown(struct uart_port *port)
1265 1265
1266 if (USE_IRDA(sport)) { 1266 if (USE_IRDA(sport)) {
1267 struct imxuart_platform_data *pdata; 1267 struct imxuart_platform_data *pdata;
1268 pdata = sport->port.dev->platform_data; 1268 pdata = dev_get_platdata(sport->port.dev);
1269 if (pdata->irda_enable) 1269 if (pdata->irda_enable)
1270 pdata->irda_enable(0); 1270 pdata->irda_enable(0);
1271 } 1271 }
@@ -1925,7 +1925,7 @@ static inline int serial_imx_probe_dt(struct imx_port *sport,
1925static void serial_imx_probe_pdata(struct imx_port *sport, 1925static void serial_imx_probe_pdata(struct imx_port *sport,
1926 struct platform_device *pdev) 1926 struct platform_device *pdev)
1927{ 1927{
1928 struct imxuart_platform_data *pdata = pdev->dev.platform_data; 1928 struct imxuart_platform_data *pdata = dev_get_platdata(&pdev->dev);
1929 1929
1930 sport->port.line = pdev->id; 1930 sport->port.line = pdev->id;
1931 sport->devdata = (struct imx_uart_data *) pdev->id_entry->driver_data; 1931 sport->devdata = (struct imx_uart_data *) pdev->id_entry->driver_data;
@@ -2000,7 +2000,7 @@ static int serial_imx_probe(struct platform_device *pdev)
2000 2000
2001 imx_ports[sport->port.line] = sport; 2001 imx_ports[sport->port.line] = sport;
2002 2002
2003 pdata = pdev->dev.platform_data; 2003 pdata = dev_get_platdata(&pdev->dev);
2004 if (pdata && pdata->init) { 2004 if (pdata && pdata->init) {
2005 ret = pdata->init(pdev); 2005 ret = pdata->init(pdev);
2006 if (ret) 2006 if (ret)
@@ -2024,7 +2024,7 @@ static int serial_imx_remove(struct platform_device *pdev)
2024 struct imxuart_platform_data *pdata; 2024 struct imxuart_platform_data *pdata;
2025 struct imx_port *sport = platform_get_drvdata(pdev); 2025 struct imx_port *sport = platform_get_drvdata(pdev);
2026 2026
2027 pdata = pdev->dev.platform_data; 2027 pdata = dev_get_platdata(&pdev->dev);
2028 2028
2029 uart_remove_one_port(&imx_reg, &sport->port); 2029 uart_remove_one_port(&imx_reg, &sport->port);
2030 2030
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index 35866d5872ad..79f9a9eff545 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -779,7 +779,7 @@ static int max3100_probe(struct spi_device *spi)
779 max3100s[i]->irq = spi->irq; 779 max3100s[i]->irq = spi->irq;
780 spin_lock_init(&max3100s[i]->conf_lock); 780 spin_lock_init(&max3100s[i]->conf_lock);
781 spi_set_drvdata(spi, max3100s[i]); 781 spi_set_drvdata(spi, max3100s[i]);
782 pdata = spi->dev.platform_data; 782 pdata = dev_get_platdata(&spi->dev);
783 max3100s[i]->crystal = pdata->crystal; 783 max3100s[i]->crystal = pdata->crystal;
784 max3100s[i]->loopback = pdata->loopback; 784 max3100s[i]->loopback = pdata->loopback;
785 max3100s[i]->poll_time = pdata->poll_time * HZ / 1000; 785 max3100s[i]->poll_time = pdata->poll_time * HZ / 1000;
diff --git a/drivers/tty/serial/mcf.c b/drivers/tty/serial/mcf.c
index 65be0c00c4bf..a2e97c96e159 100644
--- a/drivers/tty/serial/mcf.c
+++ b/drivers/tty/serial/mcf.c
@@ -24,6 +24,7 @@
24#include <linux/serial_core.h> 24#include <linux/serial_core.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/uaccess.h> 26#include <linux/uaccess.h>
27#include <linux/platform_device.h>
27#include <asm/coldfire.h> 28#include <asm/coldfire.h>
28#include <asm/mcfsim.h> 29#include <asm/mcfsim.h>
29#include <asm/mcfuart.h> 30#include <asm/mcfuart.h>
@@ -644,7 +645,7 @@ static struct uart_driver mcf_driver = {
644 645
645static int mcf_probe(struct platform_device *pdev) 646static int mcf_probe(struct platform_device *pdev)
646{ 647{
647 struct mcf_platform_uart *platp = pdev->dev.platform_data; 648 struct mcf_platform_uart *platp = dev_get_platdata(&pdev->dev);
648 struct uart_port *port; 649 struct uart_port *port;
649 int i; 650 int i;
650 651
diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c
index bc24f4931670..fba52578d02f 100644
--- a/drivers/tty/serial/mpsc.c
+++ b/drivers/tty/serial/mpsc.c
@@ -1884,7 +1884,7 @@ static int mpsc_shared_drv_probe(struct platform_device *dev)
1884 if (dev->id == 0) { 1884 if (dev->id == 0) {
1885 if (!(rc = mpsc_shared_map_regs(dev))) { 1885 if (!(rc = mpsc_shared_map_regs(dev))) {
1886 pdata = (struct mpsc_shared_pdata *) 1886 pdata = (struct mpsc_shared_pdata *)
1887 dev->dev.platform_data; 1887 dev_get_platdata(&dev->dev);
1888 1888
1889 mpsc_shared_regs.MPSC_MRR_m = pdata->mrr_val; 1889 mpsc_shared_regs.MPSC_MRR_m = pdata->mrr_val;
1890 mpsc_shared_regs.MPSC_RCRR_m= pdata->rcrr_val; 1890 mpsc_shared_regs.MPSC_RCRR_m= pdata->rcrr_val;
@@ -2025,7 +2025,7 @@ static void mpsc_drv_get_platform_data(struct mpsc_port_info *pi,
2025{ 2025{
2026 struct mpsc_pdata *pdata; 2026 struct mpsc_pdata *pdata;
2027 2027
2028 pdata = (struct mpsc_pdata *)pd->dev.platform_data; 2028 pdata = (struct mpsc_pdata *)dev_get_platdata(&pd->dev);
2029 2029
2030 pi->port.uartclk = pdata->brg_clk_freq; 2030 pi->port.uartclk = pdata->brg_clk_freq;
2031 pi->port.iotype = UPIO_MEM; 2031 pi->port.iotype = UPIO_MEM;
diff --git a/drivers/tty/serial/msm_serial_hs.c b/drivers/tty/serial/msm_serial_hs.c
index 4ca2f64861e6..48e94961a9e5 100644
--- a/drivers/tty/serial/msm_serial_hs.c
+++ b/drivers/tty/serial/msm_serial_hs.c
@@ -1618,7 +1618,7 @@ static int msm_hs_probe(struct platform_device *pdev)
1618 struct msm_hs_port *msm_uport; 1618 struct msm_hs_port *msm_uport;
1619 struct resource *resource; 1619 struct resource *resource;
1620 const struct msm_serial_hs_platform_data *pdata = 1620 const struct msm_serial_hs_platform_data *pdata =
1621 pdev->dev.platform_data; 1621 dev_get_platdata(&pdev->dev);
1622 1622
1623 if (pdev->id < 0 || pdev->id >= UARTDM_NR) { 1623 if (pdev->id < 0 || pdev->id >= UARTDM_NR) {
1624 printk(KERN_ERR "Invalid plaform device ID = %d\n", pdev->id); 1624 printk(KERN_ERR "Invalid plaform device ID = %d\n", pdev->id);
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index c77bf0cf2684..c7517063eb9b 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -200,7 +200,7 @@ static inline void serial_omap_clear_fifos(struct uart_omap_port *up)
200 200
201static int serial_omap_get_context_loss_count(struct uart_omap_port *up) 201static int serial_omap_get_context_loss_count(struct uart_omap_port *up)
202{ 202{
203 struct omap_uart_port_info *pdata = up->dev->platform_data; 203 struct omap_uart_port_info *pdata = dev_get_platdata(up->dev);
204 204
205 if (!pdata || !pdata->get_context_loss_count) 205 if (!pdata || !pdata->get_context_loss_count)
206 return -EINVAL; 206 return -EINVAL;
@@ -210,7 +210,7 @@ static int serial_omap_get_context_loss_count(struct uart_omap_port *up)
210 210
211static void serial_omap_enable_wakeup(struct uart_omap_port *up, bool enable) 211static void serial_omap_enable_wakeup(struct uart_omap_port *up, bool enable)
212{ 212{
213 struct omap_uart_port_info *pdata = up->dev->platform_data; 213 struct omap_uart_port_info *pdata = dev_get_platdata(up->dev);
214 214
215 if (!pdata || !pdata->enable_wakeup) 215 if (!pdata || !pdata->enable_wakeup)
216 return; 216 return;
@@ -1409,7 +1409,7 @@ static int serial_omap_probe(struct platform_device *pdev)
1409{ 1409{
1410 struct uart_omap_port *up; 1410 struct uart_omap_port *up;
1411 struct resource *mem, *irq; 1411 struct resource *mem, *irq;
1412 struct omap_uart_port_info *omap_up_info = pdev->dev.platform_data; 1412 struct omap_uart_port_info *omap_up_info = dev_get_platdata(&pdev->dev);
1413 int ret; 1413 int ret;
1414 1414
1415 if (pdev->dev.of_node) { 1415 if (pdev->dev.of_node) {
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index 376079b9bd75..019b9154d7d4 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1250,8 +1250,8 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
1250 1250
1251 ourport->baudclk = ERR_PTR(-EINVAL); 1251 ourport->baudclk = ERR_PTR(-EINVAL);
1252 ourport->info = ourport->drv_data->info; 1252 ourport->info = ourport->drv_data->info;
1253 ourport->cfg = (pdev->dev.platform_data) ? 1253 ourport->cfg = (dev_get_platdata(&pdev->dev)) ?
1254 (struct s3c2410_uartcfg *)pdev->dev.platform_data : 1254 (struct s3c2410_uartcfg *)dev_get_platdata(&pdev->dev) :
1255 ourport->drv_data->def_cfg; 1255 ourport->drv_data->def_cfg;
1256 1256
1257 ourport->port.fifosize = (ourport->info->fifosize) ? 1257 ourport->port.fifosize = (ourport->info->fifosize) ?
diff --git a/drivers/tty/serial/sc26xx.c b/drivers/tty/serial/sc26xx.c
index 4b1434d53e9d..887b4f770749 100644
--- a/drivers/tty/serial/sc26xx.c
+++ b/drivers/tty/serial/sc26xx.c
@@ -637,7 +637,7 @@ static int sc26xx_probe(struct platform_device *dev)
637{ 637{
638 struct resource *res; 638 struct resource *res;
639 struct uart_sc26xx_port *up; 639 struct uart_sc26xx_port *up;
640 unsigned int *sc26xx_data = dev->dev.platform_data; 640 unsigned int *sc26xx_data = dev_get_platdata(&dev->dev);
641 int err; 641 int err;
642 642
643 res = platform_get_resource(dev, IORESOURCE_MEM, 0); 643 res = platform_get_resource(dev, IORESOURCE_MEM, 0);
diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c
index fe48a0c2b4ca..440a962412da 100644
--- a/drivers/tty/serial/serial_txx9.c
+++ b/drivers/tty/serial/serial_txx9.c
@@ -1097,7 +1097,7 @@ static void serial_txx9_unregister_port(int line)
1097 */ 1097 */
1098static int serial_txx9_probe(struct platform_device *dev) 1098static int serial_txx9_probe(struct platform_device *dev)
1099{ 1099{
1100 struct uart_port *p = dev->dev.platform_data; 1100 struct uart_port *p = dev_get_platdata(&dev->dev);
1101 struct uart_port port; 1101 struct uart_port port;
1102 int ret, i; 1102 int ret, i;
1103 1103
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 7477e0ea5cdb..72ca870f8e57 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2380,7 +2380,7 @@ static char early_serial_buf[32];
2380 2380
2381static int sci_probe_earlyprintk(struct platform_device *pdev) 2381static int sci_probe_earlyprintk(struct platform_device *pdev)
2382{ 2382{
2383 struct plat_sci_port *cfg = pdev->dev.platform_data; 2383 struct plat_sci_port *cfg = dev_get_platdata(&pdev->dev);
2384 2384
2385 if (early_serial_console.data) 2385 if (early_serial_console.data)
2386 return -EEXIST; 2386 return -EEXIST;
diff --git a/drivers/tty/serial/vr41xx_siu.c b/drivers/tty/serial/vr41xx_siu.c
index f655997f44af..a63c14bc9a24 100644
--- a/drivers/tty/serial/vr41xx_siu.c
+++ b/drivers/tty/serial/vr41xx_siu.c
@@ -705,7 +705,7 @@ static int siu_init_ports(struct platform_device *pdev)
705{ 705{
706 struct uart_port *port; 706 struct uart_port *port;
707 struct resource *res; 707 struct resource *res;
708 int *type = pdev->dev.platform_data; 708 int *type = dev_get_platdata(&pdev->dev);
709 int i; 709 int i;
710 710
711 if (!type) 711 if (!type)