Re: [PATCH] pylibfdt: Correct the FdtSw example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Tue, Jul 02, 2019 at 06:08:15PM -0600, Simon Glass wrote:
> At present this example is incorrect since it is missing the call to
> finish_reservemap() and does not add a root node. Fix these problems.
> 
> Signed-off-by: Simon Glass <sjg@xxxxxxxxxxxx>

Appplied, thanks.

> ---
> 
>  pylibfdt/libfdt.i | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i
> index 643f95d..ecec4dd 100644
> --- a/pylibfdt/libfdt.i
> +++ b/pylibfdt/libfdt.i
> @@ -727,8 +727,10 @@ class FdtSw(FdtRo):
>  
>      # First create the device tree with a node and property:
>      sw = FdtSw()
> -    with sw.add_node('node'):
> -        sw.property_u32('reg', 2)
> +    sw.finish_reservemap()
> +    with sw.add_node(''):
> +        with sw.add_node('node'):
> +            sw.property_u32('reg', 2)
>      fdt = sw.as_fdt()
>  
>      # Now we can use it as a real device tree

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux