aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/of_serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/of_serial.c')
-rw-r--r--drivers/tty/serial/of_serial.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 5c7abe4c94dd..0e8eec516df4 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;
@@ -160,21 +162,21 @@ static int of_platform_serial_remove(struct platform_device *ofdev)
160 * A few common types, add more as needed. 162 * A few common types, add more as needed.
161 */ 163 */
162static struct of_device_id __devinitdata of_platform_serial_table[] = { 164static struct of_device_id __devinitdata of_platform_serial_table[] = {
163 { .type = "serial", .compatible = "ns8250", .data = (void *)PORT_8250, }, 165 { .compatible = "ns8250", .data = (void *)PORT_8250, },
164 { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, }, 166 { .compatible = "ns16450", .data = (void *)PORT_16450, },
165 { .type = "serial", .compatible = "ns16550a", .data = (void *)PORT_16550A, }, 167 { .compatible = "ns16550a", .data = (void *)PORT_16550A, },
166 { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, }, 168 { .compatible = "ns16550", .data = (void *)PORT_16550, },
167 { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, }, 169 { .compatible = "ns16750", .data = (void *)PORT_16750, },
168 { .type = "serial", .compatible = "ns16850", .data = (void *)PORT_16850, }, 170 { .compatible = "ns16850", .data = (void *)PORT_16850, },
169#ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL 171#ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
170 { .type = "serial", .compatible = "ibm,qpace-nwp-serial", 172 { .compatible = "ibm,qpace-nwp-serial",
171 .data = (void *)PORT_NWPSERIAL, }, 173 .data = (void *)PORT_NWPSERIAL, },
172#endif 174#endif
173 { .type = "serial", .data = (void *)PORT_UNKNOWN, }, 175 { .type = "serial", .data = (void *)PORT_UNKNOWN, },
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