aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Barker2023-10-16 10:25:23 +0100
committerMarek Vasut2023-10-16 15:46:17 +0200
commitcaf3503c4a2f0c1e7934144c3eacc219aa049e11 (patch)
treeb6101e37662ebb6176cb7f2907ceec8289936f1b
parent3c3f1626919cd93cbe6c56e3849937de5be18dbb (diff)
serial: sh: Fix compile error when lacking HSCIF support
If we attempt to compile serial_sh.c for a system which lacks HSCIF support (e.g. R8A7740), we see the following compilation error: In file included from drivers/serial/serial_sh.c:20: drivers/serial/serial_sh.c: In function ‘sh_serial_init_generic’: drivers/serial/serial_sh.h:429:35: warning: implicit declaration of function ‘sci_HSSRR_out’; did you mean ‘sci_SCSCR_out’? [-Wimplicit-function-declaration] 429 | #define sci_out(port, reg, value) sci_##reg##_out(port, value) | ^~~~ drivers/serial/serial_sh.c:62:17: note: in expansion of macro ‘sci_out’ 62 | sci_out(port, HSSRR, HSSRR_SRE | HSSRR_SRCYC8); | ^~~~~~~ To fix this, only try to support access to the HSSRR register for SoCs where it actually exists. Support for the RZ/G2L will be introduced in following patches, which selects CONFIG_RCAR_64 but does not have HSCIF interfaces, so check for CONFIG_RCAR_GEN2 || CONFIG_RCAR_GEN3 || CONFIG_RCAR_GEN4 to determine if HSCIF is present. Fixes: bbe36e29ca2c ('serial: sh: Add HSCIF support for R-Car SoC') Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Cc: Hai Pham <hai.pham.ud@renesas.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
-rw-r--r--drivers/serial/serial_sh.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c
index 20cda5dbe27..5e543dbf3d5 100644
--- a/drivers/serial/serial_sh.c
+++ b/drivers/serial/serial_sh.c
@@ -58,8 +58,10 @@ static void sh_serial_init_generic(struct uart_port *port)
sci_out(port, SCSPTR, 0x0003);
#endif
+#if IS_ENABLED(CONFIG_RCAR_GEN2) || IS_ENABLED(CONFIG_RCAR_GEN3) || IS_ENABLED(CONFIG_RCAR_GEN4)
if (port->type == PORT_HSCIF)
sci_out(port, HSSRR, HSSRR_SRE | HSSRR_SRCYC8);
+#endif
}
static void