Linux Input/HID development
 help / color / mirror / Atom feed
From: joy.zou@oss.nxp.com
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	 Frank Li <Frank.Li@nxp.com>, Bough Chen <haibo.chen@nxp.com>,
	 Peng Fan <peng.fan@nxp.com>, Jacky Bai <ping.bai@nxp.com>,
	 Ye Li <ye.li@nxp.com>
Cc: Joy Zou <joy.zou@oss.nxp.com>,
	imx@lists.linux.dev,  linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org,  Joy Zou <joy.zou@nxp.com>
Subject: [PATCH v4 2/4] Input: snvs_pwrkey - propagate error code of platform_get_irq()
Date: Thu, 18 Jun 2026 15:31:47 +0800	[thread overview]
Message-ID: <20260618-b4-pwrkey-v4-2-4bfda105bdf3@oss.nxp.com> (raw)
In-Reply-To: <20260618-b4-pwrkey-v4-0-4bfda105bdf3@oss.nxp.com>

From: Joy Zou <joy.zou@nxp.com>

Hardcoding -EINVAL discards the actual error code, which breaks probe
deferral (-EPROBE_DEFER) and loses critical diagnostic information
needed for proper kernel error handling.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Joy Zou <joy.zou@nxp.com>
---
Changes in v4:
1. modify the subject description.
2. add Reviewed-by tag.
---
 drivers/input/keyboard/snvs_pwrkey.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
index 8cc6863d26ed..d58bbbe9fd58 100644
--- a/drivers/input/keyboard/snvs_pwrkey.c
+++ b/drivers/input/keyboard/snvs_pwrkey.c
@@ -148,7 +148,7 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
 
 	pdata->irq = platform_get_irq(pdev, 0);
 	if (pdata->irq < 0)
-		return -EINVAL;
+		return pdata->irq;
 
 	error = of_property_read_u32(np, "power-off-time-sec", &val);
 	if (!error) {

-- 
2.34.1


  parent reply	other threads:[~2026-06-18  7:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18  7:31 [PATCH v4 0/4] snvs_pwrkey - code improvements and add report event joy.zou
2026-06-18  7:31 ` [PATCH v4 1/4] Input: snvs_pwrkey - make use of dev_err_probe() joy.zou
2026-06-18  7:38   ` sashiko-bot
2026-06-18  7:31 ` joy.zou [this message]
2026-06-18  7:31 ` [PATCH v4 3/4] Input: snvs_pwrkey - use local device pointer to simple code joy.zou
2026-06-18  7:39   ` sashiko-bot
2026-06-18  7:31 ` [PATCH v4 4/4] Input: snvs_pwrkey - report press event in interrupt handler joy.zou
2026-06-18  7:41   ` sashiko-bot

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=20260618-b4-pwrkey-v4-2-4bfda105bdf3@oss.nxp.com \
    --to=joy.zou@oss.nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=haibo.chen@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=joy.zou@nxp.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=ye.li@nxp.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