Skip to content

Commit

Permalink
drm/fsl-dcu: check for clk_prepare_enable() error
Browse files Browse the repository at this point in the history
clk_prepare_enable() may fail, so we should better check its return
value.

Also place the of_node_put() function right after clk_prepare_enable(),
in order to avoid calling of_node_put() twice in case clk_prepare_enable()
fails.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
  • Loading branch information
Fabio Estevam authored and Stefan Agner committed Feb 8, 2017
1 parent 5d2883d commit ef15d36
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/gpu/drm/fsl-dcu/fsl_tcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ struct fsl_tcon *fsl_tcon_init(struct device *dev)
goto err_node_put;
}

of_node_put(np);
clk_prepare_enable(tcon->ipg_clk);
ret = clk_prepare_enable(tcon->ipg_clk);
if (ret) {
dev_err(dev, "Couldn't enable the TCON clock\n");
goto err_node_put;
}

of_node_put(np);
dev_info(dev, "Using TCON in bypass mode\n");

return tcon;
Expand Down

0 comments on commit ef15d36

Please sign in to comment.