serial: Properly spell out the structure member names of serial_driver

Properly spell out the whole structure member names when an initialized
varible is instantiated from the struct serial_driver. In case the
structure definition for struct serial_driver undergoes reordering,
there will be no impact on variables defined based on this structure.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: C Nauman <cnauman@diagraph.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Michal Simek <monstr@monstr.eu>
This commit is contained in:
Marek Vasut 2012-09-09 18:48:28 +02:00 committed by Tom Rini
parent 89143fb3b0
commit 90bad891e1
9 changed files with 96 additions and 93 deletions

View File

@ -319,15 +319,15 @@ int serial_getcts_dev(unsigned int idx)
serial_puts_dev(port, s); \ serial_puts_dev(port, s); \
} }
#define INIT_PSC_SERIAL_STRUCTURE(port, name) { \ #define INIT_PSC_SERIAL_STRUCTURE(port, __name) { \
name, \ .name = __name, \
serial##port##_init, \ .start = serial##port##_init, \
serial##port##_uninit, \ .stop = serial##port##_uninit, \
serial##port##_setbrg, \ .setbrg = serial##port##_setbrg, \
serial##port##_getc, \ .getc = serial##port##_getc, \
serial##port##_tstc, \ .tstc = serial##port##_tstc, \
serial##port##_putc, \ .putc = serial##port##_putc, \
serial##port##_puts, \ .puts = serial##port##_puts, \
} }
#if defined(CONFIG_SYS_PSC1) #if defined(CONFIG_SYS_PSC1)

View File

@ -338,14 +338,14 @@ int serial1_tstc(void)
struct serial_device serial0_device = struct serial_device serial0_device =
{ {
"serial0", .name = "serial0",
serial0_init, .start = serial0_init,
NULL, .stop = NULL,
serial0_setbrg, .setbrg = serial0_setbrg,
serial0_getc, .getc = serial0_getc,
serial0_tstc, .tstc = serial0_tstc,
serial0_putc, .putc = serial0_putc,
serial0_puts, .puts = serial0_puts,
}; };
__weak struct serial_device *default_serial_console(void) __weak struct serial_device *default_serial_console(void)
@ -355,14 +355,14 @@ __weak struct serial_device *default_serial_console(void)
struct serial_device serial1_device = struct serial_device serial1_device =
{ {
"serial1", .name = "serial1",
serial1_init, .start = serial1_init,
NULL, .stop = NULL,
serial1_setbrg, .setbrg = serial1_setbrg,
serial1_getc, .getc = serial1_getc,
serial1_tstc, .tstc = serial1_tstc,
serial1_putc, .putc = serial1_putc,
serial1_puts, .puts = serial1_puts,
}; };
#endif /* CONFIG_SERIAL_MULTI */ #endif /* CONFIG_SERIAL_MULTI */

View File

@ -390,14 +390,14 @@ smc_tstc(void)
struct serial_device serial_smc_device = struct serial_device serial_smc_device =
{ {
"serial_smc", .name = "serial_smc",
smc_init, .start = smc_init,
NULL, .stop = NULL,
smc_setbrg, .setbrg = smc_setbrg,
smc_getc, .getc = smc_getc,
smc_tstc, .tstc = smc_tstc,
smc_putc, .putc = smc_putc,
smc_puts, .puts = smc_puts,
}; };
#endif /* CONFIG_8xx_CONS_SMC1 || CONFIG_8xx_CONS_SMC2 */ #endif /* CONFIG_8xx_CONS_SMC1 || CONFIG_8xx_CONS_SMC2 */
@ -660,14 +660,14 @@ scc_tstc(void)
struct serial_device serial_scc_device = struct serial_device serial_scc_device =
{ {
"serial_scc", .name = "serial_scc",
scc_init, .start = scc_init,
NULL, .stop = NULL,
scc_setbrg, .setbrg = scc_setbrg,
scc_getc, .getc = scc_getc,
scc_tstc, .tstc = scc_tstc,
scc_putc, .putc = scc_putc,
scc_puts, .puts = scc_puts,
}; };
#endif /* CONFIG_8xx_CONS_SCCx */ #endif /* CONFIG_8xx_CONS_SCCx */

View File

@ -60,14 +60,14 @@ int quad_tstc_##n(void) \
} \ } \
struct serial_device zoom2_serial_device##n = \ struct serial_device zoom2_serial_device##n = \
{ \ { \
__stringify(n), \ .name = __stringify(n), \
quad_init_##n, \ .start = quad_init_##n, \
NULL, \ .stop = NULL, \
quad_setbrg_##n, \ .setbrg = quad_setbrg_##n, \
quad_getc_##n, \ .getc = quad_getc_##n, \
quad_tstc_##n, \ .tstc = quad_tstc_##n, \
quad_putc_##n, \ .putc = quad_putc_##n, \
quad_puts_##n, \ .puts = quad_puts_##n, \
}; };
#endif /* ZOOM2_SERIAL_H */ #endif /* ZOOM2_SERIAL_H */

View File

