tty: st-asc: Update tty alias
authorPatrice Chotard <patrice.chotard@st.com>
Wed, 7 Mar 2018 17:35:32 +0000 (18:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Mar 2018 13:57:04 +0000 (14:57 +0100)
Since dtc v1.4.6-9-gaadd0b65c987, aliases property name
must include only lowercase and '-'.

After having updated all STi boards serial aliases from "ttyASN"
to "serialN", st-asc driver need to be updated accordingly as tty
aliases id is retrieved using of_alias_get_id().

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/st-asc.c

index c763253514e9919f1ccf6e3a01ed1e07c4cf718e..5f9f01fac6dd4e7c95200617df90548360191fa1 100644 (file)
@@ -782,7 +782,9 @@ static struct asc_port *asc_of_get_asc_port(struct platform_device *pdev)
        if (!np)
                return NULL;
 
-       id = of_alias_get_id(np, ASC_SERIAL_NAME);
+       id = of_alias_get_id(np, "serial");
+       if (id < 0)
+               id = of_alias_get_id(np, ASC_SERIAL_NAME);
 
        if (id < 0)
                id = 0;