All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/msm/dp: fix error check return value of irq_of_parse_and_map()
@ 2022-04-22  8:49 ` cgel.zte
  0 siblings, 0 replies; 12+ messages in thread
From: cgel.zte @ 2022-04-22  8:49 UTC (permalink / raw)
  To: robdclark, sean, quic_abhinavk
  Cc: airlied, linux-arm-msm, swboyd, Zeal Robot, linux-kernel,
	dri-devel, quic_khsieh, dmitry.baryshkov, bjorn.andersson,
	freedreno, Lv Ruyi, linux

From: Lv Ruyi <lv.ruyi@zte.com.cn>

The irq_of_parse_and_map() function returns 0 on failure, and does not
return an negative value.

Fixes: 	8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/gpu/drm/msm/dp/dp_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index a42732b67349..3926d2ac107d 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1239,7 +1239,7 @@ int dp_display_request_irq(struct msm_dp *dp_display)
 	dp = container_of(dp_display, struct dp_display_private, dp_display);
 
 	dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);
-	if (dp->irq < 0) {
+	if (!dp->irq) {
 		rc = dp->irq;
 		DRM_ERROR("failed to get irq: %d\n", rc);
 		return rc;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] drm/msm/dp: fix error check return value of irq_of_parse_and_map()
@ 2022-04-22  8:49 ` cgel.zte
  0 siblings, 0 replies; 12+ messages in thread
From: cgel.zte @ 2022-04-22  8:49 UTC (permalink / raw)
  To: robdclark, sean, quic_abhinavk
  Cc: airlied, daniel, swboyd, dmitry.baryshkov, quic_khsieh,
	bjorn.andersson, linux, linux-arm-msm, dri-devel, freedreno,
	linux-kernel, Lv Ruyi, Zeal Robot

From: Lv Ruyi <lv.ruyi@zte.com.cn>

The irq_of_parse_and_map() function returns 0 on failure, and does not
return an negative value.

Fixes: 	8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/gpu/drm/msm/dp/dp_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index a42732b67349..3926d2ac107d 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1239,7 +1239,7 @@ int dp_display_request_irq(struct msm_dp *dp_display)
 	dp = container_of(dp_display, struct dp_display_private, dp_display);
 
 	dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);
-	if (dp->irq < 0) {
+	if (!dp->irq) {
 		rc = dp->irq;
 		DRM_ERROR("failed to get irq: %d\n", rc);
 		return rc;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/msm/dp: fix error check return value of irq_of_parse_and_map()
  2022-04-22  8:49 ` cgel.zte
@ 2022-04-22 10:41   ` Dmitry Baryshkov
  -1 siblings, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2022-04-22 10:41 UTC (permalink / raw)
  To: cgel.zte
  Cc: robdclark, sean, quic_abhinavk, airlied, daniel, swboyd,
	quic_khsieh, bjorn.andersson, linux, linux-arm-msm, dri-devel,
	freedreno, linux-kernel, Lv Ruyi, Zeal Robot

On Fri, 22 Apr 2022 at 11:50, <cgel.zte@gmail.com> wrote:
>
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> The irq_of_parse_and_map() function returns 0 on failure, and does not
> return an negative value.
>
> Fixes:  8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
>  drivers/gpu/drm/msm/dp/dp_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index a42732b67349..3926d2ac107d 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1239,7 +1239,7 @@ int dp_display_request_irq(struct msm_dp *dp_display)
>         dp = container_of(dp_display, struct dp_display_private, dp_display);
>
>         dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);
> -       if (dp->irq < 0) {
> +       if (!dp->irq) {
>                 rc = dp->irq;
>                 DRM_ERROR("failed to get irq: %d\n", rc);
>                 return rc;
> --
> 2.25.1
>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/msm/dp: fix error check return value of irq_of_parse_and_map()
@ 2022-04-22 10:41   ` Dmitry Baryshkov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2022-04-22 10:41 UTC (permalink / raw)
  To: cgel.zte
  Cc: freedreno, linux-kernel, airlied, linux-arm-msm, Lv Ruyi,
	quic_abhinavk, dri-devel, swboyd, bjorn.andersson, quic_khsieh,
	sean, Zeal Robot, linux

On Fri, 22 Apr 2022 at 11:50, <cgel.zte@gmail.com> wrote:
>
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> The irq_of_parse_and_map() function returns 0 on failure, and does not
> return an negative value.
>
> Fixes:  8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
>  drivers/gpu/drm/msm/dp/dp_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index a42732b67349..3926d2ac107d 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1239,7 +1239,7 @@ int dp_display_request_irq(struct msm_dp *dp_display)
>         dp = container_of(dp_display, struct dp_display_private, dp_display);
>
>         dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);
> -       if (dp->irq < 0) {
> +       if (!dp->irq) {
>                 rc = dp->irq;
>                 DRM_ERROR("failed to get irq: %d\n", rc);
>                 return rc;
> --
> 2.25.1
>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/msm/dp: fix error check return value of irq_of_parse_and_map()
  2022-04-22  8:49 ` cgel.zte
@ 2022-04-22 18:39   ` Stephen Boyd
  -1 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2022-04-22 18:39 UTC (permalink / raw)
  To: cgel.zte, quic_abhinavk, robdclark, sean
  Cc: airlied, linux-arm-msm, Lv Ruyi, linux-kernel, dri-devel,
	bjorn.andersson, dmitry.baryshkov, quic_khsieh, freedreno,
	Zeal Robot, linux

Quoting cgel.zte@gmail.com (2022-04-22 01:49:51)
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> The irq_of_parse_and_map() function returns 0 on failure, and does not
> return an negative value.
>
> Fixes:  8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
> ---
>  drivers/gpu/drm/msm/dp/dp_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index a42732b67349..3926d2ac107d 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1239,7 +1239,7 @@ int dp_display_request_irq(struct msm_dp *dp_display)
>         dp = container_of(dp_display, struct dp_display_private, dp_display);
>
>         dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);

Why can't platform_get_irq() be used?

> -       if (dp->irq < 0) {
> +       if (!dp->irq) {
>                 rc = dp->irq;

zero as an error return value is an error?

>                 DRM_ERROR("failed to get irq: %d\n", rc);
>                 return rc;

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/msm/dp: fix error check return value of irq_of_parse_and_map()
@ 2022-04-22 18:39   ` Stephen Boyd
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2022-04-22 18:39 UTC (permalink / raw)
  To: cgel.zte, quic_abhinavk, robdclark, sean
  Cc: airlied, daniel, dmitry.baryshkov, quic_khsieh, bjorn.andersson,
	linux, linux-arm-msm, dri-devel, freedreno, linux-kernel,
	Lv Ruyi, Zeal Robot

Quoting cgel.zte@gmail.com (2022-04-22 01:49:51)
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> The irq_of_parse_and_map() function returns 0 on failure, and does not
> return an negative value.
>
> Fixes:  8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
> ---
>  drivers/gpu/drm/msm/dp/dp_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index a42732b67349..3926d2ac107d 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1239,7 +1239,7 @@ int dp_display_request_irq(struct msm_dp *dp_display)
>         dp = container_of(dp_display, struct dp_display_private, dp_display);
>
>         dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);

Why can't platform_get_irq() be used?

> -       if (dp->irq < 0) {
> +       if (!dp->irq) {
>                 rc = dp->irq;

zero as an error return value is an error?

>                 DRM_ERROR("failed to get irq: %d\n", rc);
>                 return rc;

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/msm/dp: fix error check return value of irq_of_parse_and_map()
  2022-04-22 18:39   ` Stephen Boyd
@ 2022-04-22 22:40     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2022-04-22 22:40 UTC (permalink / raw)
  To: Stephen Boyd, cgel.zte, quic_abhinavk, robdclark, sean
  Cc: airlied, linux-arm-msm, Lv Ruyi, linux-kernel, dri-devel,
	bjorn.andersson, quic_khsieh, freedreno, Zeal Robot, linux

On 22/04/2022 21:39, Stephen Boyd wrote:
> Quoting cgel.zte@gmail.com (2022-04-22 01:49:51)
>> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>>
>> The irq_of_parse_and_map() function returns 0 on failure, and does not
>> return an negative value.
>>
>> Fixes:  8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
>> Reported-by: Zeal Robot <zealci@zte.com.cn>
>> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
>> ---
>>   drivers/gpu/drm/msm/dp/dp_display.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
>> index a42732b67349..3926d2ac107d 100644
>> --- a/drivers/gpu/drm/msm/dp/dp_display.c
>> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
>> @@ -1239,7 +1239,7 @@ int dp_display_request_irq(struct msm_dp *dp_display)
>>          dp = container_of(dp_display, struct dp_display_private, dp_display);
>>
>>          dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);
> 
> Why can't platform_get_irq() be used?
> 
>> -       if (dp->irq < 0) {
>> +       if (!dp->irq) {
>>                  rc = dp->irq;
> 
> zero as an error return value is an error?

Hmm, nice catch. Please fix it. And the other patch too.

> 
>>                  DRM_ERROR("failed to get irq: %d\n", rc);
>>                  return rc;


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] drm/msm/dp: fix error check return value of irq_of_parse_and_map()
@ 2022-04-22 22:40     ` Dmitry Baryshkov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2022-04-22 22:40 UTC (permalink / raw)
  To: Stephen Boyd, cgel.zte, quic_abhinavk, robdclark, sean
  Cc: airlied, daniel, quic_khsieh, bjorn.andersson, linux,
	linux-arm-msm, dri-devel, freedreno, linux-kernel, Lv Ruyi,
	Zeal Robot

On 22/04/2022 21:39, Stephen Boyd wrote:
> Quoting cgel.zte@gmail.com (2022-04-22 01:49:51)
>> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>>
>> The irq_of_parse_and_map() function returns 0 on failure, and does not
>> return an negative value.
>>
>> Fixes:  8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
>> Reported-by: Zeal Robot <zealci@zte.com.cn>
>> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
>> ---
>>   drivers/gpu/drm/msm/dp/dp_display.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
>> index a42732b67349..3926d2ac107d 100644
>> --- a/drivers/gpu/drm/msm/dp/dp_display.c
>> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
>> @@ -1239,7 +1239,7 @@ int dp_display_request_irq(struct msm_dp *dp_display)
>>          dp = container_of(dp_display, struct dp_display_private, dp_display);
>>
>>          dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);
> 
> Why can't platform_get_irq() be used?
> 
>> -       if (dp->irq < 0) {
>> +       if (!dp->irq) {
>>                  rc = dp->irq;
> 
> zero as an error return value is an error?

Hmm, nice catch. Please fix it. And the other patch too.

> 
>>                  DRM_ERROR("failed to get irq: %d\n", rc);
>>                  return rc;


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2] drm/msm/dp: fix error check return value of irq_of_parse_and_map()
  2022-04-22 22:40     ` Dmitry Baryshkov
@ 2022-04-24  3:24       ` cgel.zte
  -1 siblings, 0 replies; 12+ messages in thread
From: cgel.zte @ 2022-04-24  3:24 UTC (permalink / raw)
  To: dmitry.baryshkov
  Cc: sean, quic_abhinavk, airlied, cgel.zte, lv.ruyi, linux-kernel,
	dri-devel, bjorn.andersson, linux-arm-msm, swboyd, quic_khsieh,
	freedreno, Zeal Robot, linux

From: Lv Ruyi <lv.ruyi@zte.com.cn>

The irq_of_parse_and_map() function returns 0 on failure, and does not
return an negative value.

Fixes: 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
v2: don't print rc, and return -EINVAL rather than 0
---
 drivers/gpu/drm/msm/dp/dp_display.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index a42732b67349..c3566e6564b1 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1239,10 +1239,9 @@ int dp_display_request_irq(struct msm_dp *dp_display)
 	dp = container_of(dp_display, struct dp_display_private, dp_display);
 
 	dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);
-	if (dp->irq < 0) {
-		rc = dp->irq;
-		DRM_ERROR("failed to get irq: %d\n", rc);
-		return rc;
+	if (!dp->irq) {
+		DRM_ERROR("failed to get irq\n");
+		return -EINVAL;
 	}
 
 	rc = devm_request_irq(&dp->pdev->dev, dp->irq,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2] drm/msm/dp: fix error check return value of irq_of_parse_and_map()
@ 2022-04-24  3:24       ` cgel.zte
  0 siblings, 0 replies; 12+ messages in thread
From: cgel.zte @ 2022-04-24  3:24 UTC (permalink / raw)
  To: dmitry.baryshkov
  Cc: airlied, bjorn.andersson, cgel.zte, dri-devel, freedreno,
	linux-arm-msm, linux-kernel, linux, lv.ruyi, quic_abhinavk,
	quic_khsieh, robdclark, sean, swboyd, Zeal Robot

From: Lv Ruyi <lv.ruyi@zte.com.cn>

The irq_of_parse_and_map() function returns 0 on failure, and does not
return an negative value.

Fixes: 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
v2: don't print rc, and return -EINVAL rather than 0
---
 drivers/gpu/drm/msm/dp/dp_display.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index a42732b67349..c3566e6564b1 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1239,10 +1239,9 @@ int dp_display_request_irq(struct msm_dp *dp_display)
 	dp = container_of(dp_display, struct dp_display_private, dp_display);
 
 	dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);
-	if (dp->irq < 0) {
-		rc = dp->irq;
-		DRM_ERROR("failed to get irq: %d\n", rc);
-		return rc;
+	if (!dp->irq) {
+		DRM_ERROR("failed to get irq\n");
+		return -EINVAL;
 	}
 
 	rc = devm_request_irq(&dp->pdev->dev, dp->irq,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drm/msm/dp: fix error check return value of irq_of_parse_and_map()
  2022-04-24  3:24       ` cgel.zte
@ 2022-04-25 22:25         ` Dmitry Baryshkov
  -1 siblings, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2022-04-25 22:25 UTC (permalink / raw)
  To: cgel.zte
  Cc: sean, quic_abhinavk, airlied, linux-arm-msm, lv.ruyi,
	linux-kernel, dri-devel, bjorn.andersson, swboyd, quic_khsieh,
	freedreno, Zeal Robot, linux

On 24/04/2022 06:24, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
> 
> The irq_of_parse_and_map() function returns 0 on failure, and does not
> return an negative value.
> 
> Fixes: 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
> v2: don't print rc, and return -EINVAL rather than 0
> ---
>   drivers/gpu/drm/msm/dp/dp_display.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index a42732b67349..c3566e6564b1 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1239,10 +1239,9 @@ int dp_display_request_irq(struct msm_dp *dp_display)
>   	dp = container_of(dp_display, struct dp_display_private, dp_display);
>   
>   	dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);
> -	if (dp->irq < 0) {
> -		rc = dp->irq;
> -		DRM_ERROR("failed to get irq: %d\n", rc);
> -		return rc;
> +	if (!dp->irq) {
> +		DRM_ERROR("failed to get irq\n");
> +		return -EINVAL;
>   	}
>   
>   	rc = devm_request_irq(&dp->pdev->dev, dp->irq,


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drm/msm/dp: fix error check return value of irq_of_parse_and_map()
@ 2022-04-25 22:25         ` Dmitry Baryshkov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Baryshkov @ 2022-04-25 22:25 UTC (permalink / raw)
  To: cgel.zte
  Cc: airlied, bjorn.andersson, dri-devel, freedreno, linux-arm-msm,
	linux-kernel, linux, lv.ruyi, quic_abhinavk, quic_khsieh,
	robdclark, sean, swboyd, Zeal Robot

On 24/04/2022 06:24, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
> 
> The irq_of_parse_and_map() function returns 0 on failure, and does not
> return an negative value.
> 
> Fixes: 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
> v2: don't print rc, and return -EINVAL rather than 0
> ---
>   drivers/gpu/drm/msm/dp/dp_display.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index a42732b67349..c3566e6564b1 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1239,10 +1239,9 @@ int dp_display_request_irq(struct msm_dp *dp_display)
>   	dp = container_of(dp_display, struct dp_display_private, dp_display);
>   
>   	dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0);
> -	if (dp->irq < 0) {
> -		rc = dp->irq;
> -		DRM_ERROR("failed to get irq: %d\n", rc);
> -		return rc;
> +	if (!dp->irq) {
> +		DRM_ERROR("failed to get irq\n");
> +		return -EINVAL;
>   	}
>   
>   	rc = devm_request_irq(&dp->pdev->dev, dp->irq,


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-04-25 22:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-22  8:49 [PATCH] drm/msm/dp: fix error check return value of irq_of_parse_and_map() cgel.zte
2022-04-22  8:49 ` cgel.zte
2022-04-22 10:41 ` Dmitry Baryshkov
2022-04-22 10:41   ` Dmitry Baryshkov
2022-04-22 18:39 ` Stephen Boyd
2022-04-22 18:39   ` Stephen Boyd
2022-04-22 22:40   ` Dmitry Baryshkov
2022-04-22 22:40     ` Dmitry Baryshkov
2022-04-24  3:24     ` [PATCH v2] " cgel.zte
2022-04-24  3:24       ` cgel.zte
2022-04-25 22:25       ` Dmitry Baryshkov
2022-04-25 22:25         ` Dmitry Baryshkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.