mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: phucduc.bui@gmail.com
To: Eric Piel <eric.piel@tremplin-utc.net>,
	Hans de Goede <hansg@kernel.org>,
	ilpo.jarvinen@linux.intel.com, Zha Qipeng <qipeng.zha@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andy@kernel.org>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 3/3] platform/x86: intel_scu_ipc: Handle errors from optional IRQ lookup
Date: Mon, 10 Aug 2026 12:26:25 +0700	[thread overview]
Message-ID: <20260810052625.27614-3-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260810052625.27614-1-phucduc.bui@gmail.com>

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

platform_get_irq_optional() can return errors such as -EPROBE_DEFER,
but the driver currently stores the return value directly in
scu_data.irq and continues probing.

Propagate negative errors other than -ENXIO using dev_err_probe(), and
only assign the IRQ to scu_data.irq when a valid IRQ number is
returned.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 drivers/platform/x86/intel_scu_pltdrv.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel_scu_pltdrv.c b/drivers/platform/x86/intel_scu_pltdrv.c
index d5ab62cbf5cc..4686960c44ac 100644
--- a/drivers/platform/x86/intel_scu_pltdrv.c
+++ b/drivers/platform/x86/intel_scu_pltdrv.c
@@ -21,8 +21,14 @@ static int intel_scu_platform_probe(struct platform_device *pdev)
 	struct intel_scu_ipc_data scu_data = {};
 	struct intel_scu_ipc_dev *scu;
 	const struct resource *res;
+	int ret;
+
+	ret = platform_get_irq_optional(pdev, 0);
+	if (ret < 0 && ret != -ENXIO)
+		return ret;
+	if (ret > 0)
+		scu_data.irq = ret;
 
-	scu_data.irq = platform_get_irq_optional(pdev, 0);
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
 		return -ENOMEM;
-- 
2.43.0


  parent reply	other threads:[~2026-08-10  5:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10  5:26 [PATCH 1/3] platform/x86: hp: hp_accel: Propagate " phucduc.bui
2026-08-10  5:26 ` [PATCH 2/3] platform/x86: intel: punit_ipc: " phucduc.bui
2026-08-10  7:00   ` Andy Shevchenko
2026-08-11  3:30     ` Bui Duc Phuc
2026-08-12  6:18       ` Andy Shevchenko
2026-08-10  5:26 ` phucduc.bui [this message]
2026-08-10  7:04   ` [PATCH 3/3] platform/x86: intel_scu_ipc: Handle " Andy Shevchenko
2026-08-10  6:50 ` [PATCH 1/3] platform/x86: hp: hp_accel: Propagate " Andy Shevchenko

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=20260810052625.27614-3-phucduc.bui@gmail.com \
    --to=phucduc.bui@gmail.com \
    --cc=andy@kernel.org \
    --cc=eric.piel@tremplin-utc.net \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=qipeng.zha@intel.com \
    /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

all inboxes | Powered by JetHome®