[-next] drm: mxsfb: fix error return code in mxsfb_load()
diff mbox

Message ID 20170205160036.7364-1-weiyj.lk@gmail.com
State New
Headers show

Commit Message

Wei Yongjun Feb. 5, 2017, 4 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/gpu/drm/mxsfb/mxsfb_drv.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gustavo Padovan Feb. 6, 2017, 11:48 a.m. UTC | #1
Hi Wei,

2017-02-05 Wei Yongjun <weiyj.lk@gmail.com>:

> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/gpu/drm/mxsfb/mxsfb_drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index cdfbe02..28a75cb 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -221,6 +221,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
>  	mxsfb->fbdev = drm_fbdev_cma_init(drm, 32,
>  					  drm->mode_config.num_connector);
>  	if (IS_ERR(mxsfb->fbdev)) {
> +		ret = PTR_ERR(mxsfb->fbdev);
>  		mxsfb->fbdev = NULL;
>  		dev_err(drm->dev, "Failed to init FB CMA area\n");
>  		goto err_cma;

Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.com>

Gustavo
Marek Vasut Feb. 6, 2017, 6:53 p.m. UTC | #2
On 02/05/2017 05:00 PM, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Marek Vasut <marex@denx.de>

> ---
>  drivers/gpu/drm/mxsfb/mxsfb_drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index cdfbe02..28a75cb 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -221,6 +221,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags)
>  	mxsfb->fbdev = drm_fbdev_cma_init(drm, 32,
>  					  drm->mode_config.num_connector);
>  	if (IS_ERR(mxsfb->fbdev)) {
> +		ret = PTR_ERR(mxsfb->fbdev);
>  		mxsfb->fbdev = NULL;
>  		dev_err(drm->dev, "Failed to init FB CMA area\n");
>  		goto err_cma;
> 
> 
>

Patch
diff mbox

diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index cdfbe02..28a75cb 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -221,6 +221,7 @@  static int mxsfb_load(struct drm_device *drm, unsigned long flags)
 	mxsfb->fbdev = drm_fbdev_cma_init(drm, 32,
 					  drm->mode_config.num_connector);
 	if (IS_ERR(mxsfb->fbdev)) {
+		ret = PTR_ERR(mxsfb->fbdev);
 		mxsfb->fbdev = NULL;
 		dev_err(drm->dev, "Failed to init FB CMA area\n");
 		goto err_cma;