All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sata_rcar: fix error return code in sata_rcar_probe()
@ 2017-06-30  5:22 Gustavo A. R. Silva
  2017-06-30  9:42 ` Sergei Shtylyov
  0 siblings, 1 reply; 13+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30  5:22 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, linux-kernel, Gustavo A. R. Silva

Print error message and propagate the return value of
platform_get_irq on failure.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/ata/sata_rcar.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index ee98447..c936b2a 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -872,8 +872,10 @@ static int sata_rcar_probe(struct platform_device *pdev)
 	int ret = 0;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0)
-		return -EINVAL;
+	if (irq < 0) {
+		dev_err(&pdev->dev, "failed to get IRQ\n");
+		return irq;
+	}
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(struct sata_rcar_priv),
 			   GFP_KERNEL);
-- 
2.5.0


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

* Re: [PATCH] sata_rcar: fix error return code in sata_rcar_probe()
  2017-06-30  5:22 [PATCH] sata_rcar: fix error return code in sata_rcar_probe() Gustavo A. R. Silva
@ 2017-06-30  9:42 ` Sergei Shtylyov
  2017-06-30 12:01   ` Tejun Heo
  2017-06-30 12:35   ` [PATCH] " Sergei Shtylyov
  0 siblings, 2 replies; 13+ messages in thread
From: Sergei Shtylyov @ 2017-06-30  9:42 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Tejun Heo; +Cc: linux-ide, linux-kernel

Hello!

On 6/30/2017 8:22 AM, Gustavo A. R. Silva wrote:

> Print error message and propagate the return value of
> platform_get_irq on failure.

    You should have probably mentioned that this function no longer returns 0 
on error.

> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

MBR, Sergei

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

* Re: [PATCH] sata_rcar: fix error return code in sata_rcar_probe()
  2017-06-30  9:42 ` Sergei Shtylyov
@ 2017-06-30 12:01   ` Tejun Heo
  2017-06-30 19:36     ` Gustavo A. R. Silva
  2017-06-30 12:35   ` [PATCH] " Sergei Shtylyov
  1 sibling, 1 reply; 13+ messages in thread
From: Tejun Heo @ 2017-06-30 12:01 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Gustavo A. R. Silva, linux-ide, linux-kernel

On Fri, Jun 30, 2017 at 12:42:38PM +0300, Sergei Shtylyov wrote:
> Hello!
> 
> On 6/30/2017 8:22 AM, Gustavo A. R. Silva wrote:
> 
> > Print error message and propagate the return value of
> > platform_get_irq on failure.
> 
>    You should have probably mentioned that this function no longer returns 0
> on error.

Yeah, the patches looks good to me but I'd really appreciate more
context in the changelogs.  Gustavo, can you please respin the
patches?

Thanks.

-- 
tejun

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

* Re: [PATCH] sata_rcar: fix error return code in sata_rcar_probe()
  2017-06-30  9:42 ` Sergei Shtylyov
  2017-06-30 12:01   ` Tejun Heo
@ 2017-06-30 12:35   ` Sergei Shtylyov
  1 sibling, 0 replies; 13+ messages in thread
From: Sergei Shtylyov @ 2017-06-30 12:35 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Tejun Heo; +Cc: linux-ide, linux-kernel

On 06/30/2017 12:42 PM, Sergei Shtylyov wrote:

>> Print error message and propagate the return value of
>> platform_get_irq on failure.
>
>    You should have probably mentioned that this function no longer returns 0
> on error.

    It's prolly also worth mentioning that enforcing the error # on return 
from probe defeats the deferred probing.

MBR, Sergei

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

* Re: [PATCH] sata_rcar: fix error return code in sata_rcar_probe()
  2017-06-30 12:01   ` Tejun Heo
@ 2017-06-30 19:36     ` Gustavo A. R. Silva
  2017-06-30 19:42       ` Sergei Shtylyov
  2017-06-30 19:46       ` Gustavo A. R. Silva
  0 siblings, 2 replies; 13+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30 19:36 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Sergei Shtylyov, linux-ide, linux-kernel

Hi Tejun, Sergei,

Quoting Tejun Heo <tj@kernel.org>:

> On Fri, Jun 30, 2017 at 12:42:38PM +0300, Sergei Shtylyov wrote:
>> Hello!
>>
>> On 6/30/2017 8:22 AM, Gustavo A. R. Silva wrote:
>>
>> > Print error message and propagate the return value of
>> > platform_get_irq on failure.
>>
>>    You should have probably mentioned that this function no longer returns 0
>> on error.
>
> Yeah, the patches looks good to me but I'd really appreciate more
> context in the changelogs.  Gustavo, can you please respin the
> patches?
>

Absolutely.

What do you think about the following changelog:

platform_get_irq() returns an error code, but the sata_rcar driver
ignores it and always returns -EINVAL. This is not correct, and
prevents -EPROBE_DEFER from being propagated properly.

Print error message and propagate the return value of platform_get_irq
on failure. Also, with this change function sata_rcar_probe() no longer
returns 0 on error.


Thank you!
--
Gustavo A. R. Silva





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

* Re: [PATCH] sata_rcar: fix error return code in sata_rcar_probe()
  2017-06-30 19:36     ` Gustavo A. R. Silva
@ 2017-06-30 19:42       ` Sergei Shtylyov
  2017-06-30 19:54         ` Gustavo A. R. Silva
  2017-06-30 19:46       ` Gustavo A. R. Silva
  1 sibling, 1 reply; 13+ messages in thread
From: Sergei Shtylyov @ 2017-06-30 19:42 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Tejun Heo; +Cc: linux-ide, linux-kernel

On 06/30/2017 10:36 PM, Gustavo A. R. Silva wrote:

>>> > Print error message and propagate the return value of
>>> > platform_get_irq on failure.
>>>
>>>    You should have probably mentioned that this function no longer returns 0
>>> on error.
>>
>> Yeah, the patches looks good to me but I'd really appreciate more
>> context in the changelogs.  Gustavo, can you please respin the
>> patches?
>>
>
> Absolutely.
>
> What do you think about the following changelog:
>
> platform_get_irq() returns an error code, but the sata_rcar driver
> ignores it and always returns -EINVAL. This is not correct, and

    This *was* correct, because it prevented returning 0 on error.

> prevents -EPROBE_DEFER from being propagated properly.

    Yes, this is a real problem.

> Print error message and propagate the return value of platform_get_irq
> on failure. Also, with this change function sata_rcar_probe() no longer
> returns 0 on error.

    It never did -- I was talking about platform_get_irq() which might return 
0 on error until I fixed it:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af

> Thank you!

MBR, Sergei


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

* Re: [PATCH] sata_rcar: fix error return code in sata_rcar_probe()
  2017-06-30 19:36     ` Gustavo A. R. Silva
  2017-06-30 19:42       ` Sergei Shtylyov
@ 2017-06-30 19:46       ` Gustavo A. R. Silva
  2017-06-30 20:03         ` Sergei Shtylyov
  1 sibling, 1 reply; 13+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30 19:46 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Sergei Shtylyov, linux-ide, linux-kernel


Quoting "Gustavo A. R. Silva" <garsilva@embeddedor.com>:

> Hi Tejun, Sergei,
>
> Quoting Tejun Heo <tj@kernel.org>:
>
>> On Fri, Jun 30, 2017 at 12:42:38PM +0300, Sergei Shtylyov wrote:
>>> Hello!
>>>
>>> On 6/30/2017 8:22 AM, Gustavo A. R. Silva wrote:
>>>
>>>> Print error message and propagate the return value of
>>>> platform_get_irq on failure.
>>>
>>>   You should have probably mentioned that this function no longer returns 0
>>> on error.
>>
>> Yeah, the patches looks good to me but I'd really appreciate more
>> context in the changelogs.  Gustavo, can you please respin the
>> patches?
>>
>
> Absolutely.
>
> What do you think about the following changelog:
>
> platform_get_irq() returns an error code, but the sata_rcar driver
> ignores it and always returns -EINVAL. This is not correct, and
> prevents -EPROBE_DEFER from being propagated properly.
>
> Print error message and propagate the return value of platform_get_irq
> on failure. Also, with this change function sata_rcar_probe() no longer
> returns 0 on error.
>

Errata, this would be final the chagelog:

platform_get_irq() returns an error code, but the sata_rcar driver
ignores it and always returns -EINVAL. This is not correct, and
prevents -EPROBE_DEFER from being propagated properly. Also,
notice that platform_get_irq() no longer returns 0 on error.

Print error message and propagate the return value of platform_get_irq
on failure.

Thanks
--
Gustavo A. R. Silva

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

* Re: [PATCH] sata_rcar: fix error return code in sata_rcar_probe()
  2017-06-30 19:42       ` Sergei Shtylyov
