All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jun Yan" <jerrysteve1101@gmail.com>
Cc: linux-input@vger.kernel.org, robh@kernel.org,
	dmitry.torokhov@gmail.com, conor+dt@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v3 06/10] Input: cap11xx - add reset gpio support
Date: Mon, 15 Jun 2026 14:29:10 +0000	[thread overview]
Message-ID: <20260615142911.2B4061F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260615142103.352163-7-jerrysteve1101@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Coding style violations: redundant 'else' after 'return' and inconsistent brace usage.
--

commit 2a7317102372f10d4bd76864cfeaec2d7955c415
Author: Jun Yan <jerrysteve1101@gmail.com>

Input: cap11xx - add reset gpio support

This commit adds support for an optional hardware reset pin on CAP11xx
devices to improve reliability and ensure proper initialization during probe.

> diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
> --- a/drivers/input/keyboard/cap11xx.c
> +++ b/drivers/input/keyboard/cap11xx.c
[ ... ]
> @@ -452,6 +457,16 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
>  	if (IS_ERR(priv->regmap))
>  		return PTR_ERR(priv->regmap);
>  
> +	priv->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
> +	if (IS_ERR(priv->reset_gpio))
> +		return dev_err_probe(dev, PTR_ERR(priv->reset_gpio),
> +				     "Failed to get 'reset' GPIO\n");
> +	else if (priv->reset_gpio) {

[Severity: Low]
This isn't a bug, but does this follow the standard kernel coding style?

Since the preceding if statement ends with a return, the else keyword here
is redundant. Additionally, kernel style guidelines generally prefer that if
one branch of a conditional requires braces, all branches should use them.

Could this be simplified by dropping the else and just using a separate if
statement for checking priv->reset_gpio?

> +		usleep_range(CAP11XX_T_RST_FILT_MIN_US, CAP11XX_T_RST_FILT_MIN_US * 2);
> +		gpiod_set_value_cansleep(priv->reset_gpio, 0);
> +		msleep(CAP11XX_T_RST_ON_MIN_MS);
> +	}
> +
>  	error = regmap_read(priv->regmap, CAP11XX_REG_PRODUCT_ID, &val);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260615142103.352163-1-jerrysteve1101@gmail.com?part=6

  reply	other threads:[~2026-06-15 14:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-15 14:20 [PATCH v3 00/10] Input: cap11xx - Add support for CAP1114 Jun Yan
2026-06-15 14:20 ` [PATCH v3 01/10] Input: cap11xx - clean up duplicate log and add probe error logs Jun Yan
2026-06-15 14:20 ` [PATCH v3 02/10] Input: cap11xx - remove unused register macros Jun Yan
2026-06-15 14:34   ` sashiko-bot
2026-06-15 14:20 ` [PATCH v3 03/10] dt-bindings: input: microchip,cap11xx: Update datasheet URL and LED reg range Jun Yan
2026-06-15 16:27   ` Conor Dooley
2026-06-15 14:20 ` [PATCH v3 04/10] dt-bindings: input: microchip,cap11xx: Add microchip,cap1126 LED reg constraints Jun Yan
2026-06-15 16:24   ` Conor Dooley
2026-06-15 14:20 ` [PATCH v3 05/10] dt-bindings: input: microchip,cap11xx: Add reset-gpios property Jun Yan
2026-06-15 14:20 ` [PATCH v3 06/10] Input: cap11xx - add reset gpio support Jun Yan
2026-06-15 14:29   ` sashiko-bot [this message]
2026-06-15 14:20 ` [PATCH v3 07/10] Input: cap11xx - refactor code for better CAP1114 support Jun Yan
2026-06-15 14:20 ` [PATCH v3 08/10] Input: cap11xx - guard unsupported DT properties before parsing Jun Yan
2026-06-15 14:20 ` [PATCH v3 09/10] dt-bindings: input: microchip,cap11xx: Add CAP1114 support Jun Yan
2026-06-15 16:24   ` Conor Dooley
2026-06-15 14:20 ` [PATCH v3 10/10] Input: cap11xx - add support for CAP1114 Jun Yan

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=20260615142911.2B4061F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jerrysteve1101@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=robh@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.