diff options
Diffstat (limited to 'drivers/tty/serial/of_serial.c')
-rw-r--r-- | drivers/tty/serial/of_serial.c | 14 |
1 files changed, 8 insertions, 6 deletions
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 | */ |
83 | static int __devinit of_platform_serial_probe(struct platform_device *ofdev, | 83 | static 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 | ||
177 | static struct of_platform_driver of_platform_serial_driver = { | 179 | static 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 | ||
187 | static int __init of_platform_serial_init(void) | 189 | static 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 | } |
191 | module_init(of_platform_serial_init); | 193 | module_init(of_platform_serial_init); |
192 | 194 | ||
193 | static void __exit of_platform_serial_exit(void) | 195 | static 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 | }; |
197 | module_exit(of_platform_serial_exit); | 199 | module_exit(of_platform_serial_exit); |
198 | 200 | ||