@ 2017-06-30 19:54         ` Gustavo A. R. Silva
  0 siblings, 0 replies; 13+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30 19:54 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Tejun Heo, linux-ide, linux-kernel

Hi Sergei,

Quoting Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:

> On 06/30/2017 10:36 PM, Gustavo A. R. Silva wrote:
>
>>>>> Print error message and propagate the return value of
>>>>> platform_get_irq on failure.
>>>>
>>>>   You should have probably mentioned that this function no longer  
>>>> returns 0
>>>> on error.
>>>
>>> Yeah, the patches looks good to me but I'd really appreciate more
>>> context in the changelogs.  Gustavo, can you please respin the
>>> patches?
>>>
>>
>> Absolutely.
>>
>> What do you think about the following changelog:
>>
>> platform_get_irq() returns an error code, but the sata_rcar driver
>> ignores it and always returns -EINVAL. This is not correct, and
>
>    This *was* correct, because it prevented returning 0 on error.
>

Yeah, I got it.

>> prevents -EPROBE_DEFER from being propagated properly.
>
>    Yes, this is a real problem.
>
>> Print error message and propagate the return value of platform_get_irq
>> on failure. Also, with this change function sata_rcar_probe() no longer
>> returns 0 on error.
>
>    It never did -- I was talking about platform_get_irq() which  
> might return 0 on error until I fixed it:
>

Yep, I sent a new email immediately after I realized this was  
incorrect. Please,
check it out.

> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af
>

Great work!

Thank you
--
Gustavo A. R. Silva

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

* Re: [PATCH] sata_rcar: fix error return code in sata_rcar_probe()
  2017-06-30 19:46       ` Gustavo A. R. Silva
@ 2017-06-30 20:03         ` Sergei Shtylyov
  2017-06-30 20:34           ` Gustavo A. R. Silva
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Shtylyov @ 2017-06-30 20:03 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Tejun Heo; +Cc: linux-ide, linux-kernel

On 06/30/2017 10:46 PM, Gustavo A. R. Silva wrote:

>>>>> Print error message and propagate the return value of
>>>>> platform_get_irq on failure.
>>>>
>>>>   You should have probably mentioned that this function no longer returns 0
>>>> on error.
>>>
>>> Yeah, the patches looks good to me but I'd really appreciate more
>>> context in the changelogs.  Gustavo, can you please respin the
>>> patches?
>>>
>>
>> Absolutely.
>>
>> What do you think about the following changelog:
>>
>> platform_get_irq() returns an error code, but the sata_rcar driver
>> ignores it and always returns -EINVAL. This is not correct, and
>> prevents -EPROBE_DEFER from being propagated properly.
>>
>> Print error message and propagate the return value of platform_get_irq
>> on failure. Also, with this change function sata_rcar_probe() no longer
>> returns 0 on error.
>>
>
> Errata, this would be final the chagelog:
>
> platform_get_irq() returns an error code, but the sata_rcar driver
> ignores it and always returns -EINVAL. This is not correct, and
> prevents -EPROBE_DEFER from being propagated properly. Also,
> notice that platform_get_irq() no longer returns 0 on error.
>
> Print error message and propagate the return value of platform_get_irq
> on failure.

    Now I'm OK with that.

> Thanks

MBR, Sergei


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

* Re: [PATCH] sata_rcar: fix error return code in sata_rcar_probe()
  2017-06-30 20:03         ` Sergei Shtylyov
@ 2017-06-30 20:34           ` Gustavo A. R. Silva
  2017-06-30 21:08             ` [PATCH v2] " Gustavo A. R. Silva
  0 siblings, 1 reply; 13+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30 20:34 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Tejun Heo, linux-ide, linux-kernel


Quoting Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:

> On 06/30/2017 10:46 PM, Gustavo A. R. Silva wrote:
>
>>>>>> Print error message and propagate the return value of
>>>>>> platform_get_irq on failure.
>>>>>
>>>>>  You should have probably mentioned that this function no longer  
>>>>> returns 0
>>>>> on error.
>>>>
>>>> Yeah, the patches looks good to me but I'd really appreciate more
>>>> context in the changelogs.  Gustavo, can you please respin the
>>>> patches?
>>>>
>>>
>>> Absolutely.
>>>
>>> What do you think about the following changelog:
>>>
>>> platform_get_irq() returns an error code, but the sata_rcar driver
>>> ignores it and always returns -EINVAL. This is not correct, and
>>> prevents -EPROBE_DEFER from being propagated properly.
>>>
>>> Print error message and propagate the return value of platform_get_irq
>>> on failure. Also, with this change function sata_rcar_probe() no longer
>>> returns 0 on error.
>>>
>>
>> Errata, this would be final the chagelog:
>>
>> platform_get_irq() returns an error code, but the sata_rcar driver
>> ignores it and always returns -EINVAL. This is not correct, and
>> prevents -EPROBE_DEFER from being propagated properly. Also,
>> notice that platform_get_irq() no longer returns 0 on error.
>>
>> Print error message and propagate the return value of platform_get_irq
>> on failure.
>
>    Now I'm OK with that.
>

Great :)

Thank you
--
Gustavo A. R. Silva







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

* [PATCH v2] sata_rcar: fix error return code in sata_rcar_probe()
  2017-06-30 20:34           ` Gustavo A. R. Silva
@ 2017-06-30 21:08             ` Gustavo A. R. Silva
  2017-06-30 21:09               ` Sergei Shtylyov
  0 siblings, 1 reply; 13+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30 21:08 UTC (permalink / raw)
  To: Sergei Shtylyov, Tejun Heo; +Cc: linux-ide, linux-kernel, Gustavo A. R. Silva

platform_get_irq() returns an error code, but the sata_rcar driver
ignores it and always returns -EINVAL. This is not correct, and
prevents -EPROBE_DEFER from being propagated properly. Also,
notice that platform_get_irq() no longer returns 0 on error.

Print error message and propagate the return value of platform_get_irq
on failure.

Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
Changes in v2:
 Rewrite commit message.

 drivers/ata/sata_rcar.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index ee98447..769bfdd 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -872,8 +872,10 @@ static int sata_rcar_probe(struct platform_device *pdev)
 	int ret = 0;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0)
-		return -EINVAL;
+	if (irq < 0) {
+		dev_err(&pdev->dev, "failed to get IRQ: %d\n", irq);
+		return irq;
+	}
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(struct sata_rcar_priv),
 			   GFP_KERNEL);
-- 
2.5.0

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

* Re: [PATCH v2] sata_rcar: fix error return code in sata_rcar_probe()
  2017-06-30 21:08             ` [PATCH v2] " Gustavo A. R. Silva
@ 2017-06-30 21:09               ` Sergei Shtylyov
  2017-06-30 21:11                 ` Gustavo A. R. Silva
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Shtylyov @ 2017-06-30 21:09 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Tejun Heo; +Cc: linux-ide, linux-kernel

On 07/01/2017 12:08 AM, Gustavo A. R. Silva wrote:

> platform_get_irq() returns an error code, but the sata_rcar driver
> ignores it and always returns -EINVAL. This is not correct, and
> prevents -EPROBE_DEFER from being propagated properly. Also,
> notice that platform_get_irq() no longer returns 0 on error.
>
> Print error message and propagate the return value of platform_get_irq
> on failure.
>
> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

    You forgot to collect:

Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

MBR, Sergei


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

* Re: [PATCH v2] sata_rcar: fix error return code in sata_rcar_probe()
  2017-06-30 21:09               ` Sergei Shtylyov
@ 2017-06-30 21:11                 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 13+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30 21:11 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Tejun Heo, linux-ide, linux-kernel


Quoting Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:

> On 07/01/2017 12:08 AM, Gustavo A. R. Silva wrote:
>
>> platform_get_irq() returns an error code, but the sata_rcar driver
>> ignores it and always returns -EINVAL. This is not correct, and
>> prevents -EPROBE_DEFER from being propagated properly. Also,
>> notice that platform_get_irq() no longer returns 0 on error.
>>
>> Print error message and propagate the return value of platform_get_irq
>> on failure.
>>
>> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>
>    You forgot to collect:
>
> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>

Oh I'm sorry. Should I send v3?

Thanks
--
Gustavo A. R. Silva

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

end of thread, other threads:[~2017-06-30 21:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30  5:22 [PATCH] sata_rcar: fix error return code in sata_rcar_probe() Gustavo A. R. Silva
2017-06-30  9:42 ` Sergei Shtylyov
2017-06-30 12:01   ` Tejun Heo
2017-06-30 19:36     ` Gustavo A. R. Silva
2017-06-30 19:42       ` Sergei Shtylyov
2017-06-30 19:54         ` Gustavo A. R. Silva
2017-06-30 19:46       ` Gustavo A. R. Silva
2017-06-30 20:03         ` Sergei Shtylyov
2017-06-30 20:34           ` Gustavo A. R. Silva
2017-06-30 21:08             ` [PATCH v2] " Gustavo A. R. Silva
2017-06-30 21:09               ` Sergei Shtylyov
2017-06-30 21:11                 ` Gustavo A. R. Silva
2017-06-30 12:35   ` [PATCH] " Sergei Shtylyov

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.