[PATCH 1/2] pylibfdt: Allow delprop() to return errors

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



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@xxxxxxxxxxxx>
---

 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):
-- 
2.19.0.rc2.392.g5ba43deb5a-goog




[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