linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tty: serial: samsung: Improve naming for common macro
@ 2021-09-14 14:23 Sam Protsenko
  2021-09-15  7:28 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Protsenko @ 2021-09-14 14:23 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-arm-kernel, linux-samsung-soc, linux-serial,
	linux-kernel

Having "_USI" suffix in EXYNOS_COMMON_SERIAL_DRV_DATA_USI() macro is
confusing. Rename it to just EXYNOS_COMMON_SERIAL_DRV_DATA() and provide
USI registers availability for all Exynos variants instead.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
 drivers/tty/serial/samsung_tty.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index e2f49863e9c2..542b7e2b99dc 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -2780,7 +2780,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
 #endif
 
 #if defined(CONFIG_ARCH_EXYNOS)
-#define EXYNOS_COMMON_SERIAL_DRV_DATA_USI(_has_usi)		\
+#define EXYNOS_COMMON_SERIAL_DRV_DATA(_has_usi)			\
 	.info = &(struct s3c24xx_uart_info) {			\
 		.name		= "Samsung Exynos UART",	\
 		.type		= TYPE_S3C6400,			\
@@ -2804,21 +2804,18 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
 		.has_fracval	= 1,				\
 	}							\
 
-#define EXYNOS_COMMON_SERIAL_DRV_DATA				\
-	EXYNOS_COMMON_SERIAL_DRV_DATA_USI(0)
-
 static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = {
-	EXYNOS_COMMON_SERIAL_DRV_DATA,
+	EXYNOS_COMMON_SERIAL_DRV_DATA(0),
 	.fifosize = { 256, 64, 16, 16 },
 };
 
 static struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = {
-	EXYNOS_COMMON_SERIAL_DRV_DATA,
+	EXYNOS_COMMON_SERIAL_DRV_DATA(0),
 	.fifosize = { 64, 256, 16, 256 },
 };
 
 static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = {
-	EXYNOS_COMMON_SERIAL_DRV_DATA_USI(1),
+	EXYNOS_COMMON_SERIAL_DRV_DATA(1),
 	.fifosize = { 256, 64, 64, 64 },
 };
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tty: serial: samsung: Improve naming for common macro
  2021-09-14 14:23 [PATCH] tty: serial: samsung: Improve naming for common macro Sam Protsenko
@ 2021-09-15  7:28 ` Krzysztof Kozlowski
  2021-10-05  9:56   ` Sam Protsenko
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2021-09-15  7:28 UTC (permalink / raw)
  To: Sam Protsenko, Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-arm-kernel, linux-samsung-soc, linux-serial,
	linux-kernel

