]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
Revert "serial: Add OF alias support for uartlite"
authorMichal Simek <michal.simek@xilinx.com>
Tue, 4 Jun 2013 12:02:53 +0000 (14:02 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 5 Jun 2013 08:48:40 +0000 (10:48 +0200)
This reverts commit b871088c8964ad313cd368daca5e0f1020aed18d.

Device-tree BSP generates port-number which is used
for setup proper device ID that's why we don't need
to care about positions in aliases node.
Both are synchronized by device-tree BSP.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/tty/serial/uartlite.c

index 77157892ac0e447119c6e45e86de8819e6a5f51a..f55c342e0f7cb98212030885854ebc42eee1a7ad 100644 (file)
@@ -28,7 +28,7 @@
 #define ULITE_NAME             "ttyUL"
 #define ULITE_MAJOR            204
 #define ULITE_MINOR            187
-#define ULITE_NR_UARTS         10
+#define ULITE_NR_UARTS         4
 
 /* ---------------------------------------------------------------------
  * Register definitions
@@ -634,26 +634,9 @@ static int ulite_probe(struct platform_device *pdev)
 #ifdef CONFIG_OF
        const __be32 *prop;
 
-       /* Look for a serialN alias */
-       id = of_alias_get_id(pdev->dev.of_node, "serial");
-       if (id < 0) {
-               dev_warn(&pdev->dev, "failed to get alias id, errno %d\n", id);
-               /* Fall back to old port-number property */
-               prop = of_get_property(pdev->dev.of_node, "port-number", NULL);
-               if (!prop) {
-                       dev_warn(&pdev->dev, "failed to get port-number\n");
-                       id = -1;
-               } else
-                       id = be32_to_cpup(prop);
-       }
-
-       /* we can't register ids which are greater than number of uartlites */
-       if (id >= ULITE_NR_UARTS) {
-               dev_warn(&pdev->dev,
-                       "Extern number of allocated uartlite entries "
-                       "ULITE_NR_UARTS, id %d\n", id);
-               return -ENODEV;
-       }
+       prop = of_get_property(pdev->dev.of_node, "port-number", NULL);
+       if (prop)
+               id = be32_to_cpup(prop);
 #endif
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);