Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit baf16374 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Paul Mundt
Browse files

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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 44432407
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -964,7 +964,7 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb,
	struct fb_var_screeninfo *var;
	struct fb_var_screeninfo *var;


	if (&ch->lcdc->notifier != nb)
	if (&ch->lcdc->notifier != nb)
		return 0;
		return NOTIFY_DONE;


	dev_dbg(info->dev, "%s(): action = %lu, data = %p\n",
	dev_dbg(info->dev, "%s(): action = %lu, data = %p\n",
		__func__, action, event->data);
		__func__, action, event->data);
@@ -991,23 +991,25 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb,
			/* Can we handle this display? */
			/* Can we handle this display? */
			if (var->xres > ch->cfg.lcd_cfg[0].xres ||
			if (var->xres > ch->cfg.lcd_cfg[0].xres ||
			    var->yres > ch->cfg.lcd_cfg[0].yres)
			    var->yres > ch->cfg.lcd_cfg[0].yres)
				return -ENOMEM;
				/*
				 * LCDC resume failed, no need to continue with
				 * the notifier chain
				 */
				return notifier_from_errno(-ENOMEM);


			/* Add to the modelist */
			/* Add to the modelist */
			fb_var_to_videomode(&mode, var);
			fb_var_to_videomode(&mode, var);
			ret = fb_add_videomode(&mode, &ch->info->modelist);
			ret = fb_add_videomode(&mode, &ch->info->modelist);
			if (ret < 0)
			if (ret < 0)
				return ret;
				return notifier_from_errno(ret);
		}
		}


		pm_runtime_get_sync(info->device);
		pm_runtime_get_sync(info->device);


		sh_mobile_lcdc_geometry(ch);
		sh_mobile_lcdc_geometry(ch);

		break;
	}
	}


	return 0;
	return NOTIFY_OK;
}
}


static int sh_mobile_lcdc_remove(struct platform_device *pdev);
static int sh_mobile_lcdc_remove(struct platform_device *pdev);