From: phucduc.bui@gmail.com
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH v2 2/2] Input: st-keyscan: Improve probe error handling
Date: Mon, 20 Jul 2026 16:08:50 +0700 [thread overview]
Message-ID: <20260720090851.230244-2-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260720090851.230244-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
Use dev_err_probe() for devm_clk_get() so deferred probe errors are
handled correctly.
Drop the redundant error message after devm_request_irq(), since the
helper already reports request failures internally.
Return the original error from platform_get_irq() instead of replacing
it with -EINVAL.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2 :
-Return the original error from platform_get_irq() instead of replacing
it with -EINVAL.
drivers/input/keyboard/st-keyscan.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c
index e53ef4c670e4..8e9bac339dc4 100644
--- a/drivers/input/keyboard/st-keyscan.c
+++ b/drivers/input/keyboard/st-keyscan.c
@@ -173,10 +173,9 @@ static int keyscan_probe(struct platform_device *pdev)
return PTR_ERR(keypad_data->base);
keypad_data->clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(keypad_data->clk)) {
- dev_err(&pdev->dev, "cannot get clock\n");
- return PTR_ERR(keypad_data->clk);
- }
+ if (IS_ERR(keypad_data->clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(keypad_data->clk),
+ "cannot get clock\n");
error = clk_enable(keypad_data->clk);
if (error) {
@@ -188,14 +187,12 @@ static int keyscan_probe(struct platform_device *pdev)
keypad_data->irq = platform_get_irq(pdev, 0);
if (keypad_data->irq < 0)
- return -EINVAL;
+ return keypad_data->irq;
error = devm_request_irq(&pdev->dev, keypad_data->irq, keyscan_isr, 0,
pdev->name, keypad_data);
- if (error) {
- dev_err(&pdev->dev, "failed to request IRQ\n");
+ if (error)
return error;
- }
error = input_register_device(input_dev);
if (error) {
--
2.43.0
next prev parent reply other threads:[~2026-07-20 9:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 9:08 [PATCH v2 1/2] Input: snvs_pwrkey: Improve probe error handling phucduc.bui
2026-07-20 9:08 ` phucduc.bui [this message]
2026-07-20 9:17 ` [PATCH v2 2/2] Input: st-keyscan: " sashiko-bot
2026-07-20 17:08 ` Dmitry Torokhov
2026-07-21 2:20 ` Bui Duc Phuc
2026-07-21 2:41 ` Bui Duc Phuc
2026-07-20 17:07 ` [PATCH v2 1/2] Input: snvs_pwrkey: " Dmitry Torokhov
2026-07-21 1:59 ` 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=20260720090851.230244-2-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox