diff mbox

[2/2] drm/exynos: dp: fix wrong return type

Message ID 1448542040-22057-3-git-send-email-inki.dae@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

대인기/Tizen Platform Lab(SR)/삼성전자 Nov. 26, 2015, 12:47 p.m. UTC
This patch fixes wrong return type when dt binding of bridge device
failed.

If a board has a bridge device then of_graph_get_remote_port_parent
function shouldn't be NULL. So this patch will return a proper error
type so that the deferred probe isn't triggered.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_dp_core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Javier Martinez Canillas Nov. 26, 2015, 1:35 p.m. UTC | #1
[adding Ajay Kumar who added the bridge support]

Hello Inki,

On 11/26/2015 09:47 AM, Inki Dae wrote:
> This patch fixes wrong return type when dt binding of bridge device
> failed.
> 
> If a board has a bridge device then of_graph_get_remote_port_parent
> function shouldn't be NULL. So this patch will return a proper error
> type so that the deferred probe isn't triggered.
> 
> Signed-off-by: Inki Dae <inki.dae@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_dp_core.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c
> index 0b53045..c77fb83 100644
> --- a/drivers/gpu/drm/exynos/exynos_dp_core.c
> +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
> @@ -1436,8 +1436,10 @@ static int exynos_dp_probe(struct platform_device *pdev)
>  			of_node_put(bridge_node);
>  			if (!dp->ptn_bridge)
>  				return -EPROBE_DEFER;
> -		} else
> -			return -EPROBE_DEFER;
> +		} else {
> +			DRM_ERROR("no port node for bridge device.\n");
> +			return -ENXIO;
> +		}
>  	}
>  

As I mentioned in the other thread, I wonder if -ENXIO is the best errno
code in this case. Shouldn't -EINVAL be more appropriate since is about
an invalid DTB?

>  	pm_runtime_enable(dev);
> 

Best regards,
대인기/Tizen Platform Lab(SR)/삼성전자 Dec. 2, 2015, 11:51 a.m. UTC | #2
Hi Javier,

2015? 11? 26? 22:35? Javier Martinez Canillas ?(?) ? ?:
> [adding Ajay Kumar who added the bridge support]
> 
> Hello Inki,
> 
> On 11/26/2015 09:47 AM, Inki Dae wrote:
>> This patch fixes wrong return type when dt binding of bridge device
>> failed.
>>
>> If a board has a bridge device then of_graph_get_remote_port_parent
>> function shouldn't be NULL. So this patch will return a proper error
>> type so that the deferred probe isn't triggered.
>>
>> Signed-off-by: Inki Dae <inki.dae@samsung.com>
>> ---
>>  drivers/gpu/drm/exynos/exynos_dp_core.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c
>> index 0b53045..c77fb83 100644
>> --- a/drivers/gpu/drm/exynos/exynos_dp_core.c
>> +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
>> @@ -1436,8 +1436,10 @@ static int exynos_dp_probe(struct platform_device *pdev)
>>  			of_node_put(bridge_node);
>>  			if (!dp->ptn_bridge)
>>  				return -EPROBE_DEFER;
>> -		} else
>> -			return -EPROBE_DEFER;
>> +		} else {
>> +			DRM_ERROR("no port node for bridge device.\n");
>> +			return -ENXIO;
>> +		}
>>  	}
>>  
> 
> As I mentioned in the other thread, I wonder if -ENXIO is the best errno
> code in this case. Shouldn't -EINVAL be more appropriate since is about
> an invalid DTB?

Seems better to use -EINVAL.

Thanks,
Inki Dae

> 
>>  	pm_runtime_enable(dev);
>>
> 
> Best regards,
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c
index 0b53045..c77fb83 100644
--- a/drivers/gpu/drm/exynos/exynos_dp_core.c
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
@@ -1436,8 +1436,10 @@  static int exynos_dp_probe(struct platform_device *pdev)
 			of_node_put(bridge_node);
 			if (!dp->ptn_bridge)
 				return -EPROBE_DEFER;
-		} else
-			return -EPROBE_DEFER;
+		} else {
+			DRM_ERROR("no port node for bridge device.\n");
+			return -ENXIO;
+		}
 	}
 
 	pm_runtime_enable(dev);