@ -106,15 +106,16 @@ static NS16550_t serial_ports[4] = {
serial_puts_dev(port, s);} serial_puts_dev(port, s);}
/* Serial device descriptor */ /* Serial device descriptor */
#define INIT_ESERIAL_STRUCTURE(port, name) {\ #define INIT_ESERIAL_STRUCTURE(port, __name) { \
name,\ .name = __name, \
eserial##port##_init,\ .start = eserial##port##_init, \
NULL,\ .stop = NULL, \
eserial##port##_setbrg,\ .setbrg = eserial##port##_setbrg, \
eserial##port##_getc,\ .getc = eserial##port##_getc, \
eserial##port##_tstc,\ .tstc = eserial##port##_tstc, \
eserial##port##_putc,\ .putc = eserial##port##_putc, \
eserial##port##_puts, } .puts = eserial##port##_puts, \
}
#endif /* CONFIG_SERIAL_MULTI */ #endif /* CONFIG_SERIAL_MULTI */

View File

@ -269,14 +269,14 @@ void pxa_puts_dev(unsigned int uart_index, const char *s)
#define pxa_uart_desc(uart) \ #define pxa_uart_desc(uart) \
struct serial_device serial_##uart##_device = \ struct serial_device serial_##uart##_device = \
{ \ { \
"serial_"#uart, \ .name = "serial_"#uart, \
uart##_init, \ .start = uart##_init, \
NULL, \ .stop = NULL, \
uart##_setbrg, \ .setbrg = uart##_setbrg, \
uart##_getc, \ .getc = uart##_getc, \
uart##_tstc, \ .tstc = uart##_tstc, \
uart##_putc, \ .putc = uart##_putc, \
uart##_puts, \ .puts = uart##_puts, \
}; };
#define pxa_uart_multi(uart, UART) \ #define pxa_uart_multi(uart, UART) \

View File

@ -69,15 +69,15 @@ DECLARE_GLOBAL_DATA_PTR;
serial_puts_dev(port, s); \ serial_puts_dev(port, s); \
} }
#define INIT_S3C_SERIAL_STRUCTURE(port, name) { \ #define INIT_S3C_SERIAL_STRUCTURE(port, __name) { \
name, \ .name = __name, \
s3serial##port##_init, \ .start = s3serial##port##_init, \
NULL,\ .stop = NULL, \
s3serial##port##_setbrg, \ .setbrg = s3serial##port##_setbrg, \
s3serial##port##_getc, \ .getc = s3serial##port##_getc, \
s3serial##port##_tstc, \ .tstc = s3serial##port##_tstc, \
s3serial##port##_putc, \ .putc = s3serial##port##_putc, \
s3serial##port##_puts, \ .puts = s3serial##port##_puts, \
} }
#endif /* CONFIG_SERIAL_MULTI */ #endif /* CONFIG_SERIAL_MULTI */

View File

@ -183,15 +183,16 @@ int s5p_serial##port##_tstc(void) { return serial_tstc_dev(port); } \
void s5p_serial##port##_putc(const char c) { serial_putc_dev(c, port); } \ void s5p_serial##port##_putc(const char c) { serial_putc_dev(c, port); } \
void s5p_serial##port##_puts(const char *s) { serial_puts_dev(s, port); } void s5p_serial##port##_puts(const char *s) { serial_puts_dev(s, port); }
#define INIT_S5P_SERIAL_STRUCTURE(port, name) { \ #define INIT_S5P_SERIAL_STRUCTURE(port, __name) { \
name, \ .name = __name, \
s5p_serial##port##_init, \ .start = s5p_serial##port##_init, \
NULL, \ .stop = NULL, \
s5p_serial##port##_setbrg, \ .setbrg = s5p_serial##port##_setbrg, \
s5p_serial##port##_getc, \ .getc = s5p_serial##port##_getc, \
s5p_serial##port##_tstc, \ .tstc = s5p_serial##port##_tstc, \
s5p_serial##port##_putc, \ .putc = s5p_serial##port##_putc, \
s5p_serial##port##_puts, } .puts = s5p_serial##port##_puts, \
}
DECLARE_S5P_SERIAL_FUNCTIONS(0); DECLARE_S5P_SERIAL_FUNCTIONS(0);
struct serial_device s5p_serial0_device = struct serial_device s5p_serial0_device =

View File

@ -144,15 +144,16 @@ int serial_tstc(void)
{ uartlite_serial_puts(s, port); } { uartlite_serial_puts(s, port); }
/* Serial device descriptor */ /* Serial device descriptor */
#define INIT_ESERIAL_STRUCTURE(port, name) {\ #define INIT_ESERIAL_STRUCTURE(port, __name) { \
name,\ .name = __name, \
userial##port##_init,\ .start = userial##port##_init, \
NULL,\ .stop = NULL, \
userial##port##_setbrg,\ .setbrg = userial##port##_setbrg, \
userial##port##_getc,\ .getc = userial##port##_getc, \
userial##port##_tstc,\ .tstc = userial##port##_tstc, \
userial##port##_putc,\ .putc = userial##port##_putc, \
userial##port##_puts, } .puts = userial##port##_puts, \
}
DECLARE_ESERIAL_FUNCTIONS(0); DECLARE_ESERIAL_FUNCTIONS(0);
struct serial_device uartlite_serial0_device = struct serial_device uartlite_serial0_device =