diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2023-05-30 12:19:58 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2023-08-14 13:47:29 +0300 |
commit | f3651bc0b7fc4361a351fd01d99ba739f67769e4 (patch) | |
tree | 0c0b3bca08ac8a2f8295bfe1e5889d8ee1c445d3 /drivers/gpu/drm | |
parent | c58dcab081b270c8b56d10de72b859728d237dd1 (diff) | |
download | linux-f3651bc0b7fc4361a351fd01d99ba739f67769e4.tar.xz |
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: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c index ec3cf233d6ae..dee530e4c8b2 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c @@ -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); diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c index 9ff4537c26c8..70d8ad065bfa 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c @@ -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"); |