Linux IIO development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
	andy@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 5/6] iio: magnetometer: ak8975: fix wrong errno on return
Date: Wed, 22 Apr 2026 16:13:50 +0300	[thread overview]
Message-ID: <aejJjusTGt1Dv0WR@ashevche-desk.local> (raw)
In-Reply-To: <20260422112207.1313-6-joshua.crofts1@gmail.com>

On Wed, Apr 22, 2026 at 11:22:06AM +0000, Joshua Crofts wrote:
> The driver currently returns -EINVAL on polling timeout instead of
> -ETIMEDOUT.
> 
> Replace return code for -ETIMEDOUT and remove unnecessary error message
> as error is described enough by error code.

The idea is to drop messages because this is well established error code
and we have a POSIX message being associated with that (meaning all libc
implementations should follow). That said, it's not described by the error
code, it can simply be retrieved from libc *based on the error code*.

Can you rephrase that?

...

You also want to align the code in
https://elixir.bootlin.com/linux/v7.0/source/drivers/iio/magnetometer/ak8975.c#L700

The all three wait_conv...*() are called by the same user in a single
if-else-if chain.

There are two definitions:

#define	ETIME		62	/* Timer expired */
#define	ETIMEDOUT	110	/* Connection timed out */

For IO the first one makes no sense.

The driver says

`	/* Wait for the conversion to complete. */

which implies the IO with the device, and "Connection timed out" maybe not
the clearest form of it but better than "Timer expired" which rather misleading.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-04-22 13:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 11:22 [PATCH v3 0/6] iio: magnetometer: ak8975: modernize and cleanup driver Joshua Crofts
2026-04-22 11:22 ` [PATCH v3 1/6] iio: magnetometer: ak8975: sort headers alphabetically Joshua Crofts
2026-04-22 11:22 ` [PATCH v3 2/6] iio: magnetometer: ak8975: remove unused headers Joshua Crofts
2026-04-24 17:58   ` Jonathan Cameron
2026-04-24 18:12     ` Joshua Crofts
2026-04-22 11:22 ` [PATCH v3 3/6] iio: magnetometer: ak8975: replace usleep_range() with fsleep() Joshua Crofts
2026-04-22 11:22 ` [PATCH v3 4/6] iio: magnetometer: ak8975: change 'u8*' to 'u8 *' in cast Joshua Crofts
2026-04-22 11:22 ` [PATCH v3 5/6] iio: magnetometer: ak8975: fix wrong errno on return Joshua Crofts
2026-04-22 13:13   ` Andy Shevchenko [this message]
2026-04-22 13:27     ` Joshua Crofts
2026-04-22 11:22 ` [PATCH v3 6/6] iio: magnetometer: ak8975: modernize polling loops with iopoll() macros Joshua Crofts
2026-04-22 13:16 ` [PATCH v3 0/6] iio: magnetometer: ak8975: modernize and cleanup driver Andy Shevchenko
2026-04-22 13:20   ` Joshua Crofts
2026-04-24  8:23   ` Joshua Crofts
2026-04-24 10:18     ` Andy Shevchenko
2026-04-24 10:23       ` Joshua Crofts
2026-04-24 18:02         ` Jonathan Cameron
2026-04-24 18:15           ` Joshua Crofts
2026-04-27 20:15         ` Andy Shevchenko

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=aejJjusTGt1Dv0WR@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=joshua.crofts1@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.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