summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/sun4i/sun4i_drv.c
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2017-02-17 11:13:30 +0800
committerMaxime Ripard <maxime.ripard@free-electrons.com>2017-03-07 22:15:15 +0100
commitea411fd2c8d5704fc247be106026d436d27c900f (patch)
tree9a14fd007a6d87af7ab5a7c75bcf4fa33a67a045 /drivers/gpu/drm/sun4i/sun4i_drv.c
parent903795d60ffa89918b521064b0cbcba139ae4047 (diff)
downloadop-kernel-dev-ea411fd2c8d5704fc247be106026d436d27c900f.zip
op-kernel-dev-ea411fd2c8d5704fc247be106026d436d27c900f.tar.gz
drm/sun4i: Make sun4i_crtc_init return ERR_PTR style error codes
sun4i_crtc_init can fail for a number of reasons. Instead of returning a NULL pointer when it fails, pass back the encountered error using ERR_PTR. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'drivers/gpu/drm/sun4i/sun4i_drv.c')
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_drv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
index 46887c3..9adf126 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -125,9 +125,9 @@ static int sun4i_drv_bind(struct device *dev)
/* Create our CRTC */
drv->crtc = sun4i_crtc_init(drm);
- if (!drv->crtc) {
+ if (IS_ERR(drv->crtc)) {
dev_err(drm->dev, "Couldn't create the CRTC\n");
- ret = -EINVAL;
+ ret = PTR_ERR(drv->crtc);
goto cleanup_mode_config;
}
drm->irq_enabled = true;
OpenPOWER on IntegriCloud