From 9005f4108e7c440764153d3ea0c85e927a75ae55 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 11 Sep 2018 03:28:38 -0600 Subject: [PATCH] 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 Signed-off-by: David Gibson --- pylibfdt/libfdt.i | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i index 5e8e05d..12d2812 100644 --- a/pylibfdt/libfdt.i +++ b/pylibfdt/libfdt.i @@ -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):