2020-11-12 13:25:35

by Xiongfeng Wang

[permalink] [raw]
Subject: [PATCH] drm/sun4i: dw-hdmi: fix error return code in sun8i_dw_hdmi_bind()

Fix to return a negative error code from the error handling case instead
of 0 in function sun8i_dw_hdmi_bind().

Fixes: b7c7436a5ff0 ("drm/sun4i: Implement A83T HDMI driver")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Xiongfeng Wang <[email protected]>
---
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
index d4c0804..f010fe8 100644
--- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
+++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
@@ -208,6 +208,7 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
phy_node = of_parse_phandle(dev->of_node, "phys", 0);
if (!phy_node) {
dev_err(dev, "Can't found PHY phandle\n");
+ ret = -ENODEV;
goto err_disable_clk_tmds;
}

--
1.7.12.4


2020-11-13 18:03:48

by Jernej Skrabec

[permalink] [raw]
Subject: Re: [PATCH] drm/sun4i: dw-hdmi: fix error return code in sun8i_dw_hdmi_bind()

Hi!

Thanks for the patch.

Dne četrtek, 12. november 2020 ob 14:14:51 CET je Xiongfeng Wang napisal(a):
> Fix to return a negative error code from the error handling case instead
> of 0 in function sun8i_dw_hdmi_bind().
>
> Fixes: b7c7436a5ff0 ("drm/sun4i: Implement A83T HDMI driver")
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Xiongfeng Wang <[email protected]>
> ---
> drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
> b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c index d4c0804..f010fe8 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
> @@ -208,6 +208,7 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct
> device *master, phy_node = of_parse_phandle(dev->of_node, "phys", 0);
> if (!phy_node) {
> dev_err(dev, "Can't found PHY phandle\n");
> + ret = -ENODEV;

That should be EINVAL because DT node doesn't have mandatory property.

With that fixed, you can add:
Reviewed-by: Jernej Skrabec <[email protected]>

Best regards,
Jernej

> goto err_disable_clk_tmds;
> }




2020-11-16 03:08:00

by Xiongfeng Wang

[permalink] [raw]
Subject: Re: [PATCH] drm/sun4i: dw-hdmi: fix error return code in sun8i_dw_hdmi_bind()

Hi!

On 2020/11/14 2:01, Jernej Škrabec wrote:
> Hi!
>
> Thanks for the patch.
>
> Dne četrtek, 12. november 2020 ob 14:14:51 CET je Xiongfeng Wang napisal(a):
>> Fix to return a negative error code from the error handling case instead
>> of 0 in function sun8i_dw_hdmi_bind().
>>
>> Fixes: b7c7436a5ff0 ("drm/sun4i: Implement A83T HDMI driver")
>> Reported-by: Hulk Robot <[email protected]>
>> Signed-off-by: Xiongfeng Wang <[email protected]>
>> ---
>> drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
>> b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c index d4c0804..f010fe8 100644
>> --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
>> +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
>> @@ -208,6 +208,7 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct
>> device *master, phy_node = of_parse_phandle(dev->of_node, "phys", 0);
>> if (!phy_node) {
>> dev_err(dev, "Can't found PHY phandle\n");
>> + ret = -ENODEV;
>
> That should be EINVAL because DT node doesn't have mandatory property.
>
> With that fixed, you can add:
> Reviewed-by: Jernej Skrabec <[email protected]>

Thanks for your review! I will fix it in the next version.

Thanks,
Xiongfeng

>
> Best regards,
> Jernej
>
>> goto err_disable_clk_tmds;
>> }
>
>
>
>
> .
>