drm/panel: keep mute when panel has no device-tree timing
authorMark Yao <mark.yao@rock-chips.com>
Wed, 17 Aug 2016 00:56:56 +0000 (08:56 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 17 Aug 2016 03:53:37 +0000 (11:53 +0800)
Since commit (f6972eb FROMLIST: drm/panel: add of display
timing support), when panel has no device-tree timing, would always
get noise message:
[    8.742157] /lvds_panel: could not find display-timings node
[    8.747878] /lvds_panel: no timings specified

Change-Id: I9104b3017faa837807a09c21d0f948e499827ad9
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/gpu/drm/panel/panel-simple.c

index 51fd0abd13cebea1ac52a30f619ff2a11495642e..99d78eeec0366add68c733dc5392e183e8bf34ca 100644 (file)
@@ -151,8 +151,17 @@ static int panel_simple_of_get_native_mode(struct panel_simple *panel)
        struct drm_connector *connector = panel->base.connector;
        struct drm_device *drm = panel->base.drm;
        struct drm_display_mode *mode;
+       struct device_node *timings_np;
        int ret;
 
+       timings_np = of_get_child_by_name(panel->dev->of_node,
+                                         "display-timings");
+       if (!timings_np) {
+               dev_dbg(panel->dev, "failed to find display-timings node\n");
+               return 0;
+       }
+
+       of_node_put(timings_np);
        mode = drm_mode_create(drm);
        if (!mode)
                return 0;