summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/fsl-dcu
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2016-12-28 14:48:48 -0200
committerStefan Agner <stefan@agner.ch>2017-02-07 20:28:04 -0800
commitef15d36154cc741d7ded4ae4fa0cf7987354e313 (patch)
tree1c0ae48431cadad1195f2eb606ff7196215321f6 /drivers/gpu/drm/fsl-dcu
parent5d2883d51d60ce34a773d4a07b468216109d9030 (diff)
downloadlinux-ef15d36154cc741d7ded4ae4fa0cf7987354e313.tar.bz2
drm/fsl-dcu: check for clk_prepare_enable() error
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>
Diffstat (limited to 'drivers/gpu/drm/fsl-dcu')
-rw-r--r--drivers/gpu/drm/fsl-dcu/fsl_tcon.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_tcon.c b/drivers/gpu/drm/fsl-dcu/fsl_tcon.c
index 2fbb7eedb066..b3d70a63c5a3 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_tcon.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_tcon.c
@@ -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;