aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/8250/8250_dw.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-10-05 16:45:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-10 15:22:06 +0200
commit0946efc2255feed04803b811bbcbccbaba4e5a91 (patch)
tree7538c62a67dba063cf7d8743558ffe151f491c0f /drivers/tty/serial/8250/8250_dw.c
parentserial: 8250_dw: Drop wrong use of ACPI_PTR() (diff)
downloadlinux-dev-0946efc2255feed04803b811bbcbccbaba4e5a91.tar.xz
linux-dev-0946efc2255feed04803b811bbcbccbaba4e5a91.zip
serial: 8250_dw: Re-use temporary variable for of_node
In couple of places we may re-use temporary variable instead of dereferencing it. No functional changes intended. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20211005134529.23256-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/8250/8250_dw.c')
-rw-r--r--drivers/tty/serial/8250/8250_dw.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 49559731bbcf..cc91cb0ce08f 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -393,8 +393,9 @@ static bool dw8250_idma_filter(struct dma_chan *chan, void *param)
static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
{
- if (p->dev->of_node) {
- struct device_node *np = p->dev->of_node;
+ struct device_node *np = p->dev->of_node;
+
+ if (np) {
int id;
/* get index of serial line, if found in DT aliases */
@@ -411,11 +412,13 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
data->skip_autocfg = true;
}
#endif
- if (of_device_is_big_endian(p->dev->of_node)) {
+
+ if (of_device_is_big_endian(np)) {
p->iotype = UPIO_MEM32BE;
p->serial_in = dw8250_serial_in32be;
p->serial_out = dw8250_serial_out32be;
}
+
if (of_device_is_compatible(np, "marvell,armada-38x-uart"))
p->serial_out = dw8250_serial_out38x;