diff mbox series

[01/20] drm/fb-helper: Improve error reporting in setup

Message ID 20180908134648.2582-2-noralf@tronnes.org (mailing list archive)
State New, archived
Headers show
Series drm/cma-helper drivers: Use drm_fbdev_generic_setup() | expand

Commit Message

Noralf Trønnes Sept. 8, 2018, 1:46 p.m. UTC
Improve error reporting in drm_fb_helper_fbdev_setup() by printing the
error code. This is useful for drivers that choose to not fall over just
because fbdev doesen't work, but still wants clues to why it failed.
This way they don't have to provide an error message themselves.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 drivers/gpu/drm/drm_fb_helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Noralf Trønnes Sept. 25, 2018, 9:46 a.m. UTC | #1
Den 08.09.2018 15.46, skrev Noralf Trønnes:
> Improve error reporting in drm_fb_helper_fbdev_setup() by printing the
> error code. This is useful for drivers that choose to not fall over just
> because fbdev doesen't work, but still wants clues to why it failed.
> This way they don't have to provide an error message themselves.
>
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> ---
>   drivers/gpu/drm/drm_fb_helper.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)

Applied to drm-misc-next with Sam's ack, thanks.

Noralf.

> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 4b0dd20bccb8..2f865a046f6d 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -2842,7 +2842,7 @@ int drm_fb_helper_fbdev_setup(struct drm_device *dev,
>   	if (!max_conn_count)
>   		max_conn_count = dev->mode_config.num_connector;
>   	if (!max_conn_count) {
> -		DRM_DEV_ERROR(dev->dev, "No connectors\n");
> +		DRM_DEV_ERROR(dev->dev, "fbdev: No connectors\n");
>   		return -EINVAL;
>   	}
>   
> @@ -2850,13 +2850,13 @@ int drm_fb_helper_fbdev_setup(struct drm_device *dev,
>   
>   	ret = drm_fb_helper_init(dev, fb_helper, max_conn_count);
>   	if (ret < 0) {
> -		DRM_DEV_ERROR(dev->dev, "Failed to initialize fbdev helper\n");
> +		DRM_DEV_ERROR(dev->dev, "fbdev: Failed to initialize (ret=%d)\n", ret);
>   		return ret;
>   	}
>   
>   	ret = drm_fb_helper_single_add_all_connectors(fb_helper);
>   	if (ret < 0) {
> -		DRM_DEV_ERROR(dev->dev, "Failed to add connectors\n");
> +		DRM_DEV_ERROR(dev->dev, "fbdev: Failed to add connectors (ret=%d)\n", ret);
>   		goto err_drm_fb_helper_fini;
>   	}
>   
> @@ -2865,7 +2865,7 @@ int drm_fb_helper_fbdev_setup(struct drm_device *dev,
>   
>   	ret = drm_fb_helper_initial_config(fb_helper, preferred_bpp);
>   	if (ret < 0) {
> -		DRM_DEV_ERROR(dev->dev, "Failed to set fbdev configuration\n");
> +		DRM_DEV_ERROR(dev->dev, "fbdev: Failed to set configuration (ret=%d)\n", ret);
>   		goto err_drm_fb_helper_fini;
>   	}
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 4b0dd20bccb8..2f865a046f6d 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -2842,7 +2842,7 @@  int drm_fb_helper_fbdev_setup(struct drm_device *dev,
 	if (!max_conn_count)
 		max_conn_count = dev->mode_config.num_connector;
 	if (!max_conn_count) {
-		DRM_DEV_ERROR(dev->dev, "No connectors\n");
+		DRM_DEV_ERROR(dev->dev, "fbdev: No connectors\n");
 		return -EINVAL;
 	}
 
@@ -2850,13 +2850,13 @@  int drm_fb_helper_fbdev_setup(struct drm_device *dev,
 
 	ret = drm_fb_helper_init(dev, fb_helper, max_conn_count);
 	if (ret < 0) {
-		DRM_DEV_ERROR(dev->dev, "Failed to initialize fbdev helper\n");
+		DRM_DEV_ERROR(dev->dev, "fbdev: Failed to initialize (ret=%d)\n", ret);
 		return ret;
 	}
 
 	ret = drm_fb_helper_single_add_all_connectors(fb_helper);
 	if (ret < 0) {
-		DRM_DEV_ERROR(dev->dev, "Failed to add connectors\n");
+		DRM_DEV_ERROR(dev->dev, "fbdev: Failed to add connectors (ret=%d)\n", ret);
 		goto err_drm_fb_helper_fini;
 	}
 
@@ -2865,7 +2865,7 @@  int drm_fb_helper_fbdev_setup(struct drm_device *dev,
 
 	ret = drm_fb_helper_initial_config(fb_helper, preferred_bpp);
 	if (ret < 0) {
-		DRM_DEV_ERROR(dev->dev, "Failed to set fbdev configuration\n");
+		DRM_DEV_ERROR(dev->dev, "fbdev: Failed to set configuration (ret=%d)\n", ret);
 		goto err_drm_fb_helper_fini;
 	}