Skip to content

Commit c1e794c

Browse files
committed
panel: Fix FDT_ERR_BADPHANDLE without qcom,mdss-dsi-panel-controller
The check was wrong there, since fdt(2).getprop_int32() never returns None but the default=0 parameter. Use .getprop_none() instead to make the check work correctly. Fixes #14
1 parent 310f523 commit c1e794c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

panel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,9 @@ def __init__(self, name: str, fdt: Fdt2, node: int) -> None:
279279

280280
# Check DSI controller if LDO mode is needed
281281
self.ldo_mode = False
282-
dsi_ctrl = fdt.getprop_int32(node, 'qcom,mdss-dsi-panel-controller')
282+
dsi_ctrl = fdt.getprop_or_none(node, 'qcom,mdss-dsi-panel-controller')
283283
if dsi_ctrl is not None:
284-
dsi_ctrl = fdt.node_offset_by_phandle(dsi_ctrl)
284+
dsi_ctrl = fdt.node_offset_by_phandle(dsi_ctrl.as_uint32())
285285
self.ldo_mode = fdt.getprop_or_none(dsi_ctrl, 'qcom,regulator-ldo-mode') is not None
286286

287287
# Timings are usually calculated by the driver except for downstream and LK

0 commit comments

Comments
 (0)