[PATCH v2] video: imxfb: Do not crash on reboot

Baruch Siach baruch at tkos.co.il
Tue Oct 9 00:42:01 EDT 2012


Hi Fabio,

On Mon, Oct 08, 2012 at 07:23:58PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam at freescale.com>
> 
> Issuing a "reboot" command after the LCD times out causes the following
> warnings:

[snip]

> @@ -513,47 +514,53 @@ static void imxfb_exit_backlight(struct imxfb_info 
> *fbi)
>  
>  static void imxfb_enable_controller(struct imxfb_info *fbi)
>  {
> -	pr_debug("Enabling LCD controller\n");
> +	if (!fbi->enabled) {
> +		pr_debug("Enabling LCD controller\n");

Won't it be simpler to just do:

    if (fbi->enabled)
        return;

instead of adding another nesting level to the whole routine?

>  static void imxfb_disable_controller(struct imxfb_info *fbi)
>  {
> -	pr_debug("Disabling LCD controller\n");
> +	if (fbi->enabled) {
> +		pr_debug("Disabling LCD controller\n");

ditto (with inverted logic).

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -



More information about the linux-arm-kernel mailing list