On 14/09/2021 16:23, Sam Protsenko wrote:
> Having "_USI" suffix in EXYNOS_COMMON_SERIAL_DRV_DATA_USI() macro is
> confusing. Rename it to just EXYNOS_COMMON_SERIAL_DRV_DATA() and provide
> USI registers availability for all Exynos variants instead.
> 
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> ---
>  drivers/tty/serial/samsung_tty.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)>
> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> index e2f49863e9c2..542b7e2b99dc 100644
> --- a/drivers/tty/serial/samsung_tty.c
> +++ b/drivers/tty/serial/samsung_tty.c
> @@ -2780,7 +2780,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
>  #endif
>  
>  #if defined(CONFIG_ARCH_EXYNOS)
> -#define EXYNOS_COMMON_SERIAL_DRV_DATA_USI(_has_usi)		\
> +#define EXYNOS_COMMON_SERIAL_DRV_DATA(_has_usi)			\
>  	.info = &(struct s3c24xx_uart_info) {			\
>  		.name		= "Samsung Exynos UART",	\
>  		.type		= TYPE_S3C6400,			\
> @@ -2804,21 +2804,18 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
>  		.has_fracval	= 1,				\
>  	}							\
>  
> -#define EXYNOS_COMMON_SERIAL_DRV_DATA				\
> -	EXYNOS_COMMON_SERIAL_DRV_DATA_USI(0)
> -
>  static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = {
> -	EXYNOS_COMMON_SERIAL_DRV_DATA,
> +	EXYNOS_COMMON_SERIAL_DRV_DATA(0),
>  	.fifosize = { 256, 64, 16, 16 },
>  };
>  
>  static struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = {
> -	EXYNOS_COMMON_SERIAL_DRV_DATA,
> +	EXYNOS_COMMON_SERIAL_DRV_DATA(0),
>  	.fifosize = { 64, 256, 16, 256 },
>  };
>  
>  static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = {
> -	EXYNOS_COMMON_SERIAL_DRV_DATA_USI(1),

Makes sense, although I would prefer to have here true or false. More
obvious. Otherwise "1" looks like counter/number for some property.

The has_usi field in struct could be then also converted to bool.


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tty: serial: samsung: Improve naming for common macro
  2021-09-15  7:28 ` Krzysztof Kozlowski
@ 2021-10-05  9:56   ` Sam Protsenko
  0 siblings, 0 replies; 3+ messages in thread
From: Sam Protsenko @ 2021-10-05  9:56 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-arm Mailing List,
	Linux Samsung SOC, open list:SERIAL DRIVERS,
	Linux Kernel Mailing List

On Wed, 15 Sept 2021 at 10:28, Krzysztof Kozlowski
<krzysztof.kozlowski@canonical.com> wrote:
>
> On 14/09/2021 16:23, Sam Protsenko wrote:
> > Having "_USI" suffix in EXYNOS_COMMON_SERIAL_DRV_DATA_USI() macro is
> > confusing. Rename it to just EXYNOS_COMMON_SERIAL_DRV_DATA() and provide
> > USI registers availability for all Exynos variants instead.
> >
> > Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> > ---
> >  drivers/tty/serial/samsung_tty.c | 11 ++++-------
> >  1 file changed, 4 insertions(+), 7 deletions(-)>
> > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> > index e2f49863e9c2..542b7e2b99dc 100644
> > --- a/drivers/tty/serial/samsung_tty.c
> > +++ b/drivers/tty/serial/samsung_tty.c
> > @@ -2780,7 +2780,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
> >  #endif
> >
> >  #if defined(CONFIG_ARCH_EXYNOS)
> > -#define EXYNOS_COMMON_SERIAL_DRV_DATA_USI(_has_usi)          \
> > +#define EXYNOS_COMMON_SERIAL_DRV_DATA(_has_usi)                      \
> >       .info = &(struct s3c24xx_uart_info) {                   \
> >               .name           = "Samsung Exynos UART",        \
> >               .type           = TYPE_S3C6400,                 \
> > @@ -2804,21 +2804,18 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
> >               .has_fracval    = 1,                            \
> >       }                                                       \
> >
> > -#define EXYNOS_COMMON_SERIAL_DRV_DATA                                \
> > -     EXYNOS_COMMON_SERIAL_DRV_DATA_USI(0)
> > -
> >  static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = {
> > -     EXYNOS_COMMON_SERIAL_DRV_DATA,
> > +     EXYNOS_COMMON_SERIAL_DRV_DATA(0),
> >       .fifosize = { 256, 64, 16, 16 },
> >  };
> >
> >  static struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = {
> > -     EXYNOS_COMMON_SERIAL_DRV_DATA,
> > +     EXYNOS_COMMON_SERIAL_DRV_DATA(0),
> >       .fifosize = { 64, 256, 16, 256 },
> >  };
> >
> >  static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = {
> > -     EXYNOS_COMMON_SERIAL_DRV_DATA_USI(1),
>
> Makes sense, although I would prefer to have here true or false. More
> obvious. Otherwise "1" looks like counter/number for some property.
>
> The has_usi field in struct could be then also converted to bool.
>

No problem, will send v2 shortly.

>
> Best regards,
> Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-05  9:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14 14:23 [PATCH] tty: serial: samsung: Improve naming for common macro Sam Protsenko
2021-09-15  7:28 ` Krzysztof Kozlowski
2021-10-05  9:56   ` Sam Protsenko

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).