tty: serial: samsung: embed s3c24xx_uart_info in parent structure
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Tue, 8 Mar 2022 08:09:12 +0000 (09:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Mar 2022 12:18:59 +0000 (13:18 +0100)
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 <alim.akhtar@samsung.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20220308080919.152715-2-krzysztof.kozlowski@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/samsung_tty.c

index ab26520c9c2172d63d29ca8d2e6ba3b5dd39e867..966398df4b6aae9bbca844a900f0eb1a504f4ecf 100644 (file)
@@ -85,7 +85,7 @@ struct s3c24xx_uart_info {
 };
 
 struct s3c24xx_serial_drv_data {
-       struct s3c24xx_uart_info        *info;
+       struct s3c24xx_uart_info        info;
        struct s3c2410_uartcfg          *def_cfg;
        unsigned int                    fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
 };
@@ -2194,7 +2194,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
        }
 
        ourport->baudclk = ERR_PTR(-EINVAL);
-       ourport->info = ourport->drv_data->info;
+       ourport->info = &ourport->drv_data->info;
        ourport->cfg = (dev_get_platdata(&pdev->dev)) ?
                        dev_get_platdata(&pdev->dev) :
                        ourport->drv_data->def_cfg;
@@ -2613,7 +2613,7 @@ static struct console s3c24xx_serial_console = {
 
 #ifdef CONFIG_CPU_S3C2410
 static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = {
-       .info = &(struct s3c24xx_uart_info) {
+       .info = {
                .name           = "Samsung S3C2410 UART",
                .type           = TYPE_S3C24XX,
                .port_type      = PORT_S3C2410,
@@ -2641,7 +2641,7 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = {
 
 #ifdef CONFIG_CPU_S3C2412
 static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = {
-       .info = &(struct s3c24xx_uart_info) {
+       .info = {
                .name           = "Samsung S3C2412 UART",
                .type           = TYPE_S3C24XX,
                .port_type      = PORT_S3C2412,
@@ -2671,7 +2671,7 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = {
 #if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2416) || \
        defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2442)
 static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
-       .info = &(struct s3c24xx_uart_info) {
+       .info = {
                .name           = "Samsung S3C2440 UART",
                .type           = TYPE_S3C24XX,
                .port_type      = PORT_S3C2440,
@@ -2701,7 +2701,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
 
 #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
 static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = {
-       .info = &(struct s3c24xx_uart_info) {
+       .info = {
                .name           = "Samsung S3C6400 UART",
                .type           = TYPE_S3C6400,
                .port_type      = PORT_S3C6400,
@@ -2730,7 +2730,7 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = {
 
 #ifdef CONFIG_CPU_S5PV210
 static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
-       .info = &(struct s3c24xx_uart_info) {
+       .info = {
                .name           = "Samsung S5PV210 UART",
                .type           = TYPE_S3C6400,
                .port_type      = PORT_S3C6400,
@@ -2759,7 +2759,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
 
 #if defined(CONFIG_ARCH_EXYNOS)
 #define EXYNOS_COMMON_SERIAL_DRV_DATA()                                \
-       .info = &(struct s3c24xx_uart_info) {                   \
+       .info = {                                               \
                .name           = "Samsung Exynos UART",        \
                .type           = TYPE_S3C6400,                 \
                .port_type      = PORT_S3C6400,                 \
@@ -2808,7 +2808,7 @@ static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = {
 
 #ifdef CONFIG_ARCH_APPLE
 static struct s3c24xx_serial_drv_data s5l_serial_drv_data = {
-       .info = &(struct s3c24xx_uart_info) {
+       .info = {
                .name           = "Apple S5L UART",
                .type           = TYPE_APPLE_S5L,
                .port_type      = PORT_8250,