From: Fabio Estevam <festevam@gmail.com>
To: tj@kernel.org
Cc: linux-ide@vger.kernel.org, sergei.shtylyov@cogentembedded.com,
Fabio Estevam <fabio.estevam@freescale.com>
Subject: [PATCH v2 2/2] pata_imx: Propagate the real error code on platform_get_irq() failure
Date: Mon, 17 Feb 2014 19:05:57 -0300 [thread overview]
Message-ID: <1392674757-1788-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1392674757-1788-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@freescale.com>
No need to return a 'fake' return value on platform_get_irq() failure.
Just return the error code itself instead.
Also, change the error condition to irq < 0, so that only negative values
are treated as errors.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Only return error on negative values
drivers/ata/pata_imx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index 3668e78..fa8e69c 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -100,8 +100,8 @@ static int pata_imx_probe(struct platform_device *pdev)
int ret;
irq = platform_get_irq(pdev, 0);
- if (irq <= 0)
- return -EINVAL;
+ if (irq < 0)
+ return irq;
priv = devm_kzalloc(&pdev->dev,
sizeof(struct pata_imx_priv), GFP_KERNEL);
--
1.8.1.2
next prev parent reply other threads:[~2014-02-17 22:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 22:05 [PATCH v2 1/2] pata_imx: Use devm_ioremap_resource() to simplify code Fabio Estevam
2014-02-17 22:05 ` Fabio Estevam [this message]
2014-02-17 23:12 ` Sergei Shtylyov
2014-02-18 22:41 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1392674757-1788-2-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=fabio.estevam@freescale.com \
--cc=linux-ide@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.