Re: [PATCH v1 14/24] fdt_support: always define fdt_fixup_mtdparts

Simon Glass
2023-02-22T21:20:51Z

On Tue, 21 Feb 2023 at 18:39, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> SPL code wants fdt_fixup_mtdparts defined as a NOP
> when the function isn't linked in.
>
> Prepare for ifdef CONFIG_OF_LIBFDT being converted to
> if CONFIG_IS_ENABLED(OF_LIBFDT)
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> include/fdt_support.h | 23 +++++++++++++----------
> 1 file changed, 13 insertions(+), 10 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

But is it possible to avoid moving this in the file?

> diff --git a/include/fdt_support.h b/include/fdt_support.h
> index eeb83e6251d..94497d755a3 100644
> --- a/include/fdt_support.h
> +++ b/include/fdt_support.h
> @@ -245,16 +245,6 @@ int fdt_increase_size(void *fdt, int add_len);
> int fdt_delete_disabled_nodes(void *blob);
>
> struct node_info;
> -#if defined(CONFIG_FDT_FIXUP_PARTITIONS)
> -void fdt_fixup_mtdparts(void *fdt, const struct node_info *node_info,
> - int node_info_size);
> -#else
> -static inline void fdt_fixup_mtdparts(void *fdt,
> - const struct node_info *node_info,
> - int node_info_size)
> -{
> -}
> -#endif
>
> void fdt_del_node_and_alias(void *blob, const char *alias);
>
> @@ -412,6 +402,19 @@ int fdt_get_cells_len(const void *blob, char *nr_cells_name);
>
> #endif /* ifdef CONFIG_OF_LIBFDT */
>
> +#if CONFIG_IS_ENABLED(OF_LIBFDT) && defined(CONFIG_FDT_FIXUP_PARTITIONS)
> +struct node_info;
> +void fdt_fixup_mtdparts(void *fdt, const struct node_info *node_info,
> + int node_info_size);
> +#else
> +struct node_info;
> +static inline void fdt_fixup_mtdparts(void *fdt,
> + const struct node_info *node_info,
> + int node_info_size)
> +{
> +}
> +#endif
> +
> #ifdef USE_HOSTCC
> int fdtdec_get_int(const void *blob, int node, const char *prop_name,
> int default_val);
> --
> 2.34.1
>