Commit 104f456c authored by Mike Rapoport's avatar Mike Rapoport Committed by Greg Kroah-Hartman

staging: sm750fb: remove unneeded switch statement

The lynxfb_ops_check_var function has two switch statements, the first
one checks for validity of var->bits_per_pixel and it is is immediatly
followed by another one that sets parameters according to
var->bits_per_pixel value. These switch statements can be merged into
one.
Signed-off-by: default avatarMike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2d893537
...@@ -537,18 +537,6 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var, ...@@ -537,18 +537,6 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
var->yres, var->yres,
var->bits_per_pixel); var->bits_per_pixel);
switch (var->bits_per_pixel) {
case 8:
case 16:
case 24: /* support 24 bpp for only lynx712/722/720 */
case 32:
break;
default:
pr_err("bpp %d not supported\n", var->bits_per_pixel);
ret = -EINVAL;
goto exit;
}
switch (var->bits_per_pixel) { switch (var->bits_per_pixel) {
case 8: case 8:
info->fix.visual = FB_VISUAL_PSEUDOCOLOR; info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
...@@ -583,8 +571,8 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var, ...@@ -583,8 +571,8 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
info->fix.visual = FB_VISUAL_TRUECOLOR; info->fix.visual = FB_VISUAL_TRUECOLOR;
break; break;
default: default:
ret = -EINVAL; pr_err("bpp %d not supported\n", var->bits_per_pixel);
break; return -EINVAL;
} }
var->height = var->width = -1; var->height = var->width = -1;
var->accel_flags = 0;/* FB_ACCELF_TEXT; */ var->accel_flags = 0;/* FB_ACCELF_TEXT; */
...@@ -603,7 +591,6 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var, ...@@ -603,7 +591,6 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
ret = output->proc_checkMode(output, var); ret = output->proc_checkMode(output, var);
if (!ret) if (!ret)
ret = crtc->proc_checkMode(crtc, var); ret = crtc->proc_checkMode(crtc, var);
exit:
return ret; return ret;
} }
......
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