Skip to content

Commit d3a46d0

Browse files
krzkgregkh
authored andcommitted
tty: serial: samsung: embed s3c24xx_uart_info in parent structure
Embed "struct s3c24xx_uart_info" directly as a member of "struct s3c24xx_serial_drv_data" instead of keeping it as a pointer. This makes the code clearer (obvious ownership of "struct s3c24xx_serial_drv_data") and saves one pointer. Tested-by: Alim Akhtar <[email protected]> Reviewed-by: Jiri Slaby <[email protected]> Reviewed-by: Alim Akhtar <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent dffa58b commit d3a46d0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/tty/serial/samsung_tty.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct s3c24xx_uart_info {
8585
};
8686

8787
struct s3c24xx_serial_drv_data {
88-
struct s3c24xx_uart_info *info;
88+
struct s3c24xx_uart_info info;
8989
struct s3c2410_uartcfg *def_cfg;
9090
unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
9191
};
@@ -2194,7 +2194,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
21942194
}
21952195

21962196
ourport->baudclk = ERR_PTR(-EINVAL);
2197-
ourport->info = ourport->drv_data->info;
2197+
ourport->info = &ourport->drv_data->info;
21982198
ourport->cfg = (dev_get_platdata(&pdev->dev)) ?
21992199
dev_get_platdata(&pdev->dev) :
22002200
ourport->drv_data->def_cfg;
@@ -2613,7 +2613,7 @@ static struct console s3c24xx_serial_console = {
26132613

26142614
#ifdef CONFIG_CPU_S3C2410
26152615
static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = {
2616-
.info = &(struct s3c24xx_uart_info) {
2616+
.info = {
26172617
.name = "Samsung S3C2410 UART",
26182618
.type = TYPE_S3C24XX,
26192619
.port_type = PORT_S3C2410,
@@ -2641,7 +2641,7 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = {
26412641

26422642
#ifdef CONFIG_CPU_S3C2412
26432643
static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = {
2644-
.info = &(struct s3c24xx_uart_info) {
2644+
.info = {
26452645
.name = "Samsung S3C2412 UART",
26462646
.type = TYPE_S3C24XX,
26472647
.port_type = PORT_S3C2412,
@@ -2671,7 +2671,7 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = {
26712671
#if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2416) || \
26722672
defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2442)
26732673
static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
2674-
.info = &(struct s3c24xx_uart_info) {
2674+
.info = {
26752675
.name = "Samsung S3C2440 UART",
26762676
.type = TYPE_S3C24XX,
26772677
.port_type = PORT_S3C2440,
@@ -2701,7 +2701,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
27012701

27022702
#if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
27032703
static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = {
2704-
.info = &(struct s3c24xx_uart_info) {
2704+
.info = {
27052705
.name = "Samsung S3C6400 UART",
27062706
.type = TYPE_S3C6400,
27072707
.port_type = PORT_S3C6400,
@@ -2730,7 +2730,7 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = {
27302730

27312731
#ifdef CONFIG_CPU_S5PV210
27322732
static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
2733-
.info = &(struct s3c24xx_uart_info) {
2733+
.info = {
27342734
.name = "Samsung S5PV210 UART",
27352735
.type = TYPE_S3C6400,
27362736
.port_type = PORT_S3C6400,
@@ -2759,7 +2759,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
27592759

27602760
#if defined(CONFIG_ARCH_EXYNOS)
27612761
#define EXYNOS_COMMON_SERIAL_DRV_DATA() \
2762-
.info = &(struct s3c24xx_uart_info) { \
2762+
.info = { \
27632763
.name = "Samsung Exynos UART", \
27642764
.type = TYPE_S3C6400, \
27652765
.port_type = PORT_S3C6400, \
@@ -2808,7 +2808,7 @@ static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = {
28082808

28092809
#ifdef CONFIG_ARCH_APPLE
28102810
static struct s3c24xx_serial_drv_data s5l_serial_drv_data = {
2811-
.info = &(struct s3c24xx_uart_info) {
2811+
.info = {
28122812
.name = "Apple S5L UART",
28132813
.type = TYPE_APPLE_S5L,
28142814
.port_type = PORT_8250,

0 commit comments

Comments
 (0)