Re: [PATCH] of/flattree: use callback to setup initrd from /chosen

Michael Ellerman
2009-12-22T10:47:48Z

[-- Attachment #1: Type: text/plain, Size: 897 bytes --]

On Tue, 2009-12-22 at 17:39 +0800, Jeremy Kerr wrote:
> At present, the fdt code sets the kernel-wide initrd_start and
> initrd_end variables when parsing /chosen. On ARM, we only set these
> once the bootmem has been reserved.
>
> This change adds an arch callback to setup the initrd from the device
> tree:
>
> void early_init_dt_setup_initrd_arch(unsigned long start,
> unsigned long end);

arch_early_init_dt_setup_initrd() makes more sense to me, but ..

> +#ifdef CONFIG_BLK_DEV_INITRD
> +void __init early_init_dt_setup_initrd_arch(unsigned long start,
> + unsigned long end)
> +{
> + initrd_start = (unsigned long)__va(start);
> + initrd_end = (unsigned long)__va(end);
> + initrd_below_start_ok = 1;
> +}
> +#endif

Given you have two identical implementations why not make that the
default and make it weak, and let ARM override it.