@@ -761,12 +761,16 @@ int of_get_drm_panel_display_mode(struct device_node *np,
drm_bus_flags_from_videomode(&vm, bus_flags);
ret = of_property_read_u32(np, "width-mm", &width_mm);
- if (ret && ret != -EINVAL)
+ if (ret < 0) {
+ pr_err("%pOF: invalid or missing width-mm DT property\n", np);
return ret;
+ }
ret = of_property_read_u32(np, "height-mm", &height_mm);
- if (ret && ret != -EINVAL)
+ if (ret < 0) {
+ pr_err("%pOF: invalid or missing height-mm DT property\n", np);
return ret;
+ }
dmode->width_mm = width_mm;
dmode->height_mm = height_mm;
Make the width-mm/height-mm panel properties mandatory in of_get_drm_panel_display_mode(), print error message and return -ve in case these DT properties are not present. This is needed to correctly report panel dimensions. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Christoph Niedermaier <cniedermaier@dh-electronics.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Dmitry Osipenko <digetx@gmail.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Noralf Trønnes <noralf@tronnes.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: Robert Foss <robert.foss@linaro.org> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/drm_modes.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)