* [PATCH v1 1/2] serial: 8250_dw: Re-use temporary variable for of_node
@ 2021-10-05 13:45 Andy Shevchenko
2021-10-05 13:45 ` [PATCH v1 2/2] serial: 8250_dw: Fix the trivial typo in the comment Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2021-10-05 13:45 UTC (permalink / raw)
To: Andy Shevchenko, linux-serial, linux-kernel
Cc: Greg Kroah-Hartman, Jiri Slaby
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>
---
drivers/tty/serial/8250/8250_dw.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index cf87022e73e4..792389acf9f6 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -389,8 +389,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 */
@@ -407,11 +408,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;
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH v1 2/2] serial: 8250_dw: Fix the trivial typo in the comment
2021-10-05 13:45 [PATCH v1 1/2] serial: 8250_dw: Re-use temporary variable for of_node Andy Shevchenko
@ 2021-10-05 13:45 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2021-10-05 13:45 UTC (permalink / raw)
To: Andy Shevchenko, linux-serial, linux-kernel
Cc: Greg Kroah-Hartman, Jiri Slaby
Fix the trivial typo in the comment: Premilinary --> Preliminary.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/tty/serial/8250/8250_dw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 792389acf9f6..5a2ff843ec5d 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -338,7 +338,7 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios,
rate = clk_round_rate(d->clk, newrate);
if (rate > 0) {
/*
- * Premilinary set the uartclk to the new clock rate so the
+ * Preliminary set the uartclk to the new clock rate so the
* clock update event handler caused by the clk_set_rate()
* calling wouldn't actually update the UART divisor since
* we about to do this anyway.
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-05 14:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 13:45 [PATCH v1 1/2] serial: 8250_dw: Re-use temporary variable for of_node Andy Shevchenko
2021-10-05 13:45 ` [PATCH v1 2/2] serial: 8250_dw: Fix the trivial typo in the comment Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).