Re: [PATCH] dm: core: Provide fallbacks for ofnode_conf_read_...

2022-06-28 Thread Simon Glass
On 3/28/22 6:14 PM, Sean Anderson wrote:
> Because fdt_get_config_str et al. were moved/renamed to
> ofnode_conf_read_str, they now depend on CONFIG_DM as well as
> CONFIG_OF_CONTROL. Add some fallback implementations, preventing a
> linker error when CONFIG_SPL_OF_CONTROL and CONFIG_SPL_ENV_IS_IN_MMC are
> enabled and CONFIG_SPL_DM is disabled.
>
> Fixes: 7de8bd03c3 ("treewide: fdt: Move fdt_get_config_... to 
> ofnode_conf_read...")
> Signed-off-by: Sean Anderson 
> ---
>
>  include/dm/ofnode.h | 17 +
>  1 file changed, 17 insertions(+)
>
Applied to u-boot-dm, thanks!


Re: [PATCH] dm: core: Provide fallbacks for ofnode_conf_read_...

2022-05-10 Thread Sean Anderson
On 3/28/22 6:14 PM, Sean Anderson wrote:
> Because fdt_get_config_str et al. were moved/renamed to
> ofnode_conf_read_str, they now depend on CONFIG_DM as well as
> CONFIG_OF_CONTROL. Add some fallback implementations, preventing a
> linker error when CONFIG_SPL_OF_CONTROL and CONFIG_SPL_ENV_IS_IN_MMC are
> enabled and CONFIG_SPL_DM is disabled.
> 
> Fixes: 7de8bd03c3 ("treewide: fdt: Move fdt_get_config_... to 
> ofnode_conf_read...")
> Signed-off-by: Sean Anderson 
> ---
> 
>  include/dm/ofnode.h | 17 +
>  1 file changed, 17 insertions(+)
> 
> diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
> index 744dffe0a2..434696b2b6 100644
> --- a/include/dm/ofnode.h
> +++ b/include/dm/ofnode.h
> @@ -1180,6 +1180,7 @@ int ofnode_write_string(ofnode node, const char 
> *propname, const char *value);
>   */
>  int ofnode_set_enabled(ofnode node, bool value);
>  
> +#if CONFIG_IS_ENABLED(DM)
>  /**
>   * ofnode_conf_read_bool() - Read a boolean value from the U-Boot config
>   *
> @@ -1216,5 +1217,21 @@ int ofnode_conf_read_int(const char *prop_name, int 
> default_val);
>   * Return: string value, if found, or NULL if not
>   */
>  const char *ofnode_conf_read_str(const char *prop_name);
> +#else /* CONFIG_DM */
> +static inline bool ofnode_conf_read_bool(const char *prop_name)
> +{
> + return false;
> +}
> +
> +static inline int ofnode_conf_read_int(const char *prop_name, int 
> default_val)
> +{
> + return default_val;
> +}
> +
> +static inline const char *ofnode_conf_read_str(const char *prop_name)
> +{
> + return NULL;
> +}
> +#endif /* CONFIG_DM */
>  
>  #endif
> 

ping?

--Sean


[PATCH] dm: core: Provide fallbacks for ofnode_conf_read_...

2022-03-28 Thread Sean Anderson
Because fdt_get_config_str et al. were moved/renamed to
ofnode_conf_read_str, they now depend on CONFIG_DM as well as
CONFIG_OF_CONTROL. Add some fallback implementations, preventing a
linker error when CONFIG_SPL_OF_CONTROL and CONFIG_SPL_ENV_IS_IN_MMC are
enabled and CONFIG_SPL_DM is disabled.

Fixes: 7de8bd03c3 ("treewide: fdt: Move fdt_get_config_... to 
ofnode_conf_read...")
Signed-off-by: Sean Anderson 
---

 include/dm/ofnode.h | 17 +
 1 file changed, 17 insertions(+)

diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 744dffe0a2..434696b2b6 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -1180,6 +1180,7 @@ int ofnode_write_string(ofnode node, const char 
*propname, const char *value);
  */
 int ofnode_set_enabled(ofnode node, bool value);
 
+#if CONFIG_IS_ENABLED(DM)
 /**
  * ofnode_conf_read_bool() - Read a boolean value from the U-Boot config
  *
@@ -1216,5 +1217,21 @@ int ofnode_conf_read_int(const char *prop_name, int 
default_val);
  * Return: string value, if found, or NULL if not
  */
 const char *ofnode_conf_read_str(const char *prop_name);
+#else /* CONFIG_DM */
+static inline bool ofnode_conf_read_bool(const char *prop_name)
+{
+   return false;
+}
+
+static inline int ofnode_conf_read_int(const char *prop_name, int default_val)
+{
+   return default_val;
+}
+
+static inline const char *ofnode_conf_read_str(const char *prop_name)
+{
+   return NULL;
+}
+#endif /* CONFIG_DM */
 
 #endif
-- 
2.35.1.1320.gc452695387.dirty