Skip to content

Commit 2de8a1b

Browse files
hvilleneuvedoogregkh
authored andcommitted
serial: sc16is7xx: reorder code to remove prototype declarations
Move/reorder some functions to remove sc16is7xx_ier_set() and sc16is7xx_stop_tx() prototypes declarations. No functional change. sc16is7xx_ier_set() was introduced in commit cc4c1d0 ("sc16is7xx: Properly resume TX after stop"). Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://lore.kernel.org/r/20231221231823.2327894-16-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f031d76 commit 2de8a1b

File tree

1 file changed

+36
-39
lines changed

1 file changed

+36
-39
lines changed

drivers/tty/serial/sc16is7xx.c

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,6 @@ static struct uart_driver sc16is7xx_uart = {
357357
.nr = SC16IS7XX_MAX_DEVS,
358358
};
359359

360-
static void sc16is7xx_ier_set(struct uart_port *port, u8 bit);
361-
static void sc16is7xx_stop_tx(struct uart_port *port);
362-
363360
#define to_sc16is7xx_one(p,e) ((container_of((p), struct sc16is7xx_one, e)))
364361

365362
static u8 sc16is7xx_port_read(struct uart_port *port, u8 reg)
@@ -415,6 +412,42 @@ static void sc16is7xx_power(struct uart_port *port, int on)
415412
on ? 0 : SC16IS7XX_IER_SLEEP_BIT);
416413
}
417414

415+
static void sc16is7xx_ier_clear(struct uart_port *port, u8 bit)
416+
{
417+
struct sc16is7xx_port *s = dev_get_drvdata(port->dev);
418+
struct sc16is7xx_one *one = to_sc16is7xx_one(port, port);
419+
420+
lockdep_assert_held_once(&port->lock);
421+
422+
one->config.flags |= SC16IS7XX_RECONF_IER;
423+
one->config.ier_mask |= bit;
424+
one->config.ier_val &= ~bit;
425+
kthread_queue_work(&s->kworker, &one->reg_work);
426+
}
427+
428+
static void sc16is7xx_ier_set(struct uart_port *port, u8 bit)
429+
{
430+
struct sc16is7xx_port *s = dev_get_drvdata(port->dev);
431+
struct sc16is7xx_one *one = to_sc16is7xx_one(port, port);
432+
433+
lockdep_assert_held_once(&port->lock);
434+
435+
one->config.flags |= SC16IS7XX_RECONF_IER;
436+
one->config.ier_mask |= bit;
437+
one->config.ier_val |= bit;
438+
kthread_queue_work(&s->kworker, &one->reg_work);
439+
}
440+
441+
static void sc16is7xx_stop_tx(struct uart_port *port)
442+
{
443+
sc16is7xx_ier_clear(port, SC16IS7XX_IER_THRI_BIT);
444+
}
445+
446+
static void sc16is7xx_stop_rx(struct uart_port *port)
447+
{
448+
sc16is7xx_ier_clear(port, SC16IS7XX_IER_RDI_BIT);
449+
}
450+
418451
static const struct sc16is7xx_devtype sc16is74x_devtype = {
419452
.name = "SC16IS74X",
420453
.nr_gpio = 0,
@@ -867,42 +900,6 @@ static void sc16is7xx_reg_proc(struct kthread_work *ws)
867900
sc16is7xx_reconf_rs485(&one->port);
868901
}
869902

870-
static void sc16is7xx_ier_clear(struct uart_port *port, u8 bit)
871-
{
872-
struct sc16is7xx_port *s = dev_get_drvdata(port->dev);
873-
struct sc16is7xx_one *one = to_sc16is7xx_one(port, port);
874-
875-
lockdep_assert_held_once(&port->lock);
876-
877-
one->config.flags |= SC16IS7XX_RECONF_IER;
878-
one->config.ier_mask |= bit;
879-
one->config.ier_val &= ~bit;
880-
kthread_queue_work(&s->kworker, &one->reg_work);
881-
}
882-
883-
static void sc16is7xx_ier_set(struct uart_port *port, u8 bit)
884-
{
885-
struct sc16is7xx_port *s = dev_get_drvdata(port->dev);
886-
struct sc16is7xx_one *one = to_sc16is7xx_one(port, port);
887-
888-
lockdep_assert_held_once(&port->lock);
889-
890-
one->config.flags |= SC16IS7XX_RECONF_IER;
891-
one->config.ier_mask |= bit;
892-
one->config.ier_val |= bit;
893-
kthread_queue_work(&s->kworker, &one->reg_work);
894-
}
895-
896-
static void sc16is7xx_stop_tx(struct uart_port *port)
897-
{
898-
sc16is7xx_ier_clear(port, SC16IS7XX_IER_THRI_BIT);
899-
}
900-
901-
static void sc16is7xx_stop_rx(struct uart_port *port)
902-
{
903-
sc16is7xx_ier_clear(port, SC16IS7XX_IER_RDI_BIT);
904-
}
905-
906903
static void sc16is7xx_ms_proc(struct kthread_work *ws)
907904
{
908905
struct sc16is7xx_one *one = to_sc16is7xx_one(ws, ms_work.work);

0 commit comments

Comments
 (0)