Skip to content
Snippets Groups Projects
Commit 89143fb3 authored by Marek Vasut's avatar Marek Vasut Committed by Tom Rini
Browse files

serial: Rename .init() and .uninit() in serial_device


Rename .init() to .start() and .uninit() to .stop() in struct
serial_device. This allows aligning struct serial_device with
closer to struct stdio_dev. The real goal here is to allow
these two structures to converge together and eventually make
one to be a superset of the other.

Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: default avatarTom Rini <trini@ti.com>
parent 78322d63
No related branches found
No related tags found
No related merge requests found
...@@ -236,8 +236,8 @@ static void uart##n##_loop(int state) \ ...@@ -236,8 +236,8 @@ static void uart##n##_loop(int state) \
\ \
struct serial_device bfin_serial##n##_device = { \ struct serial_device bfin_serial##n##_device = { \
.name = "bfin_uart"#n, \ .name = "bfin_uart"#n, \
.init = uart##n##_init, \ .start = uart##n##_init, \
.uninit = uart##n##_uninit, \ .stop = uart##n##_uninit, \
.setbrg = uart##n##_setbrg, \ .setbrg = uart##n##_setbrg, \
.getc = uart##n##_getc, \ .getc = uart##n##_getc, \
.tstc = uart##n##_tstc, \ .tstc = uart##n##_tstc, \
......
...@@ -35,7 +35,7 @@ static struct serial_device *serial_current; ...@@ -35,7 +35,7 @@ static struct serial_device *serial_current;
void serial_register(struct serial_device *dev) void serial_register(struct serial_device *dev)
{ {
#ifdef CONFIG_NEEDS_MANUAL_RELOC #ifdef CONFIG_NEEDS_MANUAL_RELOC
dev->init += gd->reloc_off; dev->start += gd->reloc_off;
dev->setbrg += gd->reloc_off; dev->setbrg += gd->reloc_off;
dev->getc += gd->reloc_off; dev->getc += gd->reloc_off;
dev->tstc += gd->reloc_off; dev->tstc += gd->reloc_off;
...@@ -144,8 +144,8 @@ void serial_stdio_init(void) ...@@ -144,8 +144,8 @@ void serial_stdio_init(void)
strcpy(dev.name, s->name); strcpy(dev.name, s->name);
dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT; dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT;
dev.start = s->init; dev.start = s->start;
dev.stop = s->uninit; dev.stop = s->stop;
dev.putc = s->putc; dev.putc = s->putc;
dev.puts = s->puts; dev.puts = s->puts;
dev.getc = s->getc; dev.getc = s->getc;
...@@ -176,7 +176,7 @@ void serial_reinit_all(void) ...@@ -176,7 +176,7 @@ void serial_reinit_all(void)
struct serial_device *s; struct serial_device *s;
for (s = serial_devices; s; s = s->next) for (s = serial_devices; s; s = s->next)
s->init(); s->start();
} }
static struct serial_device *get_current(void) static struct serial_device *get_current(void)
...@@ -196,7 +196,7 @@ static struct serial_device *get_current(void) ...@@ -196,7 +196,7 @@ static struct serial_device *get_current(void)
int serial_init(void) int serial_init(void)
{ {
return get_current()->init(); return get_current()->start();
} }
void serial_setbrg(void) void serial_setbrg(void)
...@@ -296,9 +296,9 @@ int uart_post_test(int flags) ...@@ -296,9 +296,9 @@ int uart_post_test(int flags)
/* Disable loop back */ /* Disable loop back */
s->loop(0); s->loop(0);
/* XXX: There is no serial_uninit() !? */ /* XXX: There is no serial_stop() !? */
if (s->uninit) if (s->stop)
s->uninit(); s->stop();
} }
done: done:
......
...@@ -219,8 +219,8 @@ int serial_tstc(void) ...@@ -219,8 +219,8 @@ int serial_tstc(void)
/* Serial device descriptor */ /* Serial device descriptor */
#define INIT_PSSERIAL_STRUCTURE(port, __name) { \ #define INIT_PSSERIAL_STRUCTURE(port, __name) { \
.name = __name, \ .name = __name, \
.init = uart_zynq##port##_init, \ .start = uart_zynq##port##_init, \
.uninit = NULL, \ .stop = NULL, \
.setbrg = uart_zynq##port##_setbrg, \ .setbrg = uart_zynq##port##_setbrg, \
.getc = uart_zynq##port##_getc, \ .getc = uart_zynq##port##_getc, \
.tstc = uart_zynq##port##_tstc, \ .tstc = uart_zynq##port##_tstc, \
......
...@@ -7,8 +7,8 @@ struct serial_device { ...@@ -7,8 +7,8 @@ struct serial_device {
/* enough bytes to match alignment of following func pointer */ /* enough bytes to match alignment of following func pointer */
char name[16]; char name[16];
int (*init)(void); int (*start)(void);
int (*uninit)(void); int (*stop)(void);
void (*setbrg)(void); void (*setbrg)(void);
int (*getc)(void); int (*getc)(void);
int (*tstc)(void); int (*tstc)(void);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment