Commit f934fbd6 authored by Timur Tabi's avatar Timur Tabi Committed by Florian Tobias Schandinat

drivers/video: fsl-diu-fb: merge init_fbinfo() into install_fb()

Function init_fbinfo() is called only from install_fb(), and it's only a few
lines long.  Plus, it ignores the return code from fb_alloc_cmap().  Merge
its contents into install_fb() and handle errors properly.
Signed-off-by: default avatarTimur Tabi <timur@freescale.com>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent 56bba8cb
...@@ -1220,21 +1220,6 @@ static struct fb_ops fsl_diu_ops = { ...@@ -1220,21 +1220,6 @@ static struct fb_ops fsl_diu_ops = {
.fb_release = fsl_diu_release, .fb_release = fsl_diu_release,
}; };
static int init_fbinfo(struct fb_info *info)
{
struct mfb_info *mfbi = info->par;
info->device = NULL;
info->var.activate = FB_ACTIVATE_NOW;
info->fbops = &fsl_diu_ops;
info->flags = FBINFO_FLAG_DEFAULT;
info->pseudo_palette = &mfbi->pseudo_palette;
/* Allocate colormap */
fb_alloc_cmap(&info->cmap, 16, 0);
return 0;
}
static int __devinit install_fb(struct fb_info *info) static int __devinit install_fb(struct fb_info *info)
{ {
int rc; int rc;
...@@ -1244,8 +1229,14 @@ static int __devinit install_fb(struct fb_info *info) ...@@ -1244,8 +1229,14 @@ static int __devinit install_fb(struct fb_info *info)
unsigned int dbsize = ARRAY_SIZE(fsl_diu_mode_db); unsigned int dbsize = ARRAY_SIZE(fsl_diu_mode_db);
int has_default_mode = 1; int has_default_mode = 1;
if (init_fbinfo(info)) info->var.activate = FB_ACTIVATE_NOW;
return -EINVAL; info->fbops = &fsl_diu_ops;
info->flags = FBINFO_DEFAULT;
info->pseudo_palette = mfbi->pseudo_palette;
rc = fb_alloc_cmap(&info->cmap, 16, 0);
if (rc)
return rc;
if (mfbi->index == PLANE0) { if (mfbi->index == PLANE0) {
if (mfbi->edid_data) { if (mfbi->edid_data) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment