aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/serial/apbuart.c11
-rw-r--r--drivers/tty/serial/cpm_uart/cpm_uart_core.c9
-rw-r--r--drivers/tty/serial/mpc52xx_uart.c13
-rw-r--r--drivers/tty/serial/of_serial.c14
-rw-r--r--drivers/tty/serial/sunhv.c8
-rw-r--r--drivers/tty/serial/sunsab.c8
-rw-r--r--drivers/tty/serial/sunsu.c6
-rw-r--r--drivers/tty/serial/sunzilog.c10
-rw-r--r--drivers/tty/serial/ucc_uart.c9
9 files changed, 42 insertions, 46 deletions
diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
index 095a5d562618..1ab999b04ef3 100644
--- a/drivers/tty/serial/apbuart.c
+++ b/drivers/tty/serial/apbuart.c
@@ -553,8 +553,7 @@ static struct uart_driver grlib_apbuart_driver = {
553/* OF Platform Driver */ 553/* OF Platform Driver */
554/* ======================================================================== */ 554/* ======================================================================== */
555 555
556static int __devinit apbuart_probe(struct platform_device *op, 556static int __devinit apbuart_probe(struct platform_device *op)
557 const struct of_device_id *match)
558{ 557{
559 int i = -1; 558 int i = -1;
560 struct uart_port *port = NULL; 559 struct uart_port *port = NULL;
@@ -587,7 +586,7 @@ static struct of_device_id __initdata apbuart_match[] = {
587 {}, 586 {},
588}; 587};
589 588
590static struct of_platform_driver grlib_apbuart_of_driver = { 589static struct platform_driver grlib_apbuart_of_driver = {
591 .probe = apbuart_probe, 590 .probe = apbuart_probe,
592 .driver = { 591 .driver = {
593 .owner = THIS_MODULE, 592 .owner = THIS_MODULE,
@@ -676,10 +675,10 @@ static int __init grlib_apbuart_init(void)
676 return ret; 675 return ret;
677 } 676 }
678 677
679 ret = of_register_platform_driver(&grlib_apbuart_of_driver); 678 ret = platform_driver_register(&grlib_apbuart_of_driver);
680 if (ret) { 679 if (ret) {
681 printk(KERN_ERR 680 printk(KERN_ERR
682 "%s: of_register_platform_driver failed (%i)\n", 681 "%s: platform_driver_register failed (%i)\n",
683 __FILE__, ret); 682 __FILE__, ret);
684 uart_unregister_driver(&grlib_apbuart_driver); 683 uart_unregister_driver(&grlib_apbuart_driver);
685 return ret; 684 return ret;
@@ -697,7 +696,7 @@ static void __exit grlib_apbuart_exit(void)
697 &grlib_apbuart_ports[i]); 696 &grlib_apbuart_ports[i]);
698 697
699 uart_unregister_driver(&grlib_apbuart_driver); 698 uart_unregister_driver(&grlib_apbuart_driver);
700 of_unregister_platform_driver(&grlib_apbuart_of_driver); 699 platform_driver_unregister(&grlib_apbuart_of_driver);
701} 700}
702 701
703module_init(grlib_apbuart_init); 702module_init(grlib_apbuart_init);
diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
index 8692ff98fc07..a9a6a5fd169e 100644
--- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
@@ -1359,8 +1359,7 @@ static struct uart_driver cpm_reg = {
1359 1359
1360static int probe_index; 1360static int probe_index;
1361 1361
1362static int __devinit cpm_uart_probe(struct platform_device *ofdev, 1362static int __devinit cpm_uart_probe(struct platform_device *ofdev)
1363 const struct of_device_id *match)
1364{ 1363{
1365 int index = probe_index++; 1364 int index = probe_index++;
1366 struct uart_cpm_port *pinfo = &cpm_uart_ports[index]; 1365 struct uart_cpm_port *pinfo = &cpm_uart_ports[index];
@@ -1405,7 +1404,7 @@ static struct of_device_id cpm_uart_match[] = {
1405 {} 1404 {}
1406}; 1405};
1407 1406
1408static struct of_platform_driver cpm_uart_driver = { 1407static struct platform_driver cpm_uart_driver = {
1409 .driver = { 1408 .driver = {
1410 .name = "cpm_uart", 1409 .name = "cpm_uart",
1411 .owner = THIS_MODULE, 1410 .owner = THIS_MODULE,
@@ -1421,7 +1420,7 @@ static int __init cpm_uart_init(void)
1421 if (ret) 1420 if (ret)
1422 return ret; 1421 return ret;
1423 1422
1424 ret = of_register_platform_driver(&cpm_uart_driver); 1423 ret = platform_driver_register(&cpm_uart_driver);
1425 if (ret) 1424 if (ret)
1426 uart_unregister_driver(&cpm_reg); 1425 uart_unregister_driver(&cpm_reg);
1427 1426
@@ -1430,7 +1429,7 @@ static int __init cpm_uart_init(void)
1430 1429
1431static void __exit cpm_uart_exit(void) 1430static void __exit cpm_uart_exit(void)
1432{ 1431{
1433 of_unregister_platform_driver(&cpm_uart_driver); 1432 platform_driver_unregister(&cpm_uart_driver);
1434 uart_unregister_driver(&cpm_reg); 1433 uart_unregister_driver(&cpm_reg);
1435} 1434}
1436 1435
diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c
index 126ec7f568ec..a0bcd8a3758d 100644
--- a/drivers/tty/serial/mpc52xx_uart.c
+++ b/drivers/tty/serial/mpc52xx_uart.c
@@ -1302,8 +1302,7 @@ static struct of_device_id mpc52xx_uart_of_match[] = {
1302 {}, 1302 {},
1303}; 1303};
1304 1304
1305static int __devinit 1305static int __devinit mpc52xx_uart_of_probe(struct platform_device *op)
1306mpc52xx_uart_of_probe(struct platform_device *op, const struct of_device_id *match)
1307{ 1306{
1308 int idx = -1; 1307 int idx = -1;
1309 unsigned int uartclk; 1308 unsigned int uartclk;
@@ -1311,8 +1310,6 @@ mpc52xx_uart_of_probe(struct platform_device *op, const struct of_device_id *mat
1311 struct resource res; 1310 struct resource res;
1312 int ret; 1311 int ret;
1313 1312
1314 dev_dbg(&op->dev, "mpc52xx_uart_probe(op=%p, match=%p)\n", op, match);
1315
1316 /* Check validity & presence */ 1313 /* Check validity & presence */
1317 for (idx = 0; idx < MPC52xx_PSC_MAXNUM; idx++) 1314 for (idx = 0; idx < MPC52xx_PSC_MAXNUM; idx++)
1318 if (mpc52xx_uart_nodes[idx] == op->dev.of_node) 1315 if (mpc52xx_uart_nodes[idx] == op->dev.of_node)
@@ -1453,7 +1450,7 @@ mpc52xx_uart_of_enumerate(void)
1453 1450
1454MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match); 1451MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match);
1455 1452
1456static struct of_platform_driver mpc52xx_uart_of_driver = { 1453static struct platform_driver mpc52xx_uart_of_driver = {
1457 .probe = mpc52xx_uart_of_probe, 1454 .probe = mpc52xx_uart_of_probe,
1458 .remove = mpc52xx_uart_of_remove, 1455 .remove = mpc52xx_uart_of_remove,
1459#ifdef CONFIG_PM 1456#ifdef CONFIG_PM
@@ -1497,9 +1494,9 @@ mpc52xx_uart_init(void)
1497 return ret; 1494 return ret;
1498 } 1495 }
1499 1496
1500 ret = of_register_platform_driver(&mpc52xx_uart_of_driver); 1497 ret = platform_driver_register(&mpc52xx_uart_of_driver);
1501 if (ret) { 1498 if (ret) {
1502 printk(KERN_ERR "%s: of_register_platform_driver failed (%i)\n", 1499 printk(KERN_ERR "%s: platform_driver_register failed (%i)\n",
1503 __FILE__, ret); 1500 __FILE__, ret);
1504 uart_unregister_driver(&mpc52xx_uart_driver); 1501 uart_unregister_driver(&mpc52xx_uart_driver);
1505 return ret; 1502 return ret;
@@ -1514,7 +1511,7 @@ mpc52xx_uart_exit(void)
1514 if (psc_ops->fifoc_uninit) 1511 if (psc_ops->fifoc_uninit)
1515 psc_ops->fifoc_uninit(); 1512 psc_ops->fifoc_uninit();
1516 1513
1517 of_unregister_platform_driver(&mpc52xx_uart_of_driver); 1514 platform_driver_unregister(&mpc52xx_uart_of_driver);
1518 uart_unregister_driver(&mpc52xx_uart_driver); 1515 uart_unregister_driver(&mpc52xx_uart_driver);
1519} 1516}
1520 1517
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 5c7abe4c94dd..1a43197138cf 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -80,14 +80,16 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev,
80/* 80/*
81 * Try to register a serial port 81 * Try to register a serial port
82 */ 82 */
83static int __devinit of_platform_serial_probe(struct platform_device *ofdev, 83static int __devinit of_platform_serial_probe(struct platform_device *ofdev)
84 const struct of_device_id *id)
85{ 84{
86 struct of_serial_info *info; 85 struct of_serial_info *info;
87 struct uart_port port; 86 struct uart_port port;
88 int port_type; 87 int port_type;
89 int ret; 88 int ret;
90 89
90 if (!ofdev->dev.of_match)
91 return -EINVAL;
92
91 if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL)) 93 if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL))
92 return -EBUSY; 94 return -EBUSY;
93 95
@@ -95,7 +97,7 @@ static int __devinit of_platform_serial_probe(struct platform_device *ofdev,
95 if (info == NULL) 97 if (info == NULL)
96 return -ENOMEM; 98 return -ENOMEM;
97 99
98 port_type = (unsigned long)id->data; 100 port_type = (unsigned long)ofdev->dev.of_match->data;
99 ret = of_platform_serial_setup(ofdev, port_type, &port); 101 ret = of_platform_serial_setup(ofdev, port_type, &port);
100 if (ret) 102 if (ret)
101 goto out; 103 goto out;
@@ -174,7 +176,7 @@ static struct of_device_id __devinitdata of_platform_serial_table[] = {
174 { /* end of list */ }, 176 { /* end of list */ },
175}; 177};
176 178
177static struct of_platform_driver of_platform_serial_driver = { 179static struct platform_driver of_platform_serial_driver = {
178 .driver = { 180 .driver = {
179 .name = "of_serial", 181 .name = "of_serial",
180 .owner = THIS_MODULE, 182 .owner = THIS_MODULE,
@@ -186,13 +188,13 @@ static struct of_platform_driver of_platform_serial_driver = {
186 188
187static int __init of_platform_serial_init(void) 189static int __init of_platform_serial_init(void)
188{ 190{
189 return of_register_platform_driver(&of_platform_serial_driver); 191 return platform_driver_register(&of_platform_serial_driver);
190} 192}
191module_init(of_platform_serial_init); 193module_init(of_platform_serial_init);
192 194
193static void __exit of_platform_serial_exit(void) 195static void __exit of_platform_serial_exit(void)
194{ 196{
195 return of_unregister_platform_driver(&of_platform_serial_driver); 197 return platform_driver_unregister(&of_platform_serial_driver);
196}; 198};
197module_exit(of_platform_serial_exit); 199module_exit(of_platform_serial_exit);
198 200
diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index c9014868297d..c0b7246d7339 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -519,7 +519,7 @@ static struct console sunhv_console = {
519 .data = &sunhv_reg, 519 .data = &sunhv_reg,
520}; 520};
521 521
522static int __devinit hv_probe(struct platform_device *op, const struct of_device_id *match) 522static int __devinit hv_probe(struct platform_device *op)
523{ 523{
524 struct uart_port *port; 524 struct uart_port *port;
525 unsigned long minor; 525 unsigned long minor;
@@ -629,7 +629,7 @@ static const struct of_device_id hv_match[] = {
629}; 629};
630MODULE_DEVICE_TABLE(of, hv_match); 630MODULE_DEVICE_TABLE(of, hv_match);
631 631
632static struct of_platform_driver hv_driver = { 632static struct platform_driver hv_driver = {
633 .driver = { 633 .driver = {
634 .name = "hv", 634 .name = "hv",
635 .owner = THIS_MODULE, 635 .owner = THIS_MODULE,
@@ -644,12 +644,12 @@ static int __init sunhv_init(void)
644 if (tlb_type != hypervisor) 644 if (tlb_type != hypervisor)
645 return -ENODEV; 645 return -ENODEV;
646 646
647 return of_register_platform_driver(&hv_driver); 647 return platform_driver_register(&hv_driver);
648} 648}
649 649
650static void __exit sunhv_exit(void) 650static void __exit sunhv_exit(void)
651{ 651{
652 of_unregister_platform_driver(&hv_driver); 652 platform_driver_unregister(&hv_driver);
653} 653}
654 654
655module_init(sunhv_init); 655module_init(sunhv_init);
diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c
index 5b246b18f42f..b5fa2a57b9da 100644
--- a/drivers/tty/serial/sunsab.c
+++ b/drivers/tty/serial/sunsab.c
@@ -1006,7 +1006,7 @@ static int __devinit sunsab_init_one(struct uart_sunsab_port *up,
1006 return 0; 1006 return 0;
1007} 1007}
1008 1008
1009static int __devinit sab_probe(struct platform_device *op, const struct of_device_id *match) 1009static int __devinit sab_probe(struct platform_device *op)
1010{ 1010{
1011 static int inst; 1011 static int inst;
1012 struct uart_sunsab_port *up; 1012 struct uart_sunsab_port *up;
@@ -1092,7 +1092,7 @@ static const struct of_device_id sab_match[] = {
1092}; 1092};
1093MODULE_DEVICE_TABLE(of, sab_match); 1093MODULE_DEVICE_TABLE(of, sab_match);
1094 1094
1095static struct of_platform_driver sab_driver = { 1095static struct platform_driver sab_driver = {
1096 .driver = { 1096 .driver = {
1097 .name = "sab", 1097 .name = "sab",
1098 .owner = THIS_MODULE, 1098 .owner = THIS_MODULE,
@@ -1130,12 +1130,12 @@ static int __init sunsab_init(void)
1130 } 1130 }
1131 } 1131 }
1132 1132
1133 return of_register_platform_driver(&sab_driver); 1133 return platform_driver_register(&sab_driver);
1134} 1134}
1135 1135
1136static void __exit sunsab_exit(void) 1136static void __exit sunsab_exit(void)
1137{ 1137{
1138 of_unregister_platform_driver(&sab_driver); 1138 platform_driver_unregister(&sab_driver);
1139 if (sunsab_reg.nr) { 1139 if (sunsab_reg.nr) {
1140 sunserial_unregister_minors(&sunsab_reg, sunsab_reg.nr); 1140 sunserial_unregister_minors(&sunsab_reg, sunsab_reg.nr);
1141 } 1141 }
diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c
index 551ebfe3ccbb..92aa54550e84 100644
--- a/drivers/tty/serial/sunsu.c
+++ b/drivers/tty/serial/sunsu.c
@@ -1406,7 +1406,7 @@ static enum su_type __devinit su_get_type(struct device_node *dp)
1406 return SU_PORT_PORT; 1406 return SU_PORT_PORT;
1407} 1407}
1408 1408
1409static int __devinit su_probe(struct platform_device *op, const struct of_device_id *match) 1409static int __devinit su_probe(struct platform_device *op)
1410{ 1410{
1411 static int inst; 1411 static int inst;
1412 struct device_node *dp = op->dev.of_node; 1412 struct device_node *dp = op->dev.of_node;
@@ -1543,7 +1543,7 @@ static const struct of_device_id su_match[] = {
1543}; 1543};
1544MODULE_DEVICE_TABLE(of, su_match); 1544MODULE_DEVICE_TABLE(of, su_match);
1545 1545
1546static struct of_platform_driver su_driver = { 1546static struct platform_driver su_driver = {
1547 .driver = { 1547 .driver = {
1548 .name = "su", 1548 .name = "su",
1549 .owner = THIS_MODULE, 1549 .owner = THIS_MODULE,
@@ -1586,7 +1586,7 @@ static int __init sunsu_init(void)
1586 return err; 1586 return err;
1587 } 1587 }
1588 1588
1589 err = of_register_platform_driver(&su_driver); 1589 err = platform_driver_register(&su_driver);
1590 if (err && num_uart) 1590 if (err && num_uart)
1591 sunserial_unregister_minors(&sunsu_reg, num_uart); 1591 sunserial_unregister_minors(&sunsu_reg, num_uart);
1592 1592
diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c
index c1967ac1c07f..99ff9abf57ce 100644
--- a/drivers/tty/serial/sunzilog.c
+++ b/drivers/tty/serial/sunzilog.c
@@ -1399,7 +1399,7 @@ static void __devinit sunzilog_init_hw(struct uart_sunzilog_port *up)
1399 1399
1400static int zilog_irq = -1; 1400static int zilog_irq = -1;
1401 1401
1402static int __devinit zs_probe(struct platform_device *op, const struct of_device_id *match) 1402static int __devinit zs_probe(struct platform_device *op)
1403{ 1403{
1404 static int kbm_inst, uart_inst; 1404 static int kbm_inst, uart_inst;
1405 int inst; 1405 int inst;
@@ -1540,7 +1540,7 @@ static const struct of_device_id zs_match[] = {
1540}; 1540};
1541MODULE_DEVICE_TABLE(of, zs_match); 1541MODULE_DEVICE_TABLE(of, zs_match);
1542 1542
1543static struct of_platform_driver zs_driver = { 1543static struct platform_driver zs_driver = {
1544 .driver = { 1544 .driver = {
1545 .name = "zs", 1545 .name = "zs",
1546 .owner = THIS_MODULE, 1546 .owner = THIS_MODULE,
@@ -1576,7 +1576,7 @@ static int __init sunzilog_init(void)
1576 goto out_free_tables; 1576 goto out_free_tables;
1577 } 1577 }
1578 1578
1579 err = of_register_platform_driver(&zs_driver); 1579 err = platform_driver_register(&zs_driver);
1580 if (err) 1580 if (err)
1581 goto out_unregister_uart; 1581 goto out_unregister_uart;
1582 1582
@@ -1604,7 +1604,7 @@ out:
1604 return err; 1604 return err;
1605 1605
1606out_unregister_driver: 1606out_unregister_driver:
1607 of_unregister_platform_driver(&zs_driver); 1607 platform_driver_unregister(&zs_driver);
1608 1608
1609out_unregister_uart: 1609out_unregister_uart:
1610 if (num_sunzilog) { 1610 if (num_sunzilog) {
@@ -1619,7 +1619,7 @@ out_free_tables:
1619 1619
1620static void __exit sunzilog_exit(void) 1620static void __exit sunzilog_exit(void)
1621{ 1621{
1622 of_unregister_platform_driver(&zs_driver); 1622 platform_driver_unregister(&zs_driver);
1623 1623
1624 if (zilog_irq != -1) { 1624 if (zilog_irq != -1) {
1625 struct uart_sunzilog_port *up = sunzilog_irq_chain; 1625 struct uart_sunzilog_port *up = sunzilog_irq_chain;
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index 3f4848e2174a..ff51dae1df0c 100644
--- a/drivers/tty/serial/ucc_uart.c
+++ b/drivers/tty/serial/ucc_uart.c
@@ -1194,8 +1194,7 @@ static void uart_firmware_cont(const struct firmware *fw, void *context)
1194 release_firmware(fw); 1194 release_firmware(fw);
1195} 1195}
1196 1196
1197static int ucc_uart_probe(struct platform_device *ofdev, 1197static int ucc_uart_probe(struct platform_device *ofdev)
1198 const struct of_device_id *match)
1199{ 1198{
1200 struct device_node *np = ofdev->dev.of_node; 1199 struct device_node *np = ofdev->dev.of_node;
1201 const unsigned int *iprop; /* Integer OF properties */ 1200 const unsigned int *iprop; /* Integer OF properties */
@@ -1485,7 +1484,7 @@ static struct of_device_id ucc_uart_match[] = {
1485}; 1484};
1486MODULE_DEVICE_TABLE(of, ucc_uart_match); 1485MODULE_DEVICE_TABLE(of, ucc_uart_match);
1487 1486
1488static struct of_platform_driver ucc_uart_of_driver = { 1487static struct platform_driver ucc_uart_of_driver = {
1489 .driver = { 1488 .driver = {
1490 .name = "ucc_uart", 1489 .name = "ucc_uart",
1491 .owner = THIS_MODULE, 1490 .owner = THIS_MODULE,
@@ -1510,7 +1509,7 @@ static int __init ucc_uart_init(void)
1510 return ret; 1509 return ret;
1511 } 1510 }
1512 1511
1513 ret = of_register_platform_driver(&ucc_uart_of_driver); 1512 ret = platform_driver_register(&ucc_uart_of_driver);
1514 if (ret) 1513 if (ret)
1515 printk(KERN_ERR 1514 printk(KERN_ERR
1516 "ucc-uart: could not register platform driver\n"); 1515 "ucc-uart: could not register platform driver\n");
@@ -1523,7 +1522,7 @@ static void __exit ucc_uart_exit(void)
1523 printk(KERN_INFO 1522 printk(KERN_INFO
1524 "Freescale QUICC Engine UART device driver unloading\n"); 1523 "Freescale QUICC Engine UART device driver unloading\n");
1525 1524
1526 of_unregister_platform_driver(&ucc_uart_of_driver); 1525 platform_driver_unregister(&ucc_uart_of_driver);
1527 uart_unregister_driver(&ucc_uart_driver); 1526 uart_unregister_driver(&ucc_uart_driver);
1528} 1527}
1529 1528