diff options
author | Mike Rapoport <mike.rapoport@gmail.com> | 2015-10-01 12:14:02 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-02 12:50:52 +0300 |
commit | 104f456ce1301fa49f7dffc129c0bce420da07df (patch) | |
tree | 673e5ec3e798cf7099e0576a4c332e6f4876e6e1 /drivers/staging/sm750fb/sm750.c | |
parent | 2d893537569948120332184bbea29c743f9951d9 (diff) | |
download | linux-104f456ce1301fa49f7dffc129c0bce420da07df.tar.xz |
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: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sm750fb/sm750.c')
-rw-r--r-- | drivers/staging/sm750fb/sm750.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 81fe3c3266d5..4d261d561053 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -539,18 +539,6 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var, 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) { - case 8: info->fix.visual = FB_VISUAL_PSEUDOCOLOR; var->red.offset = 0; var->red.length = 8; @@ -583,8 +571,8 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var, info->fix.visual = FB_VISUAL_TRUECOLOR; break; default: - ret = -EINVAL; - break; + pr_err("bpp %d not supported\n", var->bits_per_pixel); + return -EINVAL; } var->height = var->width = -1; var->accel_flags = 0;/* FB_ACCELF_TEXT; */ @@ -603,7 +591,6 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var, ret = output->proc_checkMode(output, var); if (!ret) ret = crtc->proc_checkMode(crtc, var); -exit: return ret; } |