From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Fabio Estevam <festevam@gmail.com>, tj@kernel.org
Cc: linux-ide@vger.kernel.org, Fabio Estevam <fabio.estevam@freescale.com>
Subject: Re: [PATCH 2/3] pata_imx: Propagate the real error code on platform_get_irq() failure
Date: Sun, 16 Feb 2014 00:38:42 +0400 [thread overview]
Message-ID: <52FFD052.6060306@cogentembedded.com> (raw)
In-Reply-To: <1392468635-13373-2-git-send-email-festevam@gmail.com>
Hello.
On 15-02-2014 16:50, Fabio Estevam wrote:
> 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.
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> drivers/ata/pata_imx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
> index 50e2cf2..1af71b7 100644
> --- a/drivers/ata/pata_imx.c
> +++ b/drivers/ata/pata_imx.c
> @@ -101,7 +101,7 @@ static int pata_imx_probe(struct platform_device *pdev)
>
> irq = platform_get_irq(pdev, 0);
> if (irq <= 0)
> - return -EINVAL;
> + return irq;
If returned IRQ is 0 (unused), you'll return 0, indicating probe success
while actually it failed. We need somewhat more complicated code here.
WBR, Sergei
next prev parent reply other threads:[~2014-02-15 20:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-15 12:50 [PATCH 1/3] pata_imx: Use devm_ioremap_resource() to simplify code Fabio Estevam
2014-02-15 12:50 ` [PATCH 2/3] pata_imx: Propagate the real error code on platform_get_irq() failure Fabio Estevam
2014-02-15 20:38 ` Sergei Shtylyov [this message]
2014-02-17 19:48 ` Fabio Estevam
2014-02-17 22:45 ` Sergei Shtylyov
2014-02-15 12:50 ` [PATCH 3/3] pata_imx: Check the return value from clk_prepare_enable() Fabio Estevam
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=52FFD052.6060306@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=fabio.estevam@freescale.com \
--cc=festevam@gmail.com \
--cc=linux-ide@vger.kernel.org \
--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.