Browse Source

pylibfdt: Allow delprop() to return errors

At present this method always raised an exception when an error occurs.
Add a 'quiet' argument so it matches the other methods.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Simon Glass 6 years ago committed by David Gibson
parent
commit
9005f4108e
  1. 8
      pylibfdt/libfdt.i

8
pylibfdt/libfdt.i

@ -673,17 +673,21 @@ class Fdt(FdtRo): @@ -673,17 +673,21 @@ class Fdt(FdtRo):
return check_err(fdt_setprop(self._fdt, nodeoffset, prop_name,
val, len(val)), quiet)

def delprop(self, nodeoffset, prop_name):
def delprop(self, nodeoffset, prop_name, quiet=()):
"""Delete a property from a node

Args:
nodeoffset: Node offset containing property to delete
prop_name: Name of property to delete
quiet: Errors to ignore (empty to raise on all errors)

Returns:
Error code, or 0 if OK

Raises:
FdtError if the property does not exist, or another error occurs
"""
return check_err(fdt_delprop(self._fdt, nodeoffset, prop_name))
return check_err(fdt_delprop(self._fdt, nodeoffset, prop_name), quiet)


class Property(bytearray):

Loading…
Cancel
Save