aboutsummaryrefslogtreecommitdiff
path: root/lib/utils/fdt/fdt_helper.c
diff options
context:
space:
mode:
authorXiang W <wxjstz@126.com>2022-10-31 19:21:45 +0800
committerAnup Patel <anup@brainfault.org>2022-11-14 22:07:36 +0530
commit21ba418f1a3b5e9f9f787073c13b15f2243c3297 (patch)
tree73f3f230eeb9e4bc2f612fbfc2b51e1d97829fb6 /lib/utils/fdt/fdt_helper.c
parent85cf56c159f6c955bf3616271cb1ce9c946bc9ad (diff)
downloadopensbi-21ba418f1a3b5e9f9f787073c13b15f2243c3297.zip
opensbi-21ba418f1a3b5e9f9f787073c13b15f2243c3297.tar.gz
opensbi-21ba418f1a3b5e9f9f787073c13b15f2243c3297.tar.bz2
lib: utils/fdt: Simplified code
Simplified fdt_parse_xxx_uart_node which direct call fdt_parse_uart_node_common. Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils/fdt/fdt_helper.c')
-rw-r--r--lib/utils/fdt/fdt_helper.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c
index cdd0b35..89b8bba 100644
--- a/lib/utils/fdt/fdt_helper.c
+++ b/lib/utils/fdt/fdt_helper.c
@@ -350,43 +350,25 @@ static int fdt_parse_uart_node_common(void *fdt, int nodeoffset,
int fdt_parse_gaisler_uart_node(void *fdt, int nodeoffset,
struct platform_uart_data *uart)
{
- int rc;
-
- rc = fdt_parse_uart_node_common(fdt, nodeoffset, uart,
+ return fdt_parse_uart_node_common(fdt, nodeoffset, uart,
DEFAULT_UART_FREQ,
DEFAULT_UART_BAUD);
-
- if (rc)
- return rc;
-
- return 0;
}
int fdt_parse_shakti_uart_node(void *fdt, int nodeoffset,
struct platform_uart_data *uart)
{
- int rc;
-
- rc = fdt_parse_uart_node_common(fdt, nodeoffset, uart,
+ return fdt_parse_uart_node_common(fdt, nodeoffset, uart,
DEFAULT_SHAKTI_UART_FREQ,
DEFAULT_SHAKTI_UART_BAUD);
-
- return rc ? : 0;
}
int fdt_parse_sifive_uart_node(void *fdt, int nodeoffset,
struct platform_uart_data *uart)
{
- int rc;
-
- rc = fdt_parse_uart_node_common(fdt, nodeoffset, uart,
+ return fdt_parse_uart_node_common(fdt, nodeoffset, uart,
DEFAULT_SIFIVE_UART_FREQ,
DEFAULT_SIFIVE_UART_BAUD);
-
- if (rc)
- return rc;
-
- return 0;
}
int fdt_parse_uart_node(void *fdt, int nodeoffset,
@@ -398,7 +380,6 @@ int fdt_parse_uart_node(void *fdt, int nodeoffset,
rc = fdt_parse_uart_node_common(fdt, nodeoffset, uart,
DEFAULT_UART_FREQ,
DEFAULT_UART_BAUD);
-
if (rc)
return rc;
@@ -441,11 +422,7 @@ int fdt_parse_uart8250(void *fdt, struct platform_uart_data *uart,
int fdt_parse_xlnx_uartlite_node(void *fdt, int nodeoffset,
struct platform_uart_data *uart)
{
- int rc;
-
- rc = fdt_parse_uart_node_common(fdt, nodeoffset, uart, 0, 0);
-
- return rc ? : 0;
+ return fdt_parse_uart_node_common(fdt, nodeoffset, uart, 0, 0);
}
int fdt_parse_aplic_node(void *fdt, int nodeoff, struct aplic_data *aplic)