From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
Alim Akhtar <alim.akhtar@samsung.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/7] tty: serial: samsung: embed s3c2410_uartcfg in parent structure
Date: Mon, 7 Mar 2022 09:09:20 +0100 [thread overview]
Message-ID: <20220307080925.54131-1-krzysztof.kozlowski@canonical.com> (raw)
In-Reply-To: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com>
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.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
---
drivers/tty/serial/samsung_tty.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index aa5678d03704..a9a75b5b9705 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -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];
};
@@ -2200,7 +2200,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:
@@ -2632,7 +2632,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,
},
@@ -2661,7 +2661,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,
},
@@ -2692,7 +2692,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,
},
@@ -2721,7 +2721,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,
},
@@ -2749,7 +2749,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,
},
@@ -2778,7 +2778,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, \
@@ -2827,7 +2827,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,
},
--
2.32.0
next prev parent reply other threads:[~2022-03-07 8:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20220307080826epcas5p13d71054f6b461cff91edbbb2cf42491a@epcas5p1.samsung.com>
2022-03-07 8:08 ` [PATCH v2 0/7] tty: serial: samsung: minor fixes/cleanups Krzysztof Kozlowski
2022-03-07 8:08 ` [PATCH v2 1/7] tty: serial: samsung: embed s3c24xx_uart_info in parent structure Krzysztof Kozlowski
2022-03-07 8:08 ` Krzysztof Kozlowski
2022-03-07 8:10 ` Krzysztof Kozlowski
2022-03-07 8:09 ` Krzysztof Kozlowski [this message]
2022-03-07 8:09 ` [PATCH v2 3/7] tty: serial: samsung: constify s3c24xx_serial_drv_data Krzysztof Kozlowski
2022-03-07 8:33 ` Jiri Slaby
2022-03-07 8:40 ` Krzysztof Kozlowski
2022-03-08 8:06 ` Krzysztof Kozlowski
2022-03-07 18:18 ` Alim Akhtar
2022-03-07 8:09 ` [PATCH v2 4/7] tty: serial: samsung: constify UART name Krzysztof Kozlowski
2022-03-07 8:09 ` [PATCH v2 5/7] tty: serial: samsung: constify s3c24xx_serial_drv_data members Krzysztof Kozlowski
2022-03-07 8:09 ` [PATCH v2 6/7] tty: serial: samsung: constify variables and pointers Krzysztof Kozlowski
2022-03-07 8:09 ` [PATCH v2 7/7] tty: serial: samsung: simplify getting OF match data Krzysztof Kozlowski
2022-03-07 18:16 ` Alim Akhtar
2022-03-07 20:24 ` Andy Shevchenko
2022-03-08 7:19 ` Krzysztof Kozlowski
2022-03-07 18:21 ` [PATCH v2 0/7] tty: serial: samsung: minor fixes/cleanups Alim Akhtar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220307080925.54131-1-krzysztof.kozlowski@canonical.com \
--to=krzysztof.kozlowski@canonical.com \
--cc=alim.akhtar@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).