Message ID | 20170630213056.GA12695@embeddedgus |
---|---|
State | Not Applicable |
Delegated to: | David Miller |
Headers | show |
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 -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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 -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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 -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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)
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(-)