All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: hisi_sas: fix IRQ checks
@ 2021-04-03 20:43 Sergey Shtylyov
       [not found] ` <CAHp75VfZ+B-MNZ57BzMxgTvGXQ7Ek-DU2T4UVQ2tQpPoOmfcTg@mail.gmail.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sergey Shtylyov @ 2021-04-03 20:43 UTC (permalink / raw)
  To: Avri Altman, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, John Garry

Commit df2d8213d9e3 ("hisi_sas: use platform_get_irq()") failed to take
into account that irq_of_parse_and_map() and platform_get_irq() have a
different way of indicating an error: the former returns 0 and the latter
returns a negative error code. Fix up the IRQ checks!

Fixes: df2d8213d9e3 ("hisi_sas: use platform_get_irq()")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>

---
 drivers/scsi/hisi_sas/hisi_sas_v1_hw.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: scsi/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
===================================================================
--- scsi.orig/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
+++ scsi/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
@@ -1646,7 +1646,7 @@ static int interrupt_init_v1_hw(struct h
 		idx = i * HISI_SAS_PHY_INT_NR;
 		for (j = 0; j < HISI_SAS_PHY_INT_NR; j++, idx++) {
 			irq = platform_get_irq(pdev, idx);
-			if (!irq) {
+			if (irq < 0) {
 				dev_err(dev, "irq init: fail map phy interrupt %d\n",
 					idx);
 				return -ENOENTr;
@@ -1665,7 +1665,7 @@ static int interrupt_init_v1_hw(struct h
 	idx = hisi_hba->n_phy * HISI_SAS_PHY_INT_NR;
 	for (i = 0; i < hisi_hba->queue_count; i++, idx++) {
 		irq = platform_get_irq(pdev, idx);
-		if (!irq) {
+		if (irq < 0) {
 			dev_err(dev, "irq init: could not map cq interrupt %d\n",
 				idx);
 			return -ENOENT;
@@ -1683,7 +1683,7 @@ static int interrupt_init_v1_hw(struct h
 	idx = (hisi_hba->n_phy * HISI_SAS_PHY_INT_NR) + hisi_hba->queue_count;
 	for (i = 0; i < HISI_SAS_FATAL_INT_NR; i++, idx++) {
 		irq = platform_get_irq(pdev, idx);
-		if (!irq) {
+		if (irq < 0) {
 			dev_err(dev, "irq init: could not map fatal interrupt %d\n",
 				idx);
 			return -ENOENT;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-16  2:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-03 20:43 [PATCH] scsi: hisi_sas: fix IRQ checks Sergey Shtylyov
     [not found] ` <CAHp75VfZ+B-MNZ57BzMxgTvGXQ7Ek-DU2T4UVQ2tQpPoOmfcTg@mail.gmail.com>
2021-04-04 15:39   ` Sergey Shtylyov
2021-04-05 14:27 ` Sergey Shtylyov
2021-04-06  7:43   ` John Garry
2021-04-10 18:58     ` Sergey Shtylyov
2021-04-16  2:51 ` Martin K. Petersen

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.