drm/tegra: Parse device tree earlier
authorThierry Reding <treding@nvidia.com>
Fri, 30 Aug 2013 13:27:16 +0000 (15:27 +0200)
committerThierry Reding <treding@nvidia.com>
Tue, 3 Sep 2013 08:10:13 +0000 (10:10 +0200)
Parsing the device tree may cause probing to be deferred. Doing this as
early as possible prevents any other resources from being requested and
enabled, therefore reducing the need to cleanup on deferred probe while
at the same time not wasting precious CPU cycles determining if probing
needs to be deferred or not.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/host1x/drm/rgb.c

index ed4416f202608fb0047da02f8c1a59c0d5901ac5..5aa66ef7a946f8b1c25a4241cf39f76dad9e91b7 100644 (file)
@@ -147,6 +147,13 @@ int tegra_dc_rgb_probe(struct tegra_dc *dc)
        if (!rgb)
                return -ENOMEM;
 
+       rgb->output.dev = dc->dev;
+       rgb->output.of_node = np;
+
+       err = tegra_output_parse_dt(&rgb->output);
+       if (err < 0)
+               return err;
+
        rgb->clk = devm_clk_get(dc->dev, NULL);
        if (IS_ERR(rgb->clk)) {
                dev_err(dc->dev, "failed to get clock\n");
@@ -165,13 +172,6 @@ int tegra_dc_rgb_probe(struct tegra_dc *dc)
                return err;
        }
 
-       rgb->output.dev = dc->dev;
-       rgb->output.of_node = np;
-
-       err = tegra_output_parse_dt(&rgb->output);
-       if (err < 0)
-               return err;
-
        dc->rgb = &rgb->output;
 
        return 0;