probe: Fix crash on systems without USB

While __get_phandle_array returns the empty set when the property is
not available, str_array would return None, unless instructed
otherwise. Make sure that it also returns the empty set.
This commit is contained in:
Tobias Waldekranz
2024-03-13 11:01:15 +01:00
parent d602e48d0f
commit 736a23ccae
+1 -1
View File
@@ -83,7 +83,7 @@ class DTSystem:
}
def infix_usb_devices(self, out):
names=self.infix.str_array("usb-port-names")
names=self.infix.str_array("usb-port-names", ())
phs=self.__get_phandle_array("usb-ports")
data=dict(zip(names,phs))
if data != {}: