diff options
Diffstat (limited to 'drivers/video/atmel_lcdfb.c')
-rw-r--r-- | drivers/video/atmel_lcdfb.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 540909de6247..effdb373b8db 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
@@ -223,8 +223,14 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) | |||
223 | 223 | ||
224 | static void exit_backlight(struct atmel_lcdfb_info *sinfo) | 224 | static void exit_backlight(struct atmel_lcdfb_info *sinfo) |
225 | { | 225 | { |
226 | if (sinfo->backlight) | 226 | if (!sinfo->backlight) |
227 | backlight_device_unregister(sinfo->backlight); | 227 | return; |
228 | |||
229 | if (sinfo->backlight->ops) { | ||
230 | sinfo->backlight->props.power = FB_BLANK_POWERDOWN; | ||
231 | sinfo->backlight->ops->update_status(sinfo->backlight); | ||
232 | } | ||
233 | backlight_device_unregister(sinfo->backlight); | ||
228 | } | 234 | } |
229 | 235 | ||
230 | #else | 236 | #else |
@@ -461,8 +467,11 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, | |||
461 | if (info->fix.smem_len) { | 467 | if (info->fix.smem_len) { |
462 | unsigned int smem_len = (var->xres_virtual * var->yres_virtual | 468 | unsigned int smem_len = (var->xres_virtual * var->yres_virtual |
463 | * ((var->bits_per_pixel + 7) / 8)); | 469 | * ((var->bits_per_pixel + 7) / 8)); |
464 | if (smem_len > info->fix.smem_len) | 470 | if (smem_len > info->fix.smem_len) { |
471 | dev_err(dev, "Frame buffer is too small (%u) for screen size (need at least %u)\n", | ||
472 | info->fix.smem_len, smem_len); | ||
465 | return -EINVAL; | 473 | return -EINVAL; |
474 | } | ||
466 | } | 475 | } |
467 | 476 | ||
468 | /* Saturate vertical and horizontal timings at maximum values */ | 477 | /* Saturate vertical and horizontal timings at maximum values */ |