summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_fb_helper.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2016-02-15 13:45:16 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-02-15 14:56:46 +0100
commit15fce29da39150cc08980299ed3700a07a1cb0a6 (patch)
tree6cfa46efb203513eea31920c2e50757429a09161 /drivers/gpu/drm/drm_fb_helper.c
parent383b2e57115a882a679b9defb6c34429667926d5 (diff)
downloadblackbird-obmc-linux-15fce29da39150cc08980299ed3700a07a1cb0a6.tar.gz
blackbird-obmc-linux-15fce29da39150cc08980299ed3700a07a1cb0a6.zip
drm/fb_helper: Use add_one_connector in add_all_connectors.
add_all_connectors doesn't checks whether reallocation is needed, but add_one does. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1455540316-17066-2-git-send-email-maarten.lankhorst@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_fb_helper.c')
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 0893b82ce588..855108e6e1bd 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -104,21 +104,17 @@ int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper)
{
struct drm_device *dev = fb_helper->dev;
struct drm_connector *connector;
- int i;
+ int i, ret;
if (!drm_fbdev_emulation)
return 0;
mutex_lock(&dev->mode_config.mutex);
drm_for_each_connector(connector, dev) {
- struct drm_fb_helper_connector *fb_helper_connector;
+ ret = drm_fb_helper_add_one_connector(fb_helper, connector);
- fb_helper_connector = kzalloc(sizeof(struct drm_fb_helper_connector), GFP_KERNEL);
- if (!fb_helper_connector)
+ if (ret)
goto fail;
-
- fb_helper_connector->connector = connector;
- fb_helper->connector_info[fb_helper->connector_count++] = fb_helper_connector;
}
mutex_unlock(&dev->mode_config.mutex);
return 0;
@@ -130,7 +126,7 @@ fail:
fb_helper->connector_count = 0;
mutex_unlock(&dev->mode_config.mutex);
- return -ENOMEM;
+ return ret;
}
EXPORT_SYMBOL(drm_fb_helper_single_add_all_connectors);
OpenPOWER on IntegriCloud