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

From: Baruch Siach
Date: Tue Oct 09 2012 - 00:52:08 EST


Hi Fabio,

On Mon, Oct 08, 2012 at 07:23:58PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
>
> 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@xxxxxxxxxx - tel: +972.2.679.5364, http://www.tkos.co.il -
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/