diff options
author | Timur Tabi <timur@freescale.com> | 2011-12-19 16:26:14 -0600 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-01-03 15:59:08 +0000 |
commit | f934fbd6ba5af5d9328e642794be2842e538d1c6 (patch) | |
tree | 589d2df6944cd1f347f01190cbb10c69656b7f29 /drivers/video | |
parent | 56bba8cb4218b2646a1d80c100bad689f93fef79 (diff) |
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: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fsl-diu-fb.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index 408272c7fb5..411a7b306b4 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c @@ -1220,21 +1220,6 @@ static struct fb_ops fsl_diu_ops = { .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) { int rc; @@ -1244,8 +1229,14 @@ static int __devinit install_fb(struct fb_info *info) unsigned int dbsize = ARRAY_SIZE(fsl_diu_mode_db); int has_default_mode = 1; - if (init_fbinfo(info)) - return -EINVAL; + info->var.activate = FB_ACTIVATE_NOW; + 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->edid_data) { |