diff options
Diffstat (limited to 'drivers/tty/serial/of_serial.c')
-rw-r--r-- | drivers/tty/serial/of_serial.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c index 0e8eec516df4..c911b2419abb 100644 --- a/drivers/tty/serial/of_serial.c +++ b/drivers/tty/serial/of_serial.c | |||
@@ -80,14 +80,17 @@ 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 struct of_device_id of_platform_serial_table[]; | ||
83 | static int __devinit of_platform_serial_probe(struct platform_device *ofdev) | 84 | static int __devinit of_platform_serial_probe(struct platform_device *ofdev) |
84 | { | 85 | { |
86 | const struct of_device_id *match; | ||
85 | struct of_serial_info *info; | 87 | struct of_serial_info *info; |
86 | struct uart_port port; | 88 | struct uart_port port; |
87 | int port_type; | 89 | int port_type; |
88 | int ret; | 90 | int ret; |
89 | 91 | ||
90 | if (!ofdev->dev.of_match) | 92 | match = of_match_device(of_platform_serial_table, &ofdev->dev); |
93 | if (!match) | ||
91 | return -EINVAL; | 94 | return -EINVAL; |
92 | 95 | ||
93 | if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL)) | 96 | if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL)) |
@@ -97,7 +100,7 @@ static int __devinit of_platform_serial_probe(struct platform_device *ofdev) | |||
97 | if (info == NULL) | 100 | if (info == NULL) |
98 | return -ENOMEM; | 101 | return -ENOMEM; |
99 | 102 | ||
100 | port_type = (unsigned long)ofdev->dev.of_match->data; | 103 | port_type = (unsigned long)match->data; |
101 | ret = of_platform_serial_setup(ofdev, port_type, &port); | 104 | ret = of_platform_serial_setup(ofdev, port_type, &port); |
102 | if (ret) | 105 | if (ret) |
103 | goto out; | 106 | goto out; |