aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-05-31 00:14:26 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-05-31 00:14:26 -0400
commitd5b732b17ca2fc74f370bdba5aae6c804fac8c35 (patch)
tree4facc6d96116b032a3c1cb2ced9b2a3008e9216e /drivers/serial
parenteb6e8605ee5f5b4e116451bf01b3f35eac446dde (diff)
parent67a3e12b05e055c0415c556a315a3d3eb637e29e (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/68328serial.c2
-rw-r--r--drivers/serial/apbuart.c10
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_core.c9
-rw-r--r--drivers/serial/mpc52xx_uart.c84
-rw-r--r--drivers/serial/nwpserial.c2
-rw-r--r--drivers/serial/of_serial.c12
-rw-r--r--drivers/serial/pmac_zilog.c2
-rw-r--r--drivers/serial/s5pv210.c8
-rw-r--r--drivers/serial/sh-sci.c5
-rw-r--r--drivers/serial/sunhv.c9
-rw-r--r--drivers/serial/sunsab.c13
-rw-r--r--drivers/serial/sunsu.c13
-rw-r--r--drivers/serial/sunzilog.c15
-rw-r--r--drivers/serial/uartlite.c11
-rw-r--r--drivers/serial/ucc_uart.c10
15 files changed, 78 insertions, 127 deletions
diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c
index 78ed24bb6a35..30463862603b 100644
--- a/drivers/serial/68328serial.c
+++ b/drivers/serial/68328serial.c
@@ -1437,7 +1437,7 @@ int m68328_console_setup(struct console *cp, char *arg)
1437 for (i = 0; i < ARRAY_SIZE(baud_table); i++) 1437 for (i = 0; i < ARRAY_SIZE(baud_table); i++)
1438 if (baud_table[i] == n) 1438 if (baud_table[i] == n)
1439 break; 1439 break;
1440 if (i < BAUD_TABLE_SIZE) { 1440 if (i < ARRAY_SIZE(baud_table)) {
1441 m68328_console_baud = n; 1441 m68328_console_baud = n;
1442 m68328_console_cbaud = 0; 1442 m68328_console_cbaud = 0;
1443 if (i > 15) { 1443 if (i > 15) {
diff --git a/drivers/serial/apbuart.c b/drivers/serial/apbuart.c
index fe91319b5f65..0099b8692b60 100644
--- a/drivers/serial/apbuart.c
+++ b/drivers/serial/apbuart.c
@@ -559,7 +559,7 @@ static int __devinit apbuart_probe(struct of_device *op,
559 559
560 i = 0; 560 i = 0;
561 for (i = 0; i < grlib_apbuart_port_nr; i++) { 561 for (i = 0; i < grlib_apbuart_port_nr; i++) {
562 if (op->node == grlib_apbuart_nodes[i]) 562 if (op->dev.of_node == grlib_apbuart_nodes[i])
563 break; 563 break;
564 } 564 }
565 565
@@ -584,12 +584,12 @@ static struct of_device_id __initdata apbuart_match[] = {
584}; 584};
585 585
586static struct of_platform_driver grlib_apbuart_of_driver = { 586static struct of_platform_driver grlib_apbuart_of_driver = {
587 .match_table = apbuart_match,
588 .probe = apbuart_probe, 587 .probe = apbuart_probe,
589 .driver = { 588 .driver = {
590 .owner = THIS_MODULE, 589 .owner = THIS_MODULE,
591 .name = "grlib-apbuart", 590 .name = "grlib-apbuart",
592 }, 591 .of_match_table = apbuart_match,
592 },
593}; 593};
594 594
595 595
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index 300cea768d74..9eb62a256e9a 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -1342,7 +1342,7 @@ static int __devinit cpm_uart_probe(struct of_device *ofdev,
1342 /* initialize the device pointer for the port */ 1342 /* initialize the device pointer for the port */
1343 pinfo->port.dev = &ofdev->dev; 1343 pinfo->port.dev = &ofdev->dev;
1344 1344
1345 ret = cpm_uart_init_port(ofdev->node, pinfo); 1345 ret = cpm_uart_init_port(ofdev->dev.of_node, pinfo);
1346 if (ret) 1346 if (ret)
1347 return ret; 1347 return ret;
1348 1348
@@ -1372,8 +1372,11 @@ static struct of_device_id cpm_uart_match[] = {
1372}; 1372};
1373 1373
1374static struct of_platform_driver cpm_uart_driver = { 1374static struct of_platform_driver cpm_uart_driver = {
1375 .name = "cpm_uart", 1375 .driver = {
1376 .match_table = cpm_uart_match, 1376 .name = "cpm_uart",
1377 .owner = THIS_MODULE,
1378 .of_match_table = cpm_uart_match,
1379 },
1377 .probe = cpm_uart_probe, 1380 .probe = cpm_uart_probe,
1378 .remove = cpm_uart_remove, 1381 .remove = cpm_uart_remove,
1379 }; 1382 };
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 02469c31bf0b..84a35f699016 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -397,34 +397,10 @@ static unsigned long mpc512x_getuartclk(void *p)
397 return mpc5xxx_get_bus_frequency(p); 397 return mpc5xxx_get_bus_frequency(p);
398} 398}
399 399
400#define DEFAULT_FIFO_SIZE 16
401
402static unsigned int __init get_fifo_size(struct device_node *np,
403 char *fifo_name)
404{
405 const unsigned int *fp;
406
407 fp = of_get_property(np, fifo_name, NULL);
408 if (fp)
409 return *fp;
410
411 pr_warning("no %s property in %s node, defaulting to %d\n",
412 fifo_name, np->full_name, DEFAULT_FIFO_SIZE);
413
414 return DEFAULT_FIFO_SIZE;
415}
416
417#define FIFOC(_base) ((struct mpc512x_psc_fifo __iomem *) \
418 ((u32)(_base) + sizeof(struct mpc52xx_psc)))
419
420/* Init PSC FIFO Controller */ 400/* Init PSC FIFO Controller */
421static int __init mpc512x_psc_fifoc_init(void) 401static int __init mpc512x_psc_fifoc_init(void)
422{ 402{
423 struct device_node *np; 403 struct device_node *np;
424 void __iomem *psc;
425 unsigned int tx_fifo_size;
426 unsigned int rx_fifo_size;
427 int fifobase = 0; /* current fifo address in 32 bit words */
428 404
429 np = of_find_compatible_node(NULL, NULL, 405 np = of_find_compatible_node(NULL, NULL,
430 "fsl,mpc5121-psc-fifo"); 406 "fsl,mpc5121-psc-fifo");
@@ -447,51 +423,6 @@ static int __init mpc512x_psc_fifoc_init(void)
447 return -ENODEV; 423 return -ENODEV;
448 } 424 }
449 425
450 for_each_compatible_node(np, NULL, "fsl,mpc5121-psc-uart") {
451 tx_fifo_size = get_fifo_size(np, "fsl,tx-fifo-size");
452 rx_fifo_size = get_fifo_size(np, "fsl,rx-fifo-size");
453
454 /* size in register is in 4 byte units */
455 tx_fifo_size /= 4;
456 rx_fifo_size /= 4;
457 if (!tx_fifo_size)
458 tx_fifo_size = 1;
459 if (!rx_fifo_size)
460 rx_fifo_size = 1;
461
462 psc = of_iomap(np, 0);
463 if (!psc) {
464 pr_err("%s: Can't map %s device\n",
465 __func__, np->full_name);
466 continue;
467 }
468
469 /* FIFO space is 4KiB, check if requested size is available */
470 if ((fifobase + tx_fifo_size + rx_fifo_size) > 0x1000) {
471 pr_err("%s: no fifo space available for %s\n",
472 __func__, np->full_name);
473 iounmap(psc);
474 /*
475 * chances are that another device requests less
476 * fifo space, so we continue.
477 */
478 continue;
479 }
480 /* set tx and rx fifo size registers */
481 out_be32(&FIFOC(psc)->txsz, (fifobase << 16) | tx_fifo_size);
482 fifobase += tx_fifo_size;
483 out_be32(&FIFOC(psc)->rxsz, (fifobase << 16) | rx_fifo_size);
484 fifobase += rx_fifo_size;
485
486 /* reset and enable the slices */
487 out_be32(&FIFOC(psc)->txcmd, 0x80);
488 out_be32(&FIFOC(psc)->txcmd, 0x01);
489 out_be32(&FIFOC(psc)->rxcmd, 0x80);
490 out_be32(&FIFOC(psc)->rxcmd, 0x01);
491
492 iounmap(psc);
493 }
494
495 return 0; 426 return 0;
496} 427}
497 428
@@ -1295,14 +1226,14 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match)
1295 1226
1296 /* Check validity & presence */ 1227 /* Check validity & presence */
1297 for (idx = 0; idx < MPC52xx_PSC_MAXNUM; idx++) 1228 for (idx = 0; idx < MPC52xx_PSC_MAXNUM; idx++)
1298 if (mpc52xx_uart_nodes[idx] == op->node) 1229 if (mpc52xx_uart_nodes[idx] == op->dev.of_node)
1299 break; 1230 break;
1300 if (idx >= MPC52xx_PSC_MAXNUM) 1231 if (idx >= MPC52xx_PSC_MAXNUM)
1301 return -EINVAL; 1232 return -EINVAL;
1302 pr_debug("Found %s assigned to ttyPSC%x\n", 1233 pr_debug("Found %s assigned to ttyPSC%x\n",
1303 mpc52xx_uart_nodes[idx]->full_name, idx); 1234 mpc52xx_uart_nodes[idx]->full_name, idx);
1304 1235
1305 uartclk = psc_ops->getuartclk(op->node); 1236 uartclk = psc_ops->getuartclk(op->dev.of_node);
1306 if (uartclk == 0) { 1237 if (uartclk == 0) {
1307 dev_dbg(&op->dev, "Could not find uart clock frequency!\n"); 1238 dev_dbg(&op->dev, "Could not find uart clock frequency!\n");
1308 return -EINVAL; 1239 return -EINVAL;
@@ -1322,7 +1253,7 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match)
1322 port->dev = &op->dev; 1253 port->dev = &op->dev;
1323 1254
1324 /* Search for IRQ and mapbase */ 1255 /* Search for IRQ and mapbase */
1325 ret = of_address_to_resource(op->node, 0, &res); 1256 ret = of_address_to_resource(op->dev.of_node, 0, &res);
1326 if (ret) 1257 if (ret)
1327 return ret; 1258 return ret;
1328 1259
@@ -1332,7 +1263,7 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match)
1332 return -EINVAL; 1263 return -EINVAL;
1333 } 1264 }
1334 1265
1335 psc_ops->get_irq(port, op->node); 1266 psc_ops->get_irq(port, op->dev.of_node);
1336 if (port->irq == NO_IRQ) { 1267 if (port->irq == NO_IRQ) {
1337 dev_dbg(&op->dev, "Could not get irq\n"); 1268 dev_dbg(&op->dev, "Could not get irq\n");
1338 return -EINVAL; 1269 return -EINVAL;
@@ -1431,15 +1362,16 @@ mpc52xx_uart_of_enumerate(void)
1431MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match); 1362MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match);
1432 1363
1433static struct of_platform_driver mpc52xx_uart_of_driver = { 1364static struct of_platform_driver mpc52xx_uart_of_driver = {
1434 .match_table = mpc52xx_uart_of_match,
1435 .probe = mpc52xx_uart_of_probe, 1365 .probe = mpc52xx_uart_of_probe,
1436 .remove = mpc52xx_uart_of_remove, 1366 .remove = mpc52xx_uart_of_remove,
1437#ifdef CONFIG_PM 1367#ifdef CONFIG_PM
1438 .suspend = mpc52xx_uart_of_suspend, 1368 .suspend = mpc52xx_uart_of_suspend,
1439 .resume = mpc52xx_uart_of_resume, 1369 .resume = mpc52xx_uart_of_resume,
1440#endif 1370#endif
1441 .driver = { 1371 .driver = {
1442 .name = "mpc52xx-psc-uart", 1372 .name = "mpc52xx-psc-uart",
1373 .owner = THIS_MODULE,
1374 .of_match_table = mpc52xx_uart_of_match,
1443 }, 1375 },
1444}; 1376};
1445 1377
diff --git a/drivers/serial/nwpserial.c b/drivers/serial/nwpserial.c
index e1ab8ec0a4a6..3c02fa96f282 100644
--- a/drivers/serial/nwpserial.c
+++ b/drivers/serial/nwpserial.c
@@ -344,7 +344,7 @@ int nwpserial_register_port(struct uart_port *port)
344 344
345 mutex_lock(&nwpserial_mutex); 345 mutex_lock(&nwpserial_mutex);
346 346
347 dn = to_of_device(port->dev)->node; 347 dn = to_of_device(port->dev)->dev.of_node;
348 if (dn == NULL) 348 if (dn == NULL)
349 goto out; 349 goto out;
350 350
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c
index 4abfebdb0fcc..a48d9080f552 100644
--- a/drivers/serial/of_serial.c
+++ b/drivers/serial/of_serial.c
@@ -31,7 +31,7 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev,
31 int type, struct uart_port *port) 31 int type, struct uart_port *port)
32{ 32{
33 struct resource resource; 33 struct resource resource;
34 struct device_node *np = ofdev->node; 34 struct device_node *np = ofdev->dev.of_node;
35 const unsigned int *clk, *spd; 35 const unsigned int *clk, *spd;
36 const u32 *prop; 36 const u32 *prop;
37 int ret, prop_size; 37 int ret, prop_size;
@@ -88,7 +88,7 @@ static int __devinit of_platform_serial_probe(struct of_device *ofdev,
88 int port_type; 88 int port_type;
89 int ret; 89 int ret;
90 90
91 if (of_find_property(ofdev->node, "used-by-rtas", NULL)) 91 if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL))
92 return -EBUSY; 92 return -EBUSY;
93 93
94 info = kmalloc(sizeof(*info), GFP_KERNEL); 94 info = kmalloc(sizeof(*info), GFP_KERNEL);
@@ -175,11 +175,13 @@ static struct of_device_id __devinitdata of_platform_serial_table[] = {
175}; 175};
176 176
177static struct of_platform_driver of_platform_serial_driver = { 177static struct of_platform_driver of_platform_serial_driver = {
178 .owner = THIS_MODULE, 178 .driver = {
179 .name = "of_serial", 179 .name = "of_serial",
180 .owner = THIS_MODULE,
181 .of_match_table = of_platform_serial_table,
182 },
180 .probe = of_platform_serial_probe, 183 .probe = of_platform_serial_probe,
181 .remove = of_platform_serial_remove, 184 .remove = of_platform_serial_remove,
182 .match_table = of_platform_serial_table,
183}; 185};
184 186
185static int __init of_platform_serial_init(void) 187static int __init of_platform_serial_init(void)
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c
index 700e10833bf9..cabbdc7ba583 100644
--- a/drivers/serial/pmac_zilog.c
+++ b/drivers/serial/pmac_zilog.c
@@ -1611,7 +1611,7 @@ static int pmz_attach(struct macio_dev *mdev, const struct of_device_id *match)
1611 /* Iterate the pmz_ports array to find a matching entry 1611 /* Iterate the pmz_ports array to find a matching entry
1612 */ 1612 */
1613 for (i = 0; i < MAX_ZS_PORTS; i++) 1613 for (i = 0; i < MAX_ZS_PORTS; i++)
1614 if (pmz_ports[i].node == mdev->ofdev.node) { 1614 if (pmz_ports[i].node == mdev->ofdev.dev.of_node) {
1615 struct uart_pmac_port *uap = &pmz_ports[i]; 1615 struct uart_pmac_port *uap = &pmz_ports[i];
1616 1616
1617 uap->dev = mdev; 1617 uap->dev = mdev;
diff --git a/drivers/serial/s5pv210.c b/drivers/serial/s5pv210.c
index 8dc03837617b..4a789e5361a4 100644
--- a/drivers/serial/s5pv210.c
+++ b/drivers/serial/s5pv210.c
@@ -119,7 +119,7 @@ static int s5p_serial_probe(struct platform_device *pdev)
119 return s3c24xx_serial_probe(pdev, s5p_uart_inf[pdev->id]); 119 return s3c24xx_serial_probe(pdev, s5p_uart_inf[pdev->id]);
120} 120}
121 121
122static struct platform_driver s5p_serial_drv = { 122static struct platform_driver s5p_serial_driver = {
123 .probe = s5p_serial_probe, 123 .probe = s5p_serial_probe,
124 .remove = __devexit_p(s3c24xx_serial_remove), 124 .remove = __devexit_p(s3c24xx_serial_remove),
125 .driver = { 125 .driver = {
@@ -130,19 +130,19 @@ static struct platform_driver s5p_serial_drv = {
130 130
131static int __init s5pv210_serial_console_init(void) 131static int __init s5pv210_serial_console_init(void)
132{ 132{
133 return s3c24xx_serial_initconsole(&s5p_serial_drv, s5p_uart_inf); 133 return s3c24xx_serial_initconsole(&s5p_serial_driver, s5p_uart_inf);
134} 134}
135 135
136console_initcall(s5pv210_serial_console_init); 136console_initcall(s5pv210_serial_console_init);
137 137
138static int __init s5p_serial_init(void) 138static int __init s5p_serial_init(void)
139{ 139{
140 return s3c24xx_serial_init(&s5p_serial_drv, *s5p_uart_inf); 140 return s3c24xx_serial_init(&s5p_serial_driver, *s5p_uart_inf);
141} 141}
142 142
143static void __exit s5p_serial_exit(void) 143static void __exit s5p_serial_exit(void)
144{ 144{
145 platform_driver_unregister(&s5p_serial_drv); 145 platform_driver_unregister(&s5p_serial_driver);
146} 146}
147 147
148module_init(s5p_serial_init); 148module_init(s5p_serial_init);
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index aaef223df676..c291b3add1d2 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -1025,8 +1025,9 @@ static void sci_rx_dma_release(struct sci_port *s, bool enable_pio)
1025 s->chan_rx = NULL; 1025 s->chan_rx = NULL;
1026 s->cookie_rx[0] = s->cookie_rx[1] = -EINVAL; 1026 s->cookie_rx[0] = s->cookie_rx[1] = -EINVAL;
1027 dma_release_channel(chan); 1027 dma_release_channel(chan);
1028 dma_free_coherent(port->dev, s->buf_len_rx * 2, 1028 if (sg_dma_address(&s->sg_rx[0]))
1029 sg_virt(&s->sg_rx[0]), sg_dma_address(&s->sg_rx[0])); 1029 dma_free_coherent(port->dev, s->buf_len_rx * 2,
1030 sg_virt(&s->sg_rx[0]), sg_dma_address(&s->sg_rx[0]));
1030 if (enable_pio) 1031 if (enable_pio)
1031 sci_start_rx(port); 1032 sci_start_rx(port);
1032} 1033}
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
index d14cca7fb88d..890f91742962 100644
--- a/drivers/serial/sunhv.c
+++ b/drivers/serial/sunhv.c
@@ -565,7 +565,7 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m
565 if (err) 565 if (err)
566 goto out_free_con_read_page; 566 goto out_free_con_read_page;
567 567
568 sunserial_console_match(&sunhv_console, op->node, 568 sunserial_console_match(&sunhv_console, op->dev.of_node,
569 &sunhv_reg, port->line, false); 569 &sunhv_reg, port->line, false);
570 570
571 err = uart_add_one_port(&sunhv_reg, port); 571 err = uart_add_one_port(&sunhv_reg, port);
@@ -630,8 +630,11 @@ static const struct of_device_id hv_match[] = {
630MODULE_DEVICE_TABLE(of, hv_match); 630MODULE_DEVICE_TABLE(of, hv_match);
631 631
632static struct of_platform_driver hv_driver = { 632static struct of_platform_driver hv_driver = {
633 .name = "hv", 633 .driver = {
634 .match_table = hv_match, 634 .name = "hv",
635 .owner = THIS_MODULE,
636 .of_match_table = hv_match,
637 },
635 .probe = hv_probe, 638 .probe = hv_probe,
636 .remove = __devexit_p(hv_remove), 639 .remove = __devexit_p(hv_remove),
637}; 640};
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index d2e0321049e2..5e81bc6b48b0 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -883,7 +883,7 @@ static int sunsab_console_setup(struct console *con, char *options)
883 printk("Console: ttyS%d (SAB82532)\n", 883 printk("Console: ttyS%d (SAB82532)\n",
884 (sunsab_reg.minor - 64) + con->index); 884 (sunsab_reg.minor - 64) + con->index);
885 885
886 sunserial_console_termios(con, to_of_device(up->port.dev)->node); 886 sunserial_console_termios(con, to_of_device(up->port.dev)->dev.of_node);
887 887
888 switch (con->cflag & CBAUD) { 888 switch (con->cflag & CBAUD) {
889 case B150: baud = 150; break; 889 case B150: baud = 150; break;
@@ -1026,11 +1026,11 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id *
1026 if (err) 1026 if (err)
1027 goto out1; 1027 goto out1;
1028 1028
1029 sunserial_console_match(SUNSAB_CONSOLE(), op->node, 1029 sunserial_console_match(SUNSAB_CONSOLE(), op->dev.of_node,
1030 &sunsab_reg, up[0].port.line, 1030 &sunsab_reg, up[0].port.line,
1031 false); 1031 false);
1032 1032
1033 sunserial_console_match(SUNSAB_CONSOLE(), op->node, 1033 sunserial_console_match(SUNSAB_CONSOLE(), op->dev.of_node,
1034 &sunsab_reg, up[1].port.line, 1034 &sunsab_reg, up[1].port.line,
1035 false); 1035 false);
1036 1036
@@ -1093,8 +1093,11 @@ static const struct of_device_id sab_match[] = {
1093MODULE_DEVICE_TABLE(of, sab_match); 1093MODULE_DEVICE_TABLE(of, sab_match);
1094 1094
1095static struct of_platform_driver sab_driver = { 1095static struct of_platform_driver sab_driver = {
1096 .name = "sab", 1096 .driver = {
1097 .match_table = sab_match, 1097 .name = "sab",
1098 .owner = THIS_MODULE,
1099 .of_match_table = sab_match,
1100 },
1098 .probe = sab_probe, 1101 .probe = sab_probe,
1099 .remove = __devexit_p(sab_remove), 1102 .remove = __devexit_p(sab_remove),
1100}; 1103};
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index 01f7731e59b8..234459c2f012 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -1200,7 +1200,7 @@ static int __devinit sunsu_kbd_ms_init(struct uart_sunsu_port *up)
1200 return -ENODEV; 1200 return -ENODEV;
1201 1201
1202 printk("%s: %s port at %llx, irq %u\n", 1202 printk("%s: %s port at %llx, irq %u\n",
1203 to_of_device(up->port.dev)->node->full_name, 1203 to_of_device(up->port.dev)->dev.of_node->full_name,
1204 (up->su_type == SU_PORT_KBD) ? "Keyboard" : "Mouse", 1204 (up->su_type == SU_PORT_KBD) ? "Keyboard" : "Mouse",
1205 (unsigned long long) up->port.mapbase, 1205 (unsigned long long) up->port.mapbase,
1206 up->port.irq); 1206 up->port.irq);
@@ -1352,7 +1352,7 @@ static int __init sunsu_console_setup(struct console *co, char *options)
1352 spin_lock_init(&port->lock); 1352 spin_lock_init(&port->lock);
1353 1353
1354 /* Get firmware console settings. */ 1354 /* Get firmware console settings. */
1355 sunserial_console_termios(co, to_of_device(port->dev)->node); 1355 sunserial_console_termios(co, to_of_device(port->dev)->dev.of_node);
1356 1356
1357 memset(&termios, 0, sizeof(struct ktermios)); 1357 memset(&termios, 0, sizeof(struct ktermios));
1358 termios.c_cflag = co->cflag; 1358 termios.c_cflag = co->cflag;
@@ -1409,7 +1409,7 @@ static enum su_type __devinit su_get_type(struct device_node *dp)
1409static int __devinit su_probe(struct of_device *op, const struct of_device_id *match) 1409static int __devinit su_probe(struct of_device *op, const struct of_device_id *match)
1410{ 1410{
1411 static int inst; 1411 static int inst;
1412 struct device_node *dp = op->node; 1412 struct device_node *dp = op->dev.of_node;
1413 struct uart_sunsu_port *up; 1413 struct uart_sunsu_port *up;
1414 struct resource *rp; 1414 struct resource *rp;
1415 enum su_type type; 1415 enum su_type type;
@@ -1539,8 +1539,11 @@ static const struct of_device_id su_match[] = {
1539MODULE_DEVICE_TABLE(of, su_match); 1539MODULE_DEVICE_TABLE(of, su_match);
1540 1540
1541static struct of_platform_driver su_driver = { 1541static struct of_platform_driver su_driver = {
1542 .name = "su", 1542 .driver = {
1543 .match_table = su_match, 1543 .name = "su",
1544 .owner = THIS_MODULE,
1545 .of_match_table = su_match,
1546 },
1544 .probe = su_probe, 1547 .probe = su_probe,
1545 .remove = __devexit_p(su_remove), 1548 .remove = __devexit_p(su_remove),
1546}; 1549};
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 978b3cee02d7..f9a24f4ebb34 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1230,7 +1230,7 @@ static int __init sunzilog_console_setup(struct console *con, char *options)
1230 (sunzilog_reg.minor - 64) + con->index, con->index); 1230 (sunzilog_reg.minor - 64) + con->index, con->index);
1231 1231
1232 /* Get firmware console settings. */ 1232 /* Get firmware console settings. */
1233 sunserial_console_termios(con, to_of_device(up->port.dev)->node); 1233 sunserial_console_termios(con, to_of_device(up->port.dev)->dev.of_node);
1234 1234
1235 /* Firmware console speed is limited to 150-->38400 baud so 1235 /* Firmware console speed is limited to 150-->38400 baud so
1236 * this hackish cflag thing is OK. 1236 * this hackish cflag thing is OK.
@@ -1408,7 +1408,7 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
1408 int keyboard_mouse = 0; 1408 int keyboard_mouse = 0;
1409 int err; 1409 int err;
1410 1410
1411 if (of_find_property(op->node, "keyboard", NULL)) 1411 if (of_find_property(op->dev.of_node, "keyboard", NULL))
1412 keyboard_mouse = 1; 1412 keyboard_mouse = 1;
1413 1413
1414 /* uarts must come before keyboards/mice */ 1414 /* uarts must come before keyboards/mice */
@@ -1465,7 +1465,7 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
1465 sunzilog_init_hw(&up[1]); 1465 sunzilog_init_hw(&up[1]);
1466 1466
1467 if (!keyboard_mouse) { 1467 if (!keyboard_mouse) {
1468 if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node, 1468 if (sunserial_console_match(SUNZILOG_CONSOLE(), op->dev.of_node,
1469 &sunzilog_reg, up[0].port.line, 1469 &sunzilog_reg, up[0].port.line,
1470 false)) 1470 false))
1471 up->flags |= SUNZILOG_FLAG_IS_CONS; 1471 up->flags |= SUNZILOG_FLAG_IS_CONS;
@@ -1475,7 +1475,7 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
1475 rp, sizeof(struct zilog_layout)); 1475 rp, sizeof(struct zilog_layout));
1476 return err; 1476 return err;
1477 } 1477 }
1478 if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node, 1478 if (sunserial_console_match(SUNZILOG_CONSOLE(), op->dev.of_node,
1479 &sunzilog_reg, up[1].port.line, 1479 &sunzilog_reg, up[1].port.line,
1480 false)) 1480 false))
1481 up->flags |= SUNZILOG_FLAG_IS_CONS; 1481 up->flags |= SUNZILOG_FLAG_IS_CONS;
@@ -1541,8 +1541,11 @@ static const struct of_device_id zs_match[] = {
1541MODULE_DEVICE_TABLE(of, zs_match); 1541MODULE_DEVICE_TABLE(of, zs_match);
1542 1542
1543static struct of_platform_driver zs_driver = { 1543static struct of_platform_driver zs_driver = {
1544 .name = "zs", 1544 .driver = {
1545 .match_table = zs_match, 1545 .name = "zs",
1546 .owner = THIS_MODULE,
1547 .of_match_table = zs_match,
1548 },
1546 .probe = zs_probe, 1549 .probe = zs_probe,
1547 .remove = __devexit_p(zs_remove), 1550 .remove = __devexit_p(zs_remove),
1548}; 1551};
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index e6639a95d276..8acccd564378 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -591,15 +591,15 @@ ulite_of_probe(struct of_device *op, const struct of_device_id *match)
591 591
592 dev_dbg(&op->dev, "%s(%p, %p)\n", __func__, op, match); 592 dev_dbg(&op->dev, "%s(%p, %p)\n", __func__, op, match);
593 593
594 rc = of_address_to_resource(op->node, 0, &res); 594 rc = of_address_to_resource(op->dev.of_node, 0, &res);
595 if (rc) { 595 if (rc) {
596 dev_err(&op->dev, "invalid address\n"); 596 dev_err(&op->dev, "invalid address\n");
597 return rc; 597 return rc;
598 } 598 }
599 599
600 irq = irq_of_parse_and_map(op->node, 0); 600 irq = irq_of_parse_and_map(op->dev.of_node, 0);
601 601
602 id = of_get_property(op->node, "port-number", NULL); 602 id = of_get_property(op->dev.of_node, "port-number", NULL);
603 603
604 return ulite_assign(&op->dev, id ? *id : -1, res.start, irq); 604 return ulite_assign(&op->dev, id ? *id : -1, res.start, irq);
605} 605}
@@ -610,13 +610,12 @@ static int __devexit ulite_of_remove(struct of_device *op)
610} 610}
611 611
612static struct of_platform_driver ulite_of_driver = { 612static struct of_platform_driver ulite_of_driver = {
613 .owner = THIS_MODULE,
614 .name = "uartlite",
615 .match_table = ulite_of_match,
616 .probe = ulite_of_probe, 613 .probe = ulite_of_probe,
617 .remove = __devexit_p(ulite_of_remove), 614 .remove = __devexit_p(ulite_of_remove),
618 .driver = { 615 .driver = {
619 .name = "uartlite", 616 .name = "uartlite",
617 .owner = THIS_MODULE,
618 .of_match_table = ulite_of_match,
620 }, 619 },
621}; 620};
622 621
diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c
index 074904912f64..907b06f5c447 100644
--- a/drivers/serial/ucc_uart.c
+++ b/drivers/serial/ucc_uart.c
@@ -1197,7 +1197,7 @@ static void uart_firmware_cont(const struct firmware *fw, void *context)
1197static int ucc_uart_probe(struct of_device *ofdev, 1197static int ucc_uart_probe(struct of_device *ofdev,
1198 const struct of_device_id *match) 1198 const struct of_device_id *match)
1199{ 1199{
1200 struct device_node *np = ofdev->node; 1200 struct device_node *np = ofdev->dev.of_node;
1201 const unsigned int *iprop; /* Integer OF properties */ 1201 const unsigned int *iprop; /* Integer OF properties */
1202 const char *sprop; /* String OF properties */ 1202 const char *sprop; /* String OF properties */
1203 struct uart_qe_port *qe_port = NULL; 1203 struct uart_qe_port *qe_port = NULL;
@@ -1486,9 +1486,11 @@ static struct of_device_id ucc_uart_match[] = {
1486MODULE_DEVICE_TABLE(of, ucc_uart_match); 1486MODULE_DEVICE_TABLE(of, ucc_uart_match);
1487 1487
1488static struct of_platform_driver ucc_uart_of_driver = { 1488static struct of_platform_driver ucc_uart_of_driver = {
1489 .owner = THIS_MODULE, 1489 .driver = {
1490 .name = "ucc_uart", 1490 .name = "ucc_uart",
1491 .match_table = ucc_uart_match, 1491 .owner = THIS_MODULE,
1492 .of_match_table = ucc_uart_match,
1493 },
1492 .probe = ucc_uart_probe, 1494 .probe = ucc_uart_probe,
1493 .remove = ucc_uart_remove, 1495 .remove = ucc_uart_remove,
1494}; 1496};