From: Sergey Shtylyov <s.shtylyov@omprussia.ru>
To: Hans de Goede <hdegoede@redhat.com>, Jens Axboe <axboe@kernel.dk>,
<linux-ide@vger.kernel.org>
Subject: [PATCH v2] ata: libahci_platform: fix IRQ check
Date: Mon, 15 Mar 2021 23:15:06 +0300 [thread overview]
Message-ID: <4448c8cc-331f-2915-0e17-38ea34e251c8@omprussia.ru> (raw)
Iff platform_get_irq() returns 0, ahci_platform_init_host() would return 0
early (as if the call was successful). Override IRQ0 with -EINVAL instead
as the 'libata' regards 0 as "no IRQ" (thus polling) anyway...
Fixes: c034640a32f8 ("ata: libahci: properly propagate return value of platform_get_irq()")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
---
Changes in version 2:
- added the "Fixes:" tag.
This patch is against the 'master' branch of Jens Axboe's 'linux-block.git'
repo.
drivers/ata/libahci_platform.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: linux-block/drivers/ata/libahci_platform.c
===================================================================
--- linux-block.orig/drivers/ata/libahci_platform.c
+++ linux-block/drivers/ata/libahci_platform.c
@@ -582,11 +582,13 @@ int ahci_platform_init_host(struct platf
int i, irq, n_ports, rc;
irq = platform_get_irq(pdev, 0);
- if (irq <= 0) {
+ if (irq < 0) {
if (irq != -EPROBE_DEFER)
dev_err(dev, "no irq\n");
return irq;
}
+ if (!irq)
+ return -EINVAL;
hpriv->irq = irq;
next reply other threads:[~2021-03-15 20:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 20:15 Sergey Shtylyov [this message]
2021-03-31 2:24 ` [PATCH v2] ata: libahci_platform: fix IRQ check Jens Axboe
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=4448c8cc-331f-2915-0e17-38ea34e251c8@omprussia.ru \
--to=s.shtylyov@omprussia.ru \
--cc=axboe@kernel.dk \
--cc=hdegoede@redhat.com \
--cc=linux-ide@vger.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.