|
17 | 17 | #include <linux/tty.h> |
18 | 18 | #include <linux/delay.h> |
19 | 19 | #include <linux/interrupt.h> |
| 20 | +#include <linux/init.h> |
20 | 21 | #include <asm/io.h> |
21 | 22 | #if defined(CONFIG_OF) |
| 23 | +#include <linux/of.h> |
22 | 24 | #include <linux/of_device.h> |
23 | 25 | #include <linux/of_platform.h> |
| 26 | + |
| 27 | +/* Match table for of_platform binding */ |
| 28 | +static struct of_device_id ulite_of_match[] __devinitdata = { |
| 29 | + { .compatible = "xlnx,opb-uartlite-1.00.b", }, |
| 30 | + { .compatible = "xlnx,xps-uartlite-1.00.a", }, |
| 31 | + {} |
| 32 | +}; |
| 33 | +MODULE_DEVICE_TABLE(of, ulite_of_match); |
| 34 | + |
24 | 35 | #endif |
25 | 36 |
|
26 | 37 | #define ULITE_NAME "ttyUL" |
@@ -275,6 +286,9 @@ static void ulite_release_port(struct uart_port *port) |
275 | 286 |
|
276 | 287 | static int ulite_request_port(struct uart_port *port) |
277 | 288 | { |
| 289 | + pr_debug("ulite console: port=%p; port->mapbase=%x\n", |
| 290 | + port, port->mapbase); |
| 291 | + |
278 | 292 | if (!request_mem_region(port->mapbase, ULITE_REGION, "uartlite")) { |
279 | 293 | dev_err(port->dev, "Memory region busy\n"); |
280 | 294 | return -EBUSY; |
@@ -383,7 +397,7 @@ static inline void __init ulite_console_of_find_device(int id) |
383 | 397 | const unsigned int *of_id; |
384 | 398 | int rc; |
385 | 399 |
|
386 | | - for_each_compatible_node(np, NULL, "xilinx,uartlite") { |
| 400 | + for_each_matching_node(np, ulite_of_match) { |
387 | 401 | of_id = of_get_property(np, "port-number", NULL); |
388 | 402 | if ((!of_id) || (*of_id != id)) |
389 | 403 | continue; |
@@ -617,13 +631,6 @@ static int __devexit ulite_of_remove(struct of_device *op) |
617 | 631 | return ulite_release(&op->dev); |
618 | 632 | } |
619 | 633 |
|
620 | | -/* Match table for of_platform binding */ |
621 | | -static struct of_device_id ulite_of_match[] __devinitdata = { |
622 | | - { .type = "serial", .compatible = "xilinx,uartlite", }, |
623 | | - {}, |
624 | | -}; |
625 | | -MODULE_DEVICE_TABLE(of, ulite_of_match); |
626 | | - |
627 | 634 | static struct of_platform_driver ulite_of_driver = { |
628 | 635 | .owner = THIS_MODULE, |
629 | 636 | .name = "uartlite", |
|
0 commit comments