aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-09-03 03:20:08 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-09-14 04:22:46 -0400
commitbaf163749952ca5e33dd2d6a74da023e385c3a00 (patch)
treec2aa5542de0861046c3bda8efd8c5d9c696a0cc2 /drivers/video
parent44432407d9f5e4b2e56c7eccb65d98cad4bba191 (diff)
fbdev: sh_mobile_lcdcfb: fix notifier callback return codes
Notifier callbacks have to return either one of NOTIFY_* codes or a negative errno, converted to a suitable value by the notifier_from_errno() inline, if the notifier chain shall not be continued. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index ce3ed4bc991f..2f6e37ea7906 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -964,7 +964,7 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb,
964 struct fb_var_screeninfo *var; 964 struct fb_var_screeninfo *var;
965 965
966 if (&ch->lcdc->notifier != nb) 966 if (&ch->lcdc->notifier != nb)
967 return 0; 967 return NOTIFY_DONE;
968 968
969 dev_dbg(info->dev, "%s(): action = %lu, data = %p\n", 969 dev_dbg(info->dev, "%s(): action = %lu, data = %p\n",
970 __func__, action, event->data); 970 __func__, action, event->data);
@@ -991,23 +991,25 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb,
991 /* Can we handle this display? */ 991 /* Can we handle this display? */
992 if (var->xres > ch->cfg.lcd_cfg[0].xres || 992 if (var->xres > ch->cfg.lcd_cfg[0].xres ||
993 var->yres > ch->cfg.lcd_cfg[0].yres) 993 var->yres > ch->cfg.lcd_cfg[0].yres)
994 return -ENOMEM; 994 /*
995 * LCDC resume failed, no need to continue with
996 * the notifier chain
997 */
998 return notifier_from_errno(-ENOMEM);
995 999
996 /* Add to the modelist */ 1000 /* Add to the modelist */
997 fb_var_to_videomode(&mode, var); 1001 fb_var_to_videomode(&mode, var);
998 ret = fb_add_videomode(&mode, &ch->info->modelist); 1002 ret = fb_add_videomode(&mode, &ch->info->modelist);
999 if (ret < 0) 1003 if (ret < 0)
1000 return ret; 1004 return notifier_from_errno(ret);
1001 } 1005 }
1002 1006
1003 pm_runtime_get_sync(info->device); 1007 pm_runtime_get_sync(info->device);
1004 1008
1005 sh_mobile_lcdc_geometry(ch); 1009 sh_mobile_lcdc_geometry(ch);
1006
1007 break;
1008 } 1010 }
1009 1011
1010 return 0; 1012 return NOTIFY_OK;
1011} 1013}
1012 1014
1013static int sh_mobile_lcdc_remove(struct platform_device *pdev); 1015static int sh_mobile_lcdc_remove(struct platform_device *pdev);