drm/tegra: dc: Check for valid parent clock
authorThierry Reding <treding@nvidia.com>
Thu, 22 Jan 2015 07:48:25 +0000 (08:48 +0100)
committerThierry Reding <treding@nvidia.com>
Thu, 2 Apr 2015 16:46:13 +0000 (18:46 +0200)
Check that the desired parent clock is indeed a valid parent for the
display controller clock. This is purely cosmetic at this point since
the parent clocks are specified in DT and all the currently defined
parents are in fact valid parents of the display controller clock.

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

index 1a52522f5da76790dae32fe1a423bd75eaddd1e4..8746a9ce6a8fdba3243900e220f187fd0044484d 100644 (file)
@@ -1177,6 +1177,9 @@ int tegra_dc_state_setup_clock(struct tegra_dc *dc,
 {
        struct tegra_dc_state *state = to_dc_state(crtc_state);
 
+       if (!clk_has_parent(dc->clk, clk))
+               return -EINVAL;
+
        state->clk = clk;
        state->pclk = pclk;
        state->div = div;