diff options
author | Timur Tabi <timur@freescale.com> | 2011-12-19 17:26:14 -0500 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-01-03 10:59:08 -0500 |
commit | f934fbd6ba5af5d9328e642794be2842e538d1c6 (patch) | |
tree | 589d2df6944cd1f347f01190cbb10c69656b7f29 /drivers/video/fsl-diu-fb.c | |
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/fsl-diu-fb.c')
-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 408272c7fb52..411a7b306b4a 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 = { | |||
1220 | .fb_release = fsl_diu_release, | 1220 | .fb_release = fsl_diu_release, |
1221 | }; | 1221 | }; |
1222 | 1222 | ||
1223 | static int init_fbinfo(struct fb_info *info) | ||
1224 | { | ||
1225 | struct mfb_info *mfbi = info->par; | ||
1226 | |||
1227 | info->device = NULL; | ||
1228 | info->var.activate = FB_ACTIVATE_NOW; | ||
1229 | info->fbops = &fsl_diu_ops; | ||
1230 | info->flags = FBINFO_FLAG_DEFAULT; | ||
1231 | info->pseudo_palette = &mfbi->pseudo_palette; | ||
1232 | |||
1233 | /* Allocate colormap */ | ||
1234 | fb_alloc_cmap(&info->cmap, 16, 0); | ||
1235 | return 0; | ||
1236 | } | ||
1237 | |||
1238 | static int __devinit install_fb(struct fb_info *info) | 1223 | static int __devinit install_fb(struct fb_info *info) |
1239 | { | 1224 | { |
1240 | int rc; | 1225 | int rc; |
@@ -1244,8 +1229,14 @@ static int __devinit install_fb(struct fb_info *info) | |||
1244 | unsigned int dbsize = ARRAY_SIZE(fsl_diu_mode_db); | 1229 | unsigned int dbsize = ARRAY_SIZE(fsl_diu_mode_db); |
1245 | int has_default_mode = 1; | 1230 | int has_default_mode = 1; |
1246 | 1231 | ||
1247 | if (init_fbinfo(info)) | 1232 | info->var.activate = FB_ACTIVATE_NOW; |
1248 | return -EINVAL; | 1233 | info->fbops = &fsl_diu_ops; |
1234 | info->flags = FBINFO_DEFAULT; | ||
1235 | info->pseudo_palette = mfbi->pseudo_palette; | ||
1236 | |||
1237 | rc = fb_alloc_cmap(&info->cmap, 16, 0); | ||
1238 | if (rc) | ||
1239 | return rc; | ||
1249 | 1240 | ||
1250 | if (mfbi->index == PLANE0) { | 1241 | if (mfbi->index == PLANE0) { |
1251 | if (mfbi->edid_data) { | 1242 | if (mfbi->edid_data) { |