Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: phucduc.bui@gmail.com
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH v2 1/2] Input: snvs_pwrkey: Improve probe error handling
Date: Mon, 27 Jul 2026 10:22:33 +0000	[thread overview]
Message-ID: <20260727102234.4257B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260727101125.28291-1-phucduc.bui@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [Low] Direct use of `input_event()` instead of specific reporting helpers.
--

--- Patch [1]: [PATCH v2 1/2] Input: snvs_pwrkey: Improve probe error handling ---
commit 1bfa57ab7fcf3071071b3cf879e2dfcda7662e49
Author: bui duc phuc <phucduc.bui@gmail.com>

Input: snvs_pwrkey: Improve probe error handling

Use dev_err_probe() for devm_clk_get() to prevent log spam when probe
returns -EPROBE_DEFER. Return the original error from platform_get_irq()
instead of replacing it with -EINVAL. Drop the redundant error message
after devm_request_irq().

> diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
> index 954055aaf6e29..fa08ac561bf23 100644
> --- a/drivers/input/keyboard/snvs_pwrkey.c
> +++ b/drivers/input/keyboard/snvs_pwrkey.c
> @@ -142,16 +142,15 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
>  	}
>  
>  	clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
> -	if (IS_ERR(clk)) {
> -		dev_err(&pdev->dev, "Failed to get snvs clock (%pe)\n", clk);
> -		return PTR_ERR(clk);
> -	}
> +	if (IS_ERR(clk))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(clk),
> +				     "Failed to get snvs clock\n");
>  
>  	pdata->wakeup = of_property_read_bool(np, "wakeup-source");

[ ... ]

[Severity: Low]
This isn't a bug introduced by this patch, but since you are improving this
driver, should imx_imx_snvs_check_for_events() use input_report_key() rather
than calling input_event() directly?

drivers/input/keyboard/snvs_pwrkey.c:imx_imx_snvs_check_for_events() {
    ...
	if (state ^ pdata->keystate) {
		pdata->keystate = state;
		input_event(input, EV_KEY, pdata->keycode, state);
		input_sync(input);
		pm_relax(pdata->input->dev.parent);
	}
    ...
}

The subsystem guidelines suggest using the specific reporting helpers like
input_report_key() instead of generic input_event() when the event type
is known.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260727101125.28291-1-phucduc.bui@gmail.com?part=1

  parent reply	other threads:[~2026-07-27 10:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27 10:11 [PATCH v2 1/2] Input: snvs_pwrkey: Improve probe error handling phucduc.bui
2026-07-27 10:11 ` [PATCH v2 2/2] Input: st-keyscan: " phucduc.bui
2026-07-27 10:20   ` sashiko-bot
2026-07-27 10:22 ` sashiko-bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-20  9:08 [PATCH v2 1/2] Input: snvs_pwrkey: " phucduc.bui
2026-07-20 17:07 ` 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=20260727102234.4257B1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=phucduc.bui@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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