* [PATCH] pata_imx: print error message on platform_get_irq failure
@ 2017-06-30 5:29 Gustavo A. R. Silva
2017-06-30 21:30 ` [PATCH v2] " Gustavo A. R. Silva
0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30 5:29 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, linux-kernel, Gustavo A. R. Silva
Print error message on platform_get_irq failure before return.
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
drivers/ata/pata_imx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index d4caa23..65bbf36 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -132,8 +132,10 @@ static int pata_imx_probe(struct platform_device *pdev)
int ret;
irq = platform_get_irq(pdev, 0);
- if (irq < 0)
+ if (irq < 0) {
+ dev_err(&pdev->dev, "failed to get IRQ\n");
return irq;
+ }
priv = devm_kzalloc(&pdev->dev,
sizeof(struct pata_imx_priv), GFP_KERNEL);
--
2.5.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2] pata_imx: print error message on platform_get_irq failure
2017-06-30 5:29 [PATCH] pata_imx: print error message on platform_get_irq failure Gustavo A. R. Silva
@ 2017-06-30 21:30 ` Gustavo A. R. Silva
2017-06-30 21:37 ` Sergei Shtylyov
2017-07-01 9:00 ` [PATCH v2] " Vladimir Zapolskiy
0 siblings, 2 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30 21:30 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, Tejun Heo
Cc: linux-ide, linux-kernel, Gustavo A. R. Silva
Print error message on platform_get_irq failure before return.
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
Changes in v2:
Print the return value of platform_get_irq on failure.
drivers/ata/pata_imx.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index d4caa23..66fb1ab 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -132,9 +132,10 @@ static int pata_imx_probe(struct platform_device *pdev)
int ret;
irq = platform_get_irq(pdev, 0);
- if (irq < 0)
+ if (irq < 0) {
+ dev_err(&pdev->dev, "failed to get IRQ: %d\n", irq);
return irq;
-
+ }
priv = devm_kzalloc(&pdev->dev,
sizeof(struct pata_imx_priv), GFP_KERNEL);
if (!priv)
--
2.5.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] pata_imx: print error message on platform_get_irq failure
2017-06-30 21:30 ` [PATCH v2] " Gustavo A. R. Silva
@ 2017-06-30 21:37 ` Sergei Shtylyov
2017-06-30 21:47 ` Gustavo A. R. Silva
2017-07-01 9:00 ` [PATCH v2] " Vladimir Zapolskiy
1 sibling, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2017-06-30 21:37 UTC (permalink / raw)
To: Gustavo A. R. Silva, Bartlomiej Zolnierkiewicz, Tejun Heo
Cc: linux-ide, linux-kernel
On 07/01/2017 12:30 AM, Gustavo A. R. Silva wrote:
> Print error message on platform_get_irq failure before return.
>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
> Changes in v2:
> Print the return value of platform_get_irq on failure.
>
> drivers/ata/pata_imx.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
> index d4caa23..66fb1ab 100644
> --- a/drivers/ata/pata_imx.c
> +++ b/drivers/ata/pata_imx.c
> @@ -132,9 +132,10 @@ static int pata_imx_probe(struct platform_device *pdev)
> int ret;
>
> irq = platform_get_irq(pdev, 0);
> - if (irq < 0)
> + if (irq < 0) {
> + dev_err(&pdev->dev, "failed to get IRQ: %d\n", irq);
> return irq;
> -
> + }
Removing empty line here doesn't seem a good idea...
> priv = devm_kzalloc(&pdev->dev,
> sizeof(struct pata_imx_priv), GFP_KERNEL);
> if (!priv)
MBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] pata_imx: print error message on platform_get_irq failure
2017-06-30 21:37 ` Sergei Shtylyov
@ 2017-06-30 21:47 ` Gustavo A. R. Silva
2017-06-30 22:03 ` [PATCH v3] " Gustavo A. R. Silva
0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30 21:47 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Bartlomiej Zolnierkiewicz, Tejun Heo, linux-ide, linux-kernel
Quoting Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:
> On 07/01/2017 12:30 AM, Gustavo A. R. Silva wrote:
>
>> Print error message on platform_get_irq failure before return.
>>
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>> ---
>> Changes in v2:
>> Print the return value of platform_get_irq on failure.
>>
>> drivers/ata/pata_imx.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
>> index d4caa23..66fb1ab 100644
>> --- a/drivers/ata/pata_imx.c
>> +++ b/drivers/ata/pata_imx.c
>> @@ -132,9 +132,10 @@ static int pata_imx_probe(struct platform_device *pdev)
>> int ret;
>>
>> irq = platform_get_irq(pdev, 0);
>> - if (irq < 0)
>> + if (irq < 0) {
>> + dev_err(&pdev->dev, "failed to get IRQ: %d\n", irq);
>> return irq;
>> -
>> + }
>
> Removing empty line here doesn't seem a good idea...
>
Oh yeah, I agree.
I'll send v3 shortly.
Thanks!
--
Gustavo A. R. Silva
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3] pata_imx: print error message on platform_get_irq failure
2017-06-30 21:47 ` Gustavo A. R. Silva
@ 2017-06-30 22:03 ` Gustavo A. R. Silva
0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30 22:03 UTC (permalink / raw)
To: Sergei Shtylyov, Bartlomiej Zolnierkiewicz, Tejun Heo
Cc: linux-ide, linux-kernel, Gustavo A. R. Silva
Print error message on platform_get_irq failure before return.
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
Changes in v2:
Print the return value of platform_get_irq on failure.
Changes in v3:
Put back the blank line after the IF closing brace,
which was accidentally removed in v2.
drivers/ata/pata_imx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index d4caa23..cdae3c0 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -132,8 +132,10 @@ static int pata_imx_probe(struct platform_device *pdev)
int ret;
irq = platform_get_irq(pdev, 0);
- if (irq < 0)
+ if (irq < 0) {
+ dev_err(&pdev->dev, "failed to get IRQ: %d\n", irq);
return irq;
+ }
priv = devm_kzalloc(&pdev->dev,
sizeof(struct pata_imx_priv), GFP_KERNEL);
--
2.5.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] pata_imx: print error message on platform_get_irq failure
2017-06-30 21:30 ` [PATCH v2] " Gustavo A. R. Silva
2017-06-30 21:37 ` Sergei Shtylyov
@ 2017-07-01 9:00 ` Vladimir Zapolskiy
1 sibling, 0 replies; 6+ messages in thread
From: Vladimir Zapolskiy @ 2017-07-01 9:00 UTC (permalink / raw)
To: Gustavo A. R. Silva, Bartlomiej Zolnierkiewicz, Tejun Heo
Cc: linux-ide, linux-kernel
Hello Gustavo,
On 07/01/2017 12:30 AM, Gustavo A. R. Silva wrote:
> Print error message on platform_get_irq failure before return.
>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
> Changes in v2:
> Print the return value of platform_get_irq on failure.
>
> drivers/ata/pata_imx.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
> index d4caa23..66fb1ab 100644
> --- a/drivers/ata/pata_imx.c
> +++ b/drivers/ata/pata_imx.c
> @@ -132,9 +132,10 @@ static int pata_imx_probe(struct platform_device *pdev)
> int ret;
>
> irq = platform_get_irq(pdev, 0);
> - if (irq < 0)
> + if (irq < 0) {
> + dev_err(&pdev->dev, "failed to get IRQ: %d\n", irq);
> return irq;
> -
> + }
> priv = devm_kzalloc(&pdev->dev,
> sizeof(struct pata_imx_priv), GFP_KERNEL);
> if (!priv)
>
this patch is wrong, I've explained why at https://lkml.org/lkml/2017/6/30/144
Please handle -EPROBE_DEFER case, when your change adds the second (redundant)
error level message printed to the kernel log.
--
With best wishes,
Vladimir
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-07-01 9:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30 5:29 [PATCH] pata_imx: print error message on platform_get_irq failure Gustavo A. R. Silva
2017-06-30 21:30 ` [PATCH v2] " Gustavo A. R. Silva
2017-06-30 21:37 ` Sergei Shtylyov
2017-06-30 21:47 ` Gustavo A. R. Silva
2017-06-30 22:03 ` [PATCH v3] " Gustavo A. R. Silva
2017-07-01 9:00 ` [PATCH v2] " Vladimir Zapolskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).