@@ -167,8 +167,6 @@ komeda_fb_create(struct drm_device *dev, struct drm_file *file,
ret = komeda_fb_afbc_size_check(kfb, info, objs, file,
mode_cmd);
- for (i = 0; i < info->num_planes; ++i)
- kfb->base.obj[i] = objs[i];
} else {
ret = komeda_fb_check_src_coords(kfb, 0, 0, kfb->base.width,
kfb->base.height);
@@ -177,8 +175,6 @@ komeda_fb_create(struct drm_device *dev, struct drm_file *file,
ret = komeda_fb_none_afbc_size_check(mdev, info, objs,
file, mode_cmd);
- for (i = 0; i < info->num_planes; ++i)
- kfb->base.obj[i] = objs[i];
}
if (ret < 0)
goto err_cleanup;
@@ -190,6 +186,9 @@ komeda_fb_create(struct drm_device *dev, struct drm_file *file,
goto err_cleanup;
}
+ for (i = 0; i < info->num_planes; ++i)
+ kfb->base.obj[i] = objs[i];
+
ret = drm_framebuffer_init(dev, &kfb->base, &komeda_fb_funcs);
if (ret < 0) {
DRM_DEBUG_KMS("failed to initialize fb\n");
The assignments are the same in both branches of the "if" statement and nothing depends on them between their original position and the new position, so this can be safely done. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> --- drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)