Thread (15 messages) 15 messages, 2 authors, 2016-09-06

Re: [PATCH 4/7] serial: 8250_fintek: Rearrange function

From: Ricardo Ribalda Delgado <hidden>
Date: 2016-09-01 11:18:02
Also in: lkml

On one previous patch you almost rewrote theset_irq_mode function and
added the prototype. It might be a good moment to move the whole
function up.

On Thu, Sep 1, 2016 at 5:39 AM, Ji-Ze Hong (Peter Hong)
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
We change the position of fintek_8250_set_irq_mode() above the
find_base_port() to eliminate the prototype define.

Signed-off-by: Ji-Ze Hong (Peter Hong) <redacted>
---
 drivers/tty/serial/8250/8250_fintek.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c
index 5625203..921f742 100644
--- a/drivers/tty/serial/8250/8250_fintek.c
+++ b/drivers/tty/serial/8250/8250_fintek.c
@@ -56,9 +56,6 @@ struct fintek_8250 {
        u8 key;
 };

-static void fintek_8250_set_irq_mode(struct fintek_8250 *pdata,
-                                    bool level_mode);
-
 static u8 sio_read_reg(struct fintek_8250 *pdata, u8 reg)
 {
        outb(reg, pdata->base_port + ADDR_PORT);
@@ -179,6 +176,14 @@ static void fintek_8250_set_max_fifo(struct fintek_8250 *pdata)
        }
 }

+static void fintek_8250_set_irq_mode(struct fintek_8250 *pdata, bool is_level)
+{
+       sio_write_reg(pdata, LDN, pdata->index);
+       sio_write_mask_reg(pdata, FINTEK_IRQ_MODE, IRQ_SHARE, IRQ_SHARE);
+       sio_write_mask_reg(pdata, FINTEK_IRQ_MODE, IRQ_MODE_MASK,
+                          is_level ? IRQ_LEVEL_LOW : IRQ_EDGE_HIGH);
+}
+
 static int find_base_port(struct fintek_8250 *pdata, u16 io_address,
                          unsigned int irq)
 {
@@ -230,14 +235,6 @@ static int find_base_port(struct fintek_8250 *pdata, u16 io_address,
        return -ENODEV;
 }

-static void fintek_8250_set_irq_mode(struct fintek_8250 *pdata, bool is_level)
-{
-       sio_write_reg(pdata, LDN, pdata->index);
-       sio_write_mask_reg(pdata, FINTEK_IRQ_MODE, IRQ_SHARE, IRQ_SHARE);
-       sio_write_mask_reg(pdata, FINTEK_IRQ_MODE, IRQ_MODE_MASK,
-                          is_level ? IRQ_LEVEL_LOW : IRQ_EDGE_HIGH);
-}
-
 int fintek_8250_probe(struct uart_8250_port *uart)
 {
        struct fintek_8250 *pdata;
--
1.9.1


-- 
Ricardo Ribalda
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help