diff options
Diffstat (limited to 'tools/dtoc/fdt_select.py')
-rw-r--r-- | tools/dtoc/fdt_select.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/dtoc/fdt_select.py b/tools/dtoc/fdt_select.py index 681dfbfda0..18a36d88a0 100644 --- a/tools/dtoc/fdt_select.py +++ b/tools/dtoc/fdt_select.py @@ -10,14 +10,17 @@ # fallback one (which uses fdtget and is slower). Both provide the same # interface for this file to use. try: - import fdt_normal as fdt + import fdt_normal have_libfdt = True except ImportError: have_libfdt = False - import fdt_fallback as fdt + import fdt_fallback def FdtScan(fname): """Returns a new Fdt object from the implementation we are using""" - dtb = fdt.Fdt(fname) + if have_libfdt: + dtb = fdt_normal.FdtNormal(fname) + else: + dtb = fdt_fallback.FdtFallback(fname) dtb.Scan() return dtb |