stm32mp1: make dt_get_stdout_node_offset() static
authorYann Gautier <yann.gautier@st.com>
Tue, 4 Jun 2019 15:20:44 +0000 (17:20 +0200)
committerYann Gautier <yann.gautier@st.com>
Mon, 17 Jun 2019 12:03:51 +0000 (14:03 +0200)
Do not export function dt_get_stdout_node_offset() that is used only inside
stm32mp_dt.c source file.

Change-Id: I9dd3dbfab21d42ed81c68723e71fe5a7586dce93
Signed-off-by: Yann Gautier <yann.gautier@st.com>
plat/st/common/include/stm32mp_dt.h
plat/st/common/stm32mp_dt.c

index 3e2c632cbb6b83c605b3e4c573d3a8b8dbada98b..74b01b3aa54ba1bedc0d1d0d1e6532b1c4b97c06 100644 (file)
@@ -36,7 +36,6 @@ int dt_set_stdout_pinctrl(void);
 void dt_fill_device_info(struct dt_node_info *info, int node);
 int dt_get_node(struct dt_node_info *info, int offset, const char *compat);
 int dt_get_stdout_uart_info(struct dt_node_info *info);
-int dt_get_stdout_node_offset(void);
 uint32_t dt_get_ddr_size(void);
 uintptr_t dt_get_ddrctrl_base(void);
 uintptr_t dt_get_ddrphyc_base(void);
index 8e828631bfa89f8fe5cb14b024501b8c342429a5..17da4904ac8f80c3b9905ee742fb0c3020911376 100644 (file)
@@ -145,6 +145,52 @@ int fdt_read_uint32_array(int node, const char *prop_name, uint32_t *array,
        return 0;
 }
 
+/*******************************************************************************
+ * This function gets the stdout path node.
+ * It reads the value indicated inside the device tree.
+ * Returns node offset on success and a negative FDT error code on failure.
+ ******************************************************************************/
+static int dt_get_stdout_node_offset(void)
+{
+       int node;
+       const char *cchar;
+
+       node = fdt_path_offset(fdt, "/secure-chosen");
+       if (node < 0) {
+               node = fdt_path_offset(fdt, "/chosen");
+               if (node < 0) {
+                       return -FDT_ERR_NOTFOUND;
+               }
+       }
+
+       cchar = fdt_getprop(fdt, node, "stdout-path", NULL);
+       if (cchar == NULL) {
+               return -FDT_ERR_NOTFOUND;
+       }
+
+       node = -FDT_ERR_NOTFOUND;
+       if (strchr(cchar, (int)':') != NULL) {
+               const char *name;
+               char *str = (char *)cchar;
+               int len = 0;
+
+               while (strncmp(":", str, 1)) {
+                       len++;
+                       str++;
+               }
+
+               name = fdt_get_alias_namelen(fdt, cchar, len);
+
+               if (name != NULL) {
+                       node = fdt_path_offset(fdt, name);
+               }
+       } else {
+               node = fdt_path_offset(fdt, cchar);
+       }
+
+       return node;
+}
+
 /*******************************************************************************
  * This function gets the stdout pin configuration information from the DT.
  * And then calls the sub-function to treat it and set GPIO registers.
@@ -231,49 +277,6 @@ int dt_get_stdout_uart_info(struct dt_node_info *info)
        return node;
 }
 
-/*******************************************************************************
- * This function gets the stdout path node.
- * It reads the value indicated inside the device tree.
- * Returns node if success, and a negative value else.
- ******************************************************************************/
-int dt_get_stdout_node_offset(void)
-{
-       int node;
-       const char *cchar;
-
-       node = fdt_path_offset(fdt, "/chosen");
-       if (node < 0) {
-               return -FDT_ERR_NOTFOUND;
-       }
-
-       cchar = fdt_getprop(fdt, node, "stdout-path", NULL);
-       if (cchar == NULL) {
-               return -FDT_ERR_NOTFOUND;
-       }
-
-       node = -FDT_ERR_NOTFOUND;
-       if (strchr(cchar, (int)':') != NULL) {
-               const char *name;
-               char *str = (char *)cchar;
-               int len = 0;
-
-               while (strncmp(":", str, 1)) {
-                       len++;
-                       str++;
-               }
-
-               name = fdt_get_alias_namelen(fdt, cchar, len);
-
-               if (name != NULL) {
-                       node = fdt_path_offset(fdt, name);
-               }
-       } else {
-               node = fdt_path_offset(fdt, cchar);
-       }
-
-       return node;
-}
-
 /*******************************************************************************
  * This function gets DDR size information from the DT.
  * Returns value in bytes on success, and 0 on failure.