diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c index 92b02891704d..26b4ec56fd30 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon.c +++ b/drivers/staging/olpc_dcon/olpc_dcon.c @@ -255,17 +255,19 @@ static bool dcon_blank_fb(struct dcon_priv *dcon, bool blank) { int err; + console_lock(); if (!lock_fb_info(dcon->fbinfo)) { + console_unlock(); dev_err(&dcon->client->dev, "unable to lock framebuffer\n"); return false; } - console_lock(); + dcon->ignore_fb_events = true; err = fb_blank(dcon->fbinfo, blank ? FB_BLANK_POWERDOWN : FB_BLANK_UNBLANK); dcon->ignore_fb_events = false; - console_unlock(); unlock_fb_info(dcon->fbinfo); + console_unlock(); if (err) { dev_err(&dcon->client->dev, "couldn't %sblank framebuffer\n",