summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorbui duc phuc <phucduc.bui@gmail.com>2026-07-27 17:11:25 +0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2026-08-27 05:37:45 -0700
commitfcc1d6eab4ce4ba86ae05a87ecf7ce06cd2ca4d8 (patch)
treeb56f99c2d0cc46ab2f8d9a53d833fbdaad841569 /drivers
parent5a7c42811589e2da5e7f1fcd45328e7ead70d008 (diff)
downloadlinux-fcc1d6eab4ce4ba86ae05a87ecf7ce06cd2ca4d8.tar.gz
linux-fcc1d6eab4ce4ba86ae05a87ecf7ce06cd2ca4d8.zip
Input: st-keyscan - improve probe error handling
Use dev_err_probe() for devm_clk_get() to prevent log spam when probe returns -EPROBE_DEFER. 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> Link: https://patch.msgid.link/20260727101125.28291-2-phucduc.bui@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/keyboard/st-keyscan.c13
1 files 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) {