diff mbox

drm/rockchip: inno_hdmi: fix an error code

Message ID 20160225213029.GA18267@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Feb. 25, 2016, 9:30 p.m. UTC
We were accidentally returning PTR_ERR(NULL) which means success when we
wanted to return a negative error code.

Fixes: 412d4ae6b7a5 ('drm/rockchip: hdmi: add Innosilicon HDMI support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Yakir Yang Feb. 26, 2016, 6:26 a.m. UTC | #1
Dan,

On 02/26/2016 05:30 AM, Dan Carpenter wrote:
> We were accidentally returning PTR_ERR(NULL) which means success when we
> wanted to return a negative error code.
>
> Fixes: 412d4ae6b7a5 ('drm/rockchip: hdmi: add Innosilicon HDMI support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Yakir Yang <ykk@rock-chips.com>

Thanks,
- Yakir
> diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
> index 10d62ff..f252441 100644
> --- a/drivers/gpu/drm/rockchip/inno_hdmi.c
> +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
> @@ -855,8 +855,9 @@ static int inno_hdmi_bind(struct device *dev, struct device *master,
>   
>   	hdmi->ddc = inno_hdmi_i2c_adapter(hdmi);
>   	if (IS_ERR(hdmi->ddc)) {
> +		ret = PTR_ERR(hdmi->ddc);
>   		hdmi->ddc = NULL;
> -		return PTR_ERR(hdmi->ddc);
> +		return ret;
>   	}
>   
>   	/*
>
>
>
Dan Carpenter April 21, 2016, 2:03 p.m. UTC | #2
On Fri, Feb 26, 2016 at 02:26:23PM +0800, Yakir Yang wrote:
> Dan,
> 
> On 02/26/2016 05:30 AM, Dan Carpenter wrote:
> >We were accidentally returning PTR_ERR(NULL) which means success when we
> >wanted to return a negative error code.
> >
> >Fixes: 412d4ae6b7a5 ('drm/rockchip: hdmi: add Innosilicon HDMI support')
> >Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Reviewed-by: Yakir Yang <ykk@rock-chips.com>

We still need to apply this.

regards,
dan carpenter
yao mark April 22, 2016, 12:41 a.m. UTC | #3
On 2016?04?21? 22:03, Dan Carpenter wrote:
> On Fri, Feb 26, 2016 at 02:26:23PM +0800, Yakir Yang wrote:
>> Dan,
>>
>> On 02/26/2016 05:30 AM, Dan Carpenter wrote:
>>> We were accidentally returning PTR_ERR(NULL) which means success when we
>>> wanted to return a negative error code.
>>>
>>> Fixes: 412d4ae6b7a5 ('drm/rockchip: hdmi: add Innosilicon HDMI support')
>>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>> Reviewed-by: Yakir Yang <ykk@rock-chips.com>
> We still need to apply this.
>
> regards,
> dan carpenter
>
>
>
>
Oh, Sorry, Miss this patch.

Applied to my drm-fixes.

Thanks.
diff mbox

Patch

diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
index 10d62ff..f252441 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -855,8 +855,9 @@  static int inno_hdmi_bind(struct device *dev, struct device *master,
 
 	hdmi->ddc = inno_hdmi_i2c_adapter(hdmi);
 	if (IS_ERR(hdmi->ddc)) {
+		ret = PTR_ERR(hdmi->ddc);
 		hdmi->ddc = NULL;
-		return PTR_ERR(hdmi->ddc);
+		return ret;
 	}
 
 	/*