summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 00:28:10 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 00:28:10 (GMT)
commit4c5811bf463b0ef82fabbd1708f8bb2d753aeb18 (patch)
treeff37d31217c3804ca05de21a55a9b5ca1ca818b2 /drivers/tty
parentf74b9444192c60603020c61d7915b72893137edc (diff)
parent9f15444fefdb33509132ff5c9be60cb315c44cb2 (diff)
downloadlinux-fsl-qoriq-4c5811bf463b0ef82fabbd1708f8bb2d753aeb18.tar.xz
Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6
* 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6: (21 commits) tty: serial: altera_jtaguart: Add device tree support tty: serial: altera_uart: Add devicetree support dt: eliminate of_platform_driver shim code dt: Eliminate of_platform_{,un}register_driver dt/serial: Eliminate users of of_platform_{,un}register_driver dt/usb: Eliminate users of of_platform_{,un}register_driver dt/video: Eliminate users of of_platform_{,un}register_driver dt/net: Eliminate users of of_platform_{,un}register_driver dt/sound: Eliminate users of of_platform_{,un}register_driver dt/spi: Eliminate users of of_platform_{,un}register_driver dt: uartlite: merge platform and of_platform driver bindings dt: xilinx_hwicap: merge platform and of_platform driver bindings ipmi: convert OF driver to platform driver leds/leds-gpio: merge platform_driver with of_platform_driver dt/sparc: Eliminate users of of_platform_{,un}register_driver dt/powerpc: Eliminate users of of_platform_{,un}register_driver dt/powerpc: move of_bus_type infrastructure to ibmebus drivercore/dt: add a match table pointer to struct device dt: Typo fix. altera_ps2: Add devicetree support ...
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/altera_jtaguart.c15
-rw-r--r--drivers/tty/serial/altera_uart.c51
-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/uartlite.c103
-rw-r--r--drivers/tty/serial/ucc_uart.c9
12 files changed, 126 insertions, 131 deletions
diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c
index 8f014bb..60e049b 100644
--- a/drivers/tty/serial/altera_jtaguart.c
+++ b/drivers/tty/serial/altera_jtaguart.c
@@ -466,12 +466,23 @@ static int __devexit altera_jtaguart_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_OF
+static struct of_device_id altera_jtaguart_match[] = {
+ { .compatible = "ALTR,juart-1.0", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, altera_jtaguart_match);
+#else
+#define altera_jtaguart_match NULL
+#endif /* CONFIG_OF */
+
static struct platform_driver altera_jtaguart_platform_driver = {
.probe = altera_jtaguart_probe,
.remove = __devexit_p(altera_jtaguart_remove),
.driver = {
- .name = DRV_NAME,
- .owner = THIS_MODULE,
+ .name = DRV_NAME,
+ .owner = THIS_MODULE,
+ .of_match_table = altera_jtaguart_match,
},
};
diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c
index 3a57352..6d5b036 100644
--- a/drivers/tty/serial/altera_uart.c
+++ b/drivers/tty/serial/altera_uart.c
@@ -24,6 +24,7 @@
#include <linux/serial.h>
#include <linux/serial_core.h>
#include <linux/platform_device.h>
+#include <linux/of.h>
#include <linux/io.h>
#include <linux/altera_uart.h>
@@ -507,6 +508,29 @@ static struct uart_driver altera_uart_driver = {
.cons = ALTERA_UART_CONSOLE,
};
+#ifdef CONFIG_OF
+static int altera_uart_get_of_uartclk(struct platform_device *pdev,
+ struct uart_port *port)
+{
+ int len;
+ const __be32 *clk;
+
+ clk = of_get_property(pdev->dev.of_node, "clock-frequency", &len);
+ if (!clk || len < sizeof(__be32))
+ return -ENODEV;
+
+ port->uartclk = be32_to_cpup(clk);
+
+ return 0;
+}
+#else
+static int altera_uart_get_of_uartclk(struct platform_device *pdev,
+ struct uart_port *port)
+{
+ return -ENODEV;
+}
+#endif /* CONFIG_OF */
+
static int __devinit altera_uart_probe(struct platform_device *pdev)
{
struct altera_uart_platform_uart *platp = pdev->dev.platform_data;
@@ -514,6 +538,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
struct resource *res_mem;
struct resource *res_irq;
int i = pdev->id;
+ int ret;
/* -1 emphasizes that the platform must have one port, no .N suffix */
if (i == -1)
@@ -538,6 +563,15 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
else if (platp->irq)
port->irq = platp->irq;
+ /* Check platform data first so we can override device node data */
+ if (platp)
+ port->uartclk = platp->uartclk;
+ else {
+ ret = altera_uart_get_of_uartclk(pdev, port);
+ if (ret)
+ return ret;
+ }
+
port->membase = ioremap(port->mapbase, ALTERA_UART_SIZE);
if (!port->membase)
return -ENOMEM;
@@ -550,7 +584,6 @@ static int __devinit altera_uart_probe(struct platform_device *pdev)
port->line = i;
port->type = PORT_ALTERA_UART;
port->iotype = SERIAL_IO_MEM;
- port->uartclk = platp->uartclk;
port->ops = &altera_uart_ops;
port->flags = UPF_BOOT_AUTOCONF;
@@ -573,13 +606,23 @@ static int __devexit altera_uart_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_OF
+static struct of_device_id altera_uart_match[] = {
+ { .compatible = "ALTR,uart-1.0", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, altera_uart_match);
+#else
+#define altera_uart_match NULL
+#endif /* CONFIG_OF */
+
static struct platform_driver altera_uart_platform_driver = {
.probe = altera_uart_probe,
.remove = __devexit_p(altera_uart_remove),
.driver = {
- .name = DRV_NAME,
- .owner = THIS_MODULE,
- .pm = NULL,
+ .name = DRV_NAME,
+ .owner = THIS_MODULE,
+ .of_match_table = altera_uart_match,
},
};
diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
index 095a5d5..1ab999b 100644
--- a/drivers/tty/serial/apbuart.c
+++ b/drivers/tty/serial/apbuart.c
@@ -553,8 +553,7 @@ static struct uart_driver grlib_apbuart_driver = {
/* OF Platform Driver */
/* ======================================================================== */
-static int __devinit apbuart_probe(struct platform_device *op,
- const struct of_device_id *match)
+static int __devinit apbuart_probe(struct platform_device *op)
{
int i = -1;
struct uart_port *port = NULL;
@@ -587,7 +586,7 @@ static struct of_device_id __initdata apbuart_match[] = {
{},
};
-static struct of_platform_driver grlib_apbuart_of_driver = {
+static struct platform_driver grlib_apbuart_of_driver = {
.probe = apbuart_probe,
.driver = {
.owner = THIS_MODULE,
@@ -676,10 +675,10 @@ static int __init grlib_apbuart_init(void)
return ret;
}
- ret = of_register_platform_driver(&grlib_apbuart_of_driver);
+ ret = platform_driver_register(&grlib_apbuart_of_driver);
if (ret) {
printk(KERN_ERR
- "%s: of_register_platform_driver failed (%i)\n",
+ "%s: platform_driver_register failed (%i)\n",
__FILE__, ret);
uart_unregister_driver(&grlib_apbuart_driver);
return ret;
@@ -697,7 +696,7 @@ static void __exit grlib_apbuart_exit(void)
&grlib_apbuart_ports[i]);
uart_unregister_driver(&grlib_apbuart_driver);
- of_unregister_platform_driver(&grlib_apbuart_of_driver);
+ platform_driver_unregister(&grlib_apbuart_of_driver);
}
module_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 8692ff9..a9a6a5f 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 = {
static int probe_index;
-static int __devinit cpm_uart_probe(struct platform_device *ofdev,
- const struct of_device_id *match)
+static int __devinit cpm_uart_probe(struct platform_device *ofdev)
{
int index = probe_index++;
struct uart_cpm_port *pinfo = &cpm_uart_ports[index];
@@ -1405,7 +1404,7 @@ static struct of_device_id cpm_uart_match[] = {
{}
};
-static struct of_platform_driver cpm_uart_driver = {
+static struct platform_driver cpm_uart_driver = {
.driver = {
.name = "cpm_uart",
.owner = THIS_MODULE,
@@ -1421,7 +1420,7 @@ static int __init cpm_uart_init(void)
if (ret)
return ret;
- ret = of_register_platform_driver(&cpm_uart_driver);
+ ret = platform_driver_register(&cpm_uart_driver);
if (ret)
uart_unregister_driver(&cpm_reg);
@@ -1430,7 +1429,7 @@ static int __init cpm_uart_init(void)
static void __exit cpm_uart_exit(void)
{
- of_unregister_platform_driver(&cpm_uart_driver);
+ platform_driver_unregister(&cpm_uart_driver);
uart_unregister_driver(&cpm_reg);
}
diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c
index 126ec7f..a0bcd8a 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[] = {
{},
};
-static int __devinit
-mpc52xx_uart_of_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit mpc52xx_uart_of_probe(struct platform_device *op)
{
int idx = -1;
unsigned int uartclk;
@@ -1311,8 +1310,6 @@ mpc52xx_uart_of_probe(struct platform_device *op, const struct of_device_id *mat
struct resource res;
int ret;
- dev_dbg(&op->dev, "mpc52xx_uart_probe(op=%p, match=%p)\n", op, match);
-
/* Check validity & presence */
for (idx = 0; idx < MPC52xx_PSC_MAXNUM; idx++)
if (mpc52xx_uart_nodes[idx] == op->dev.of_node)
@@ -1453,7 +1450,7 @@ mpc52xx_uart_of_enumerate(void)
MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match);
-static struct of_platform_driver mpc52xx_uart_of_driver = {
+static struct platform_driver mpc52xx_uart_of_driver = {
.probe = mpc52xx_uart_of_probe,
.remove = mpc52xx_uart_of_remove,
#ifdef CONFIG_PM
@@ -1497,9 +1494,9 @@ mpc52xx_uart_init(void)
return ret;
}
- ret = of_register_platform_driver(&mpc52xx_uart_of_driver);
+ ret = platform_driver_register(&mpc52xx_uart_of_driver);
if (ret) {
- printk(KERN_ERR "%s: of_register_platform_driver failed (%i)\n",
+ printk(KERN_ERR "%s: platform_driver_register failed (%i)\n",
__FILE__, ret);
uart_unregister_driver(&mpc52xx_uart_driver);
return ret;
@@ -1514,7 +1511,7 @@ mpc52xx_uart_exit(void)
if (psc_ops->fifoc_uninit)
psc_ops->fifoc_uninit();
- of_unregister_platform_driver(&mpc52xx_uart_of_driver);
+ platform_driver_unregister(&mpc52xx_uart_of_driver);
uart_unregister_driver(&mpc52xx_uart_driver);
}
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 6a18ca6..0e8eec5 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,
/*
* Try to register a serial port
*/
-static int __devinit of_platform_serial_probe(struct platform_device *ofdev,
- const struct of_device_id *id)
+static int __devinit of_platform_serial_probe(struct platform_device *ofdev)
{
struct of_serial_info *info;
struct uart_port port;
int port_type;
int ret;
+ if (!ofdev->dev.of_match)
+ return -EINVAL;
+
if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL))
return -EBUSY;
@@ -95,7 +97,7 @@ static int __devinit of_platform_serial_probe(struct platform_device *ofdev,
if (info == NULL)
return -ENOMEM;
- port_type = (unsigned long)id->data;
+ port_type = (unsigned long)ofdev->dev.of_match->data;
ret = of_platform_serial_setup(ofdev, port_type, &port);
if (ret)
goto out;
@@ -174,7 +176,7 @@ static struct of_device_id __devinitdata of_platform_serial_table[] = {
{ /* end of list */ },
};
-static struct of_platform_driver of_platform_serial_driver = {
+static struct platform_driver of_platform_serial_driver = {
.driver = {
.name = "of_serial",
.owner = THIS_MODULE,
@@ -186,13 +188,13 @@ static struct of_platform_driver of_platform_serial_driver = {
static int __init of_platform_serial_init(void)
{
- return of_register_platform_driver(&of_platform_serial_driver);
+ return platform_driver_register(&of_platform_serial_driver);
}
module_init(of_platform_serial_init);
static void __exit of_platform_serial_exit(void)
{
- return of_unregister_platform_driver(&of_platform_serial_driver);
+ return platform_driver_unregister(&of_platform_serial_driver);
};
module_exit(of_platform_serial_exit);
diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index c901486..c0b7246 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -519,7 +519,7 @@ static struct console sunhv_console = {
.data = &sunhv_reg,
};
-static int __devinit hv_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit hv_probe(struct platform_device *op)
{
struct uart_port *port;
unsigned long minor;
@@ -629,7 +629,7 @@ static const struct of_device_id hv_match[] = {
};
MODULE_DEVICE_TABLE(of, hv_match);
-static struct of_platform_driver hv_driver = {
+static struct platform_driver hv_driver = {
.driver = {
.name = "hv",
.owner = THIS_MODULE,
@@ -644,12 +644,12 @@ static int __init sunhv_init(void)
if (tlb_type != hypervisor)
return -ENODEV;
- return of_register_platform_driver(&hv_driver);
+ return platform_driver_register(&hv_driver);
}
static void __exit sunhv_exit(void)
{
- of_unregister_platform_driver(&hv_driver);
+ platform_driver_unregister(&hv_driver);
}
module_init(sunhv_init);
diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c
index 5b246b1..b5fa2a5 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,
return 0;
}
-static int __devinit sab_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit sab_probe(struct platform_device *op)
{
static int inst;
struct uart_sunsab_port *up;
@@ -1092,7 +1092,7 @@ static const struct of_device_id sab_match[] = {
};
MODULE_DEVICE_TABLE(of, sab_match);
-static struct of_platform_driver sab_driver = {
+static struct platform_driver sab_driver = {
.driver = {
.name = "sab",
.owner = THIS_MODULE,
@@ -1130,12 +1130,12 @@ static int __init sunsab_init(void)
}
}
- return of_register_platform_driver(&sab_driver);
+ return platform_driver_register(&sab_driver);
}
static void __exit sunsab_exit(void)
{
- of_unregister_platform_driver(&sab_driver);
+ platform_driver_unregister(&sab_driver);
if (sunsab_reg.nr) {
sunserial_unregister_minors(&sunsab_reg, sunsab_reg.nr);
}
diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c
index 551ebfe..92aa545 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)
return SU_PORT_PORT;
}
-static int __devinit su_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit su_probe(struct platform_device *op)
{
static int inst;
struct device_node *dp = op->dev.of_node;
@@ -1543,7 +1543,7 @@ static const struct of_device_id su_match[] = {
};
MODULE_DEVICE_TABLE(of, su_match);
-static struct of_platform_driver su_driver = {
+static struct platform_driver su_driver = {
.driver = {
.name = "su",
.owner = THIS_MODULE,
@@ -1586,7 +1586,7 @@ static int __init sunsu_init(void)
return err;
}
- err = of_register_platform_driver(&su_driver);
+ err = platform_driver_register(&su_driver);
if (err && num_uart)
sunserial_unregister_minors(&sunsu_reg, num_uart);
diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c
index c1967ac..99ff9ab 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)
static int zilog_irq = -1;
-static int __devinit zs_probe(struct platform_device *op, const struct of_device_id *match)
+static int __devinit zs_probe(struct platform_device *op)
{
static int kbm_inst, uart_inst;
int inst;
@@ -1540,7 +1540,7 @@ static const struct of_device_id zs_match[] = {
};
MODULE_DEVICE_TABLE(of, zs_match);
-static struct of_platform_driver zs_driver = {
+static struct platform_driver zs_driver = {
.driver = {
.name = "zs",
.owner = THIS_MODULE,
@@ -1576,7 +1576,7 @@ static int __init sunzilog_init(void)
goto out_free_tables;
}
- err = of_register_platform_driver(&zs_driver);
+ err = platform_driver_register(&zs_driver);
if (err)
goto out_unregister_uart;
@@ -1604,7 +1604,7 @@ out:
return err;
out_unregister_driver:
- of_unregister_platform_driver(&zs_driver);
+ platform_driver_unregister(&zs_driver);
out_unregister_uart:
if (num_sunzilog) {
@@ -1619,7 +1619,7 @@ out_free_tables:
static void __exit sunzilog_exit(void)
{
- of_unregister_platform_driver(&zs_driver);
+ platform_driver_unregister(&zs_driver);
if (zilog_irq != -1) {
struct uart_sunzilog_port *up = sunzilog_irq_chain;
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index d2fce86..8af1ed8 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -19,22 +19,11 @@
#include <linux/interrupt.h>
#include <linux/init.h>
#include <asm/io.h>
-#if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE))
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_platform.h>
-/* Match table for of_platform binding */
-static struct of_device_id ulite_of_match[] __devinitdata = {
- { .compatible = "xlnx,opb-uartlite-1.00.b", },
- { .compatible = "xlnx,xps-uartlite-1.00.a", },
- {}
-};
-MODULE_DEVICE_TABLE(of, ulite_of_match);
-
-#endif
-
#define ULITE_NAME "ttyUL"
#define ULITE_MAJOR 204
#define ULITE_MINOR 187
@@ -571,9 +560,29 @@ static int __devexit ulite_release(struct device *dev)
* Platform bus binding
*/
+#if defined(CONFIG_OF)
+/* Match table for of_platform binding */
+static struct of_device_id ulite_of_match[] __devinitdata = {
+ { .compatible = "xlnx,opb-uartlite-1.00.b", },
+ { .compatible = "xlnx,xps-uartlite-1.00.a", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, ulite_of_match);
+#else /* CONFIG_OF */
+#define ulite_of_match NULL
+#endif /* CONFIG_OF */
+
static int __devinit ulite_probe(struct platform_device *pdev)
{
struct resource *res, *res2;
+ int id = pdev->id;
+#ifdef CONFIG_OF
+ const __be32 *prop;
+
+ prop = of_get_property(pdev->dev.of_node, "port-number", NULL);
+ if (prop)
+ id = be32_to_cpup(prop);
+#endif
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
@@ -583,7 +592,7 @@ static int __devinit ulite_probe(struct platform_device *pdev)
if (!res2)
return -ENODEV;
- return ulite_assign(&pdev->dev, pdev->id, res->start, res2->start);
+ return ulite_assign(&pdev->dev, id, res->start, res2->start);
}
static int __devexit ulite_remove(struct platform_device *pdev)
@@ -595,72 +604,15 @@ static int __devexit ulite_remove(struct platform_device *pdev)
MODULE_ALIAS("platform:uartlite");
static struct platform_driver ulite_platform_driver = {
- .probe = ulite_probe,
- .remove = __devexit_p(ulite_remove),
- .driver = {
- .owner = THIS_MODULE,
- .name = "uartlite",
- },
-};
-
-/* ---------------------------------------------------------------------
- * OF bus bindings
- */
-#if defined(CONFIG_OF) && (defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE))
-static int __devinit
-ulite_of_probe(struct platform_device *op, const struct of_device_id *match)
-{
- struct resource res;
- const unsigned int *id;
- int irq, rc;
-
- dev_dbg(&op->dev, "%s(%p, %p)\n", __func__, op, match);
-
- rc = of_address_to_resource(op->dev.of_node, 0, &res);
- if (rc) {
- dev_err(&op->dev, "invalid address\n");
- return rc;
- }
-
- irq = irq_of_parse_and_map(op->dev.of_node, 0);
-
- id = of_get_property(op->dev.of_node, "port-number", NULL);
-
- return ulite_assign(&op->dev, id ? *id : -1, res.start, irq);
-}
-
-static int __devexit ulite_of_remove(struct platform_device *op)
-{
- return ulite_release(&op->dev);
-}
-
-static struct of_platform_driver ulite_of_driver = {
- .probe = ulite_of_probe,
- .remove = __devexit_p(ulite_of_remove),
+ .probe = ulite_probe,
+ .remove = __devexit_p(ulite_remove),
.driver = {
- .name = "uartlite",
.owner = THIS_MODULE,
+ .name = "uartlite",
.of_match_table = ulite_of_match,
},
};
-/* Registration helpers to keep the number of #ifdefs to a minimum */
-static inline int __init ulite_of_register(void)
-{
- pr_debug("uartlite: calling of_register_platform_driver()\n");
- return of_register_platform_driver(&ulite_of_driver);
-}
-
-static inline void __exit ulite_of_unregister(void)
-{
- of_unregister_platform_driver(&ulite_of_driver);
-}
-#else /* CONFIG_OF && (CONFIG_PPC32 || CONFIG_MICROBLAZE) */
-/* Appropriate config not enabled; do nothing helpers */
-static inline int __init ulite_of_register(void) { return 0; }
-static inline void __exit ulite_of_unregister(void) { }
-#endif /* CONFIG_OF && (CONFIG_PPC32 || CONFIG_MICROBLAZE) */
-
/* ---------------------------------------------------------------------
* Module setup/teardown
*/
@@ -674,10 +626,6 @@ int __init ulite_init(void)
if (ret)
goto err_uart;
- ret = ulite_of_register();
- if (ret)
- goto err_of;
-
pr_debug("uartlite: calling platform_driver_register()\n");
ret = platform_driver_register(&ulite_platform_driver);
if (ret)
@@ -686,8 +634,6 @@ int __init ulite_init(void)
return 0;
err_plat:
- ulite_of_unregister();
-err_of:
uart_unregister_driver(&ulite_uart_driver);
err_uart:
printk(KERN_ERR "registering uartlite driver failed: err=%i", ret);
@@ -697,7 +643,6 @@ err_uart:
void __exit ulite_exit(void)
{
platform_driver_unregister(&ulite_platform_driver);
- ulite_of_unregister();
uart_unregister_driver(&ulite_uart_driver);
}
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index 3f4848e..ff51dae 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)
release_firmware(fw);
}
-static int ucc_uart_probe(struct platform_device *ofdev,
- const struct of_device_id *match)
+static int ucc_uart_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
const unsigned int *iprop; /* Integer OF properties */
@@ -1485,7 +1484,7 @@ static struct of_device_id ucc_uart_match[] = {
};
MODULE_DEVICE_TABLE(of, ucc_uart_match);
-static struct of_platform_driver ucc_uart_of_driver = {
+static struct platform_driver ucc_uart_of_driver = {
.driver = {
.name = "ucc_uart",
.owner = THIS_MODULE,
@@ -1510,7 +1509,7 @@ static int __init ucc_uart_init(void)
return ret;
}
- ret = of_register_platform_driver(&ucc_uart_of_driver);
+ ret = platform_driver_register(&ucc_uart_of_driver);
if (ret)
printk(KERN_ERR
"ucc-uart: could not register platform driver\n");
@@ -1523,7 +1522,7 @@ static void __exit ucc_uart_exit(void)
printk(KERN_INFO
"Freescale QUICC Engine UART device driver unloading\n");
- of_unregister_platform_driver(&ucc_uart_of_driver);
+ platform_driver_unregister(&ucc_uart_of_driver);
uart_unregister_driver(&ucc_uart_driver);
}