diff options
author | Thierry Reding <treding@nvidia.com> | 2014-12-19 05:21:32 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-01-21 08:57:03 -0500 |
commit | 01934c2a691882185b3021d437df13bcba07711d (patch) | |
tree | 6e891d192b0e4bd35b4f00ee013ea9763d5dc48d /drivers/gpu/drm/gma500 | |
parent | 7119ad5f6b0ce222072b0c0b31c3b4ac87660afa (diff) |
drm/fb-helper: Propagate errors from initial config failure
Make drm_fb_helper_initial_config() return an int rather than a bool so
that the error can be properly propagated. While at it, update drivers
to propagate errors further rather than just ignore them.
v2:
- cirrus: No cleanup is required, the top-level cirrus_driver_load()
will do it as part of cirrus_driver_unload() in its cleanup path.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
[danvet: Squash in simplification patch from kbuild.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/gma500')
-rw-r--r-- | drivers/gpu/drm/gma500/framebuffer.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index ddd90ddbc200..2d42ce6d3757 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c | |||
@@ -593,6 +593,7 @@ int psb_fbdev_init(struct drm_device *dev) | |||
593 | { | 593 | { |
594 | struct psb_fbdev *fbdev; | 594 | struct psb_fbdev *fbdev; |
595 | struct drm_psb_private *dev_priv = dev->dev_private; | 595 | struct drm_psb_private *dev_priv = dev->dev_private; |
596 | int ret; | ||
596 | 597 | ||
597 | fbdev = kzalloc(sizeof(struct psb_fbdev), GFP_KERNEL); | 598 | fbdev = kzalloc(sizeof(struct psb_fbdev), GFP_KERNEL); |
598 | if (!fbdev) { | 599 | if (!fbdev) { |
@@ -604,16 +605,29 @@ int psb_fbdev_init(struct drm_device *dev) | |||
604 | 605 | ||
605 | drm_fb_helper_prepare(dev, &fbdev->psb_fb_helper, &psb_fb_helper_funcs); | 606 | drm_fb_helper_prepare(dev, &fbdev->psb_fb_helper, &psb_fb_helper_funcs); |
606 | 607 | ||
607 | drm_fb_helper_init(dev, &fbdev->psb_fb_helper, dev_priv->ops->crtcs, | 608 | ret = drm_fb_helper_init(dev, &fbdev->psb_fb_helper, |
608 | INTELFB_CONN_LIMIT); | 609 | dev_priv->ops->crtcs, INTELFB_CONN_LIMIT); |
610 | if (ret) | ||
611 | goto free; | ||
609 | 612 | ||
610 | drm_fb_helper_single_add_all_connectors(&fbdev->psb_fb_helper); | 613 | ret = drm_fb_helper_single_add_all_connectors(&fbdev->psb_fb_helper); |
614 | if (ret) | ||
615 | goto fini; | ||
611 | 616 | ||
612 | /* disable all the possible outputs/crtcs before entering KMS mode */ | 617 | /* disable all the possible outputs/crtcs before entering KMS mode */ |
613 | drm_helper_disable_unused_functions(dev); | 618 | drm_helper_disable_unused_functions(dev); |
614 | 619 | ||
615 | drm_fb_helper_initial_config(&fbdev->psb_fb_helper, 32); | 620 | ret = drm_fb_helper_initial_config(&fbdev->psb_fb_helper, 32); |
621 | if (ret) | ||
622 | goto fini; | ||
623 | |||
616 | return 0; | 624 | return 0; |
625 | |||
626 | fini: | ||
627 | drm_fb_helper_fini(&fbdev->psb_fb_helper); | ||
628 | free: | ||
629 | kfree(fbdev); | ||
630 | return ret; | ||
617 | } | 631 | } |
618 | 632 | ||
619 | static void psb_fbdev_fini(struct drm_device *dev) | 633 | static void psb_fbdev_fini(struct drm_device *dev) |