diff options
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/ucc_uart.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c index e0994f061001..5e4310ccd591 100644 --- a/drivers/serial/ucc_uart.c +++ b/drivers/serial/ucc_uart.c | |||
@@ -1270,10 +1270,18 @@ static int ucc_uart_probe(struct of_device *ofdev, | |||
1270 | 1270 | ||
1271 | /* Get the UCC number (device ID) */ | 1271 | /* Get the UCC number (device ID) */ |
1272 | /* UCCs are numbered 1-7 */ | 1272 | /* UCCs are numbered 1-7 */ |
1273 | iprop = of_get_property(np, "device-id", NULL); | 1273 | iprop = of_get_property(np, "cell-index", NULL); |
1274 | if (!iprop || (*iprop < 1) || (*iprop > UCC_MAX_NUM)) { | 1274 | if (!iprop) { |
1275 | dev_err(&ofdev->dev, | 1275 | iprop = of_get_property(np, "device-id", NULL); |
1276 | "missing or invalid UCC specified in device tree\n"); | 1276 | if (!iprop) { |
1277 | dev_err(&ofdev->dev, "UCC is unspecified in " | ||
1278 | "device tree\n"); | ||
1279 | return -EINVAL; | ||
1280 | } | ||
1281 | } | ||
1282 | |||
1283 | if ((*iprop < 1) || (*iprop > UCC_MAX_NUM)) { | ||
1284 | dev_err(&ofdev->dev, "no support for UCC%u\n", *iprop); | ||
1277 | kfree(qe_port); | 1285 | kfree(qe_port); |
1278 | return -ENODEV; | 1286 | return -ENODEV; |
1279 | } | 1287 | } |