The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Hungyu Lin <dennylin0707@gmail.com>
Cc: jic23@kernel.org, lars@metafoo.de, Michael.Hennerich@analog.com,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	gregkh@linuxfoundation.org, linux-iio@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: ad7816: propagate SPI error codes
Date: Sat, 9 May 2026 09:57:20 +0300	[thread overview]
Message-ID: <af7a0OV-3GLH490W@ashevche-desk.local> (raw)
In-Reply-To: <20260509020646.82778-1-dennylin0707@gmail.com>

On Sat, May 09, 2026 at 02:06:46AM +0000, Hungyu Lin wrote:
> The driver currently returns -EIO for SPI read/write failures,
> which hides the actual error code returned by the SPI subsystem.
> 
> Return the original error code instead to allow better diagnostics
> and error handling by callers.

...

> static ssize_t ad7816_show_value(struct device *dev,

>  	ret = ad7816_spi_read(chip, &data);
>  	if (ret)
> -		return -EIO;
> +		return ret;

At least this is an ABI change and should have been mentioned in the commit
message and justified.

Yes, error code is an ABI and infamous case is already known when similar
change badly broke user space.

https://lkml.org/lkml/2012/12/23/75

...

> static inline ssize_t ad7816_set_oti(struct device *dev,

>  	ret = ad7816_spi_write(chip, data);
>  	if (ret)
> -		return -EIO;
> +		return ret;

Haven't checked this one, though.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-05-09  6:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-09  2:06 [PATCH] iio: adc: ad7816: propagate SPI error codes Hungyu Lin
2026-05-09  6:57 ` Andy Shevchenko [this message]
2026-05-09  7:24   ` Denny Lin

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=af7a0OV-3GLH490W@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dennylin0707@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --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