Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sanjay Chitroda" <sanjayembeddedse@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH 2/2] iio: gyro: hid-sensor-gyro-3d: Use dev_err_probe()
Date: Fri, 24 Jul 2026 17:23:32 +0000	[thread overview]
Message-ID: <20260724172333.0D8191F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260724-24-july-hid-gyro-dev-log-clenaup-v1-2-0c932b77104a@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The patch drops the `return` statement when handling failures from `gyro_3d_parse_report()`, causing the probe function to continue instead of aborting.
--

--- Patch [2]: [PATCH 2/2] iio: gyro: hid-sensor-gyro-3d: Use dev_err_probe() ---
commit 9e2d893e70018e9931c8153d83e07fffde994281
Author: Sanjay Chitroda <sanjayembeddedse@gmail.com>

iio: gyro: hid-sensor-gyro-3d: Use dev_err_probe()

This commit replaces dev_err() calls with dev_err_probe() during the driver
probe to simplify error code handling and nicely manage deferred probes.

> diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
> index bcf53e2677015..48540c9a097c5 100644
> --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
> +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
[ ... ]
> @@ -297,10 +296,8 @@ static int hid_gyro_3d_probe(struct platform_device *pdev)
>  	ret = gyro_3d_parse_report(pdev, hsdev,
>  				   (struct iio_chan_spec *)indio_dev->channels,
>  				   HID_USAGE_SENSOR_GYRO_3D, gyro_state);
> -	if (ret) {
> -		dev_err(&pdev->dev, "failed to setup attributes\n");
> -		return ret;
> -	}
> +	if (ret)
> +		dev_err_probe(dev, ret, "failed to setup attributes\n");

[Severity: High]
Does this accidentally drop the return statement?

If gyro_3d_parse_report() fails, hid_gyro_3d_probe() will now continue
executing instead of aborting. This could lead to an incompletely initialized
IIO device being registered.

Should this also be returning dev_err_probe(dev, ret, ...), similar to the
previous error handling block in this function?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260724-24-july-hid-gyro-dev-log-clenaup-v1-0-0c932b77104a@gmail.com?part=2

  reply	other threads:[~2026-07-24 17:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24 17:14 [PATCH 0/2] HID: iio: gyro: hid-sensor-gyro-3d: probe cleanup Sanjay Chitroda via B4 Relay
2026-07-24 17:14 ` [PATCH 1/2] iio: gyro: hid-sensor-gyro-3d: Remove redundant dev_err() Sanjay Chitroda via B4 Relay
2026-07-24 17:14 ` [PATCH 2/2] iio: gyro: hid-sensor-gyro-3d: Use dev_err_probe() Sanjay Chitroda via B4 Relay
2026-07-24 17:23   ` sashiko-bot [this message]
2026-07-24 17:29 ` [PATCH 0/2] HID: iio: gyro: hid-sensor-gyro-3d: probe cleanup Sanjay Chitroda

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=20260724172333.0D8191F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=sanjayembeddedse@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