mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Maxwell Doose" <maxwell@maxwelld.cc>
To: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Maxwell Doose" <maxwell@maxwelld.cc>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	<linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: "Marius Cristea" <marius.cristea@microchip.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Tomasz Duszynski" <tduszyns@gmail.com>,
	"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>
Subject: Re: [PATCH v1 2/4] iio: imu: inv_mpu6050: Unshadow error codes in ->store()
Date: Thu, 13 Aug 2026 12:57:23 -0500	[thread overview]
Message-ID: <DKO0DUO31PNN.33ZBMHQWWAXWG@maxwelld.cc> (raw)
In-Reply-To: <20260813071912.2465208-3-andriy.shevchenko@linux.intel.com>

On Thu Aug 13, 2026 at 2:16 AM CDT
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> kstrtox() may return different error codes.
>
> Unshadow them in the ->store() callback to give better error report.
>
> While at it, add missing kstrtox.h inclusion.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> index 5796896d54cd..38c3f3b398d4 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> @@ -13,6 +13,7 @@
>  #include <linux/irq.h>
>  #include <linux/interrupt.h>
>  #include <linux/acpi.h>
> +#include <linux/kstrtox.h>
>  #include <linux/platform_device.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/math64.h>
> @@ -1303,8 +1304,9 @@ inv_mpu6050_fifo_rate_store(struct device *dev, struct device_attribute *attr,
>  	struct inv_mpu6050_state *st = iio_priv(indio_dev);
>  	struct device *pdev = regmap_get_device(st->map);
>  
> -	if (kstrtoint(buf, 10, &fifo_rate))
> -		return -EINVAL;
> +	result = kstrtoint(buf, 10, &fifo_rate);
> +	if (result)
> +		return result;

I suppose result is what was being used before? Oh well doesn't seem
worth it to send a patch *just* to change to int ret.

Reviewed-by: Maxwell Doose <maxwell@maxwelld.cc>

thanks,
max


>  	if (fifo_rate < INV_MPU6050_MIN_FIFO_RATE ||
>  	    fifo_rate > INV_MPU6050_MAX_FIFO_RATE)
>  		return -EINVAL;


  reply	other threads:[~2026-08-13 17:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13  7:16 [PATCH v1 0/4] iio: " Andy Shevchenko
2026-08-13  7:16 ` [PATCH v1 1/4] iio: light: " Andy Shevchenko
2026-08-13 17:51   ` Maxwell Doose
2026-08-13 20:47     ` Andy Shevchenko
2026-08-14  2:47       ` Maxwell Doose
2026-08-14  8:14         ` Andy Shevchenko
2026-08-14  8:25           ` Joshua Crofts
2026-08-14  8:50             ` Andy Shevchenko
2026-08-17  2:54               ` Jonathan Cameron
2026-08-17 19:12                 ` Maxwell Doose
2026-08-18 14:11                   ` Joshua Crofts
2026-08-22  0:42                     ` Jonathan Cameron
2026-08-13  7:16 ` [PATCH v1 2/4] iio: imu: inv_mpu6050: " Andy Shevchenko
2026-08-13 17:57   ` Maxwell Doose [this message]
2026-08-13 20:48     ` Andy Shevchenko
2026-08-13  7:16 ` [PATCH v1 3/4] iio: chemical: sps30: " Andy Shevchenko
2026-08-13 17:53   ` Maxwell Doose
2026-08-13  7:16 ` [PATCH v1 4/4] iio: adc: pac1934: " Andy Shevchenko
2026-08-13 12:17   ` Marius.Cristea
2026-08-13 17:54   ` Maxwell Doose
2026-08-22  1:19 ` [PATCH v1 0/4] iio: " Jonathan Cameron

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=DKO0DUO31PNN.33ZBMHQWWAXWG@maxwelld.cc \
    --to=maxwell@maxwelld.cc \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marius.cristea@microchip.com \
    --cc=nuno.sa@analog.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tduszyns@gmail.com \
    /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

all inboxes | Powered by JetHome®