tty: serial: samsung: embed s3c2410_uartcfg in parent structure
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Tue, 8 Mar 2022 08:09:13 +0000 (09:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Mar 2022 12:18:59 +0000 (13:18 +0100)
Embed "struct s3c2410_uartcfg" 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 "s3c2410_uartcfg
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-3-krzysztof.kozlowski@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/samsung_tty.c

index 966398df4b6aae9bbca844a900f0eb1a504f4ecf..40209461c5746ad1557fcb0ade3f0e716598404a 100644 (file)
@@ -86,7 +86,7 @@ struct s3c24xx_uart_info {
 
 struct s3c24xx_serial_drv_data {
        struct s3c24xx_uart_info        info;
-       struct s3c2410_uartcfg          *def_cfg;
+       struct s3c2410_uartcfg          def_cfg;
        unsigned int                    fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
 };
 
@@ -2197,7 +2197,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
        ourport->info = &ourport->drv_data->info;
        ourport->cfg = (dev_get_platdata(&pdev->dev)) ?
                        dev_get_platdata(&pdev->dev) :
-                       ourport->drv_data->def_cfg;
+                       &ourport->drv_data->def_cfg;
 
        switch (ourport->info->type) {
        case TYPE_S3C24XX:
@@ -2629,7 +2629,7 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = {
                .clksel_mask    = S3C2410_UCON_CLKMASK,
                .clksel_shift   = S3C2410_UCON_CLKSHIFT,
        },
-       .def_cfg = &(struct s3c2410_uartcfg) {
+       .def_cfg = {
                .ucon           = S3C2410_UCON_DEFAULT,
                .ufcon          = S3C2410_UFCON_DEFAULT,
        },
@@ -2658,7 +2658,7 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = {
                .clksel_mask    = S3C2412_UCON_CLKMASK,
                .clksel_shift   = S3C2412_UCON_CLKSHIFT,
        },
-       .def_cfg = &(struct s3c2410_uartcfg) {
+       .def_cfg = {
                .ucon           = S3C2410_UCON_DEFAULT,
                .ufcon          = S3C2410_UFCON_DEFAULT,
        },
@@ -2689,7 +2689,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
                .clksel_shift   = S3C2412_UCON_CLKSHIFT,
                .ucon_mask      = S3C2440_UCON0_DIVMASK,
        },
-       .def_cfg = &(struct s3c2410_uartcfg) {
+       .def_cfg = {
                .ucon           = S3C2410_UCON_DEFAULT,
                .ufcon          = S3C2410_UFCON_DEFAULT,
        },
@@ -2718,7 +2718,7 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = {
                .clksel_mask    = S3C6400_UCON_CLKMASK,
                .clksel_shift   = S3C6400_UCON_CLKSHIFT,
        },
-       .def_cfg = &(struct s3c2410_uartcfg) {
+       .def_cfg = {
                .ucon           = S3C2410_UCON_DEFAULT,
                .ufcon          = S3C2410_UFCON_DEFAULT,
        },
@@ -2746,7 +2746,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
                .clksel_mask    = S5PV210_UCON_CLKMASK,
                .clksel_shift   = S5PV210_UCON_CLKSHIFT,
        },
-       .def_cfg = &(struct s3c2410_uartcfg) {
+       .def_cfg = {
                .ucon           = S5PV210_UCON_DEFAULT,
                .ufcon          = S5PV210_UFCON_DEFAULT,
        },
@@ -2775,7 +2775,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
                .clksel_mask    = 0,                            \
                .clksel_shift   = 0,                            \
        },                                                      \
-       .def_cfg = &(struct s3c2410_uartcfg) {                  \
+       .def_cfg = {                                            \
                .ucon           = S5PV210_UCON_DEFAULT,         \
                .ufcon          = S5PV210_UFCON_DEFAULT,        \
                .has_fracval    = 1,                            \
@@ -2824,7 +2824,7 @@ static struct s3c24xx_serial_drv_data s5l_serial_drv_data = {
                .clksel_mask    = 0,
                .clksel_shift   = 0,
        },
-       .def_cfg = &(struct s3c2410_uartcfg) {
+       .def_cfg = {
                .ucon           = APPLE_S5L_UCON_DEFAULT,
                .ufcon          = S3C2410_UFCON_DEFAULT,
        },