Commit f3651bc0 authored by Laurent Pinchart's avatar Laurent Pinchart
Browse files

drm: rcar-du: Use dev_err_probe() to record cause of KMS init errors



The (large) rcar_du_modeset_init() function can fail for many reasons,
two of two involving probe deferral. Use dev_err_probe() in those code
paths to record the cause of the probe deferral, in order to help
debugging probe issues.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: default avatarKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
parent c58dcab0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -696,6 +696,10 @@ static int rcar_du_probe(struct platform_device *pdev)
	/* DRM/KMS objects */
	ret = rcar_du_modeset_init(rcdu);
	if (ret < 0) {
		/*
		 * Don't use dev_err_probe(), as it would overwrite the probe
		 * deferral reason recorded in rcar_du_modeset_init().
		 */
		if (ret != -EPROBE_DEFER)
			dev_err(&pdev->dev,
				"failed to initialize DRM/KMS (%d)\n", ret);
+4 −2
Original line number Diff line number Diff line
@@ -935,7 +935,8 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
	/* Initialize the Color Management Modules. */
	ret = rcar_du_cmm_init(rcdu);
	if (ret)
		return ret;
		return dev_err_probe(rcdu->dev, ret,
				     "failed to initialize CMM\n");

	/* Create the CRTCs. */
	for (swindex = 0, hwindex = 0; swindex < rcdu->num_crtcs; ++hwindex) {
@@ -955,7 +956,8 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
	/* Initialize the encoders. */
	ret = rcar_du_encoders_init(rcdu);
	if (ret < 0)
		return ret;
		return dev_err_probe(rcdu->dev, ret,
				     "failed to initialize encoders\n");

	if (ret == 0) {
		dev_err(rcdu->dev, "error: no encoder could be initialized\n");