Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1474294

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

From Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 4/7] serial: 8250_fintek: Rearrange function
Date 2016-09-01 13:20 +0200
Message-ID <scych-16c-9@gated-at.bofh.it> (permalink)
References <scraN-2Zr-3@gated-at.bofh.it> <scraO-2Zr-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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)
<hpeter@gmail.com> wrote:
> 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) <hpeter+linux_kernel@gmail.com>
> ---
>  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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4/7] serial: 8250_fintek: Rearrange function "Ji-Ze Hong (Peter Hong)" <hpeter@gmail.com> - 2016-09-01 05:50 +0200
  Re: [PATCH 4/7] serial: 8250_fintek: Rearrange function Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> - 2016-09-01 13:20 +0200
    Re: [PATCH 4/7] serial: 8250_fintek: Rearrange function "Ji-Ze Hong (Peter Hong)" <hpeter@gmail.com> - 2016-09-06 04:00 +0200

csiph-web