diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-16 20:28:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-16 20:28:10 -0400 |
commit | 4c5811bf463b0ef82fabbd1708f8bb2d753aeb18 (patch) | |
tree | ff37d31217c3804ca05de21a55a9b5ca1ca818b2 /drivers/tty/serial/of_serial.c | |
parent | f74b9444192c60603020c61d7915b72893137edc (diff) | |
parent | 9f15444fefdb33509132ff5c9be60cb315c44cb2 (diff) |
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/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 6a18ca6ddaa9..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 | */ |
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 | ||