mirror of
https://github.com/dgibson/dtc.git
synced 2026-04-12 00:47:46 -04:00
Make Property a subclass of bytearray
It is annoying to have to add .value when we want the value of a Property. Make Property a subclass of bytearray so that it can be used directly when the value is required. Fix the Property class comment while we are here. Suggested-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
24b1f3f064
commit
f0be81bd8d
2 changed files with 5 additions and 4 deletions
|
|
@ -418,7 +418,8 @@ class Fdt:
|
|||
"""
|
||||
return check_err(fdt_node_offset_by_phandle(self._fdt, phandle), quiet)
|
||||
|
||||
class Property:
|
||||
|
||||
class Property(bytearray):
|
||||
"""Holds a device tree property name and value.
|
||||
|
||||
This holds a copy of a property taken from the device tree. It does not
|
||||
|
|
@ -427,11 +428,11 @@ class Property:
|
|||
|
||||
Properties:
|
||||
name: Property name
|
||||
value: Proper value as a bytearray
|
||||
value: Property value as a bytearray
|
||||
"""
|
||||
def __init__(self, name, value):
|
||||
bytearray.__init__(self, value)
|
||||
self.name = name
|
||||
self.value = value
|
||||
%}
|
||||
|
||||
%rename(fdt_property) fdt_property_func;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue