summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/suncore.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-12-05 22:50:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-17 18:12:17 +0300
commit778ec49c14018730ec177bdd34b17e15e2e748b8 (patch)
tree874d9d2c0fdaa8b6adb92cf8378413035dc61235 /drivers/tty/serial/suncore.c
parentd72402145ace0697a6a9e8e75a3de5bf3375f78d (diff)
downloadlinux-778ec49c14018730ec177bdd34b17e15e2e748b8.tar.xz
tty: Use of_node_name_{eq,prefix} for node name comparisons
Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. For hvc, the code can also be simplified by using of_stdout pointer instead of searching again for the stdout node. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-serial@vger.kernel.org Cc: sparclinux@vger.kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Michael Ellerman <mpe@ellerman.id.au> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/suncore.c')
-rw-r--r--drivers/tty/serial/suncore.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/tty/serial/suncore.c b/drivers/tty/serial/suncore.c
index 990376576970..2491551c293e 100644
--- a/drivers/tty/serial/suncore.c
+++ b/drivers/tty/serial/suncore.c
@@ -89,14 +89,14 @@ void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
int baud, bits, stop, cflag;
char parity;
- if (!strcmp(uart_dp->name, "rsc") ||
- !strcmp(uart_dp->name, "rsc-console") ||
- !strcmp(uart_dp->name, "rsc-control")) {
+ if (of_node_name_eq(uart_dp, "rsc") ||
+ of_node_name_eq(uart_dp, "rsc-console") ||
+ of_node_name_eq(uart_dp, "rsc-control")) {
mode = of_get_property(uart_dp,
"ssp-console-modes", NULL);
if (!mode)
mode = "115200,8,n,1,-";
- } else if (!strcmp(uart_dp->name, "lom-console")) {
+ } else if (of_node_name_eq(uart_dp, "lom-console")) {
mode = "9600,8,n,1,-";
} else {
struct device_node *dp;