The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: phucduc.bui@gmail.com
To: Corey Minyard <corey@minyard.net>,
	openipmi-developer@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Cc: bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 3/4] ipmi: bt-bmc: Request IRQ only when available
Date: Mon, 17 Aug 2026 17:50:40 +0700	[thread overview]
Message-ID: <20260817105041.63224-3-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260817105041.63224-1-phucduc.bui@gmail.com>

From: bui duc phuc <phucduc.bui@gmail.com>

Only call devm_request_irq() when a valid positive IRQ number is
available.

Remove the redundant warning since devm_request_irq() already reports
the error. There is also no need to store the error in bt_bmc->irq,
as errors other than -ENXIO are returned to the caller instead of
being handled as the no-IRQ case.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 drivers/char/ipmi/bt-bmc.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
index 4c5457c88503..99b38300f9e1 100644
--- a/drivers/char/ipmi/bt-bmc.c
+++ b/drivers/char/ipmi/bt-bmc.c
@@ -383,12 +383,11 @@ static int bt_bmc_config_irq(struct bt_bmc *bt_bmc,
 	if (bt_bmc->irq < 0 && bt_bmc->irq != -ENXIO)
 		return bt_bmc->irq;
 
-	rc = devm_request_irq(dev, bt_bmc->irq, bt_bmc_irq, IRQF_SHARED,
-			      DEVICE_NAME, bt_bmc);
-	if (rc < 0) {
-		dev_warn(dev, "Unable to request IRQ %d\n", bt_bmc->irq);
-		bt_bmc->irq = rc;
-		return rc;
+	if (bt_bmc->irq > 0) {
+		rc = devm_request_irq(dev, bt_bmc->irq, bt_bmc_irq,
+				      IRQF_SHARED, DEVICE_NAME, bt_bmc);
+		if (rc < 0)
+			return rc;
 	}
 
 	/*
-- 
2.43.0


  parent reply	other threads:[~2026-08-17 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 10:50 [PATCH 1/4] ipmi: bt-bmc: Propagate errors from IRQ configuration phucduc.bui
2026-08-17 10:50 ` [PATCH 2/4] ipmi: bt-bmc: Handle -ENXIO from optional IRQ lookup phucduc.bui
2026-08-17 11:40   ` Corey Minyard
2026-08-17 14:28     ` Bui Duc Phuc
2026-08-17 10:50 ` phucduc.bui [this message]
2026-08-17 10:50 ` [PATCH 4/4] ipmi: bt-bmc: Check IRQ number correctly phucduc.bui
2026-08-17 11:37 ` [PATCH 1/4] ipmi: bt-bmc: Propagate errors from IRQ configuration Corey Minyard
2026-08-17 14:22   ` Bui Duc Phuc

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=20260817105041.63224-3-phucduc.bui@gmail.com \
    --to=phucduc.bui@gmail.com \
    --cc=corey@minyard.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox