drm/msm/dsi: Don't error if a DSI host doesn't have a device connected
authorArchit Taneja <architt@codeaurora.org>
Wed, 4 Jan 2017 08:44:58 +0000 (14:14 +0530)
committerRob Clark <robdclark@gmail.com>
Mon, 6 Feb 2017 16:28:44 +0000 (11:28 -0500)
The driver returns an error if a DSI DT node is populated, but no device
is connected to it or if the data-lane map isn't present. Ideally, such
a DSI node shouldn't be probed at all (i.e, its status should be set to
"disabled in DT"), but there isn't any harm in registering the DSI device
even if it doesn't have a bridge/panel connected to it.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/dsi/dsi_host.c

index eb0903d37e5c535c9c5c62b88e5a978ae5aa6a84..c4dad9084a3a4f76ac6c2fd49240b3a7368da273 100644 (file)
@@ -1559,8 +1559,9 @@ static int dsi_host_parse_lane_data(struct msm_dsi_host *msm_host,
 
        prop = of_find_property(ep, "data-lanes", &len);
        if (!prop) {
-               dev_dbg(dev, "failed to find data lane mapping\n");
-               return -EINVAL;
+               dev_dbg(dev,
+                       "failed to find data lane mapping, using default\n");
+               return 0;
        }
 
        num_lanes = len / sizeof(u32);
@@ -1617,7 +1618,7 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
        struct device *dev = &msm_host->pdev->dev;
        struct device_node *np = dev->of_node;
        struct device_node *endpoint, *device_node;
-       int ret;
+       int ret = 0;
 
        /*
         * Get the endpoint of the output port of the DSI host. In our case,
@@ -1641,8 +1642,7 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
        /* Get panel node from the output port's endpoint data */
        device_node = of_graph_get_remote_port_parent(endpoint);
        if (!device_node) {
-               dev_err(dev, "%s: no valid device\n", __func__);
-               ret = -ENODEV;
+               dev_dbg(dev, "%s: no valid device\n", __func__);
                goto err;
        }