From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: DelaySystem@tubot.lat
Cc: nuno.sa@analog.com, andy@kernel.org, gregkh@linuxfoundation.org,
jic23@kernel.org, dlechner@baylibre.com,
Michael.Hennerich@analog.com, linux-staging@lists.linux.dev,
linux-iio@vger.kernel.org, linux@analog.com, krzk@kernel.org,
linux-kernel@vger.kernel.org, crofts@kernel.org
Subject: Re: [PATCH v3] staging: iio: adc: ad7816: use dev_err_probe() for GPIO lookups
Date: Thu, 19 Nov 2026 11:22:31 +0200 [thread overview]
Message-ID: <av6_10q49dJE_s9i@ashevche-desk.local> (raw)
In-Reply-To: <20261118-batch1-s3-warn-v3-1-f622d212deeb@tubot.lat>
On Wed, Nov 18, 2026 at 10:22:17AM -0800, Maximo Manriquez Lizarraga via B4 Relay wrote:
>
> GPIO lookups can return -EPROBE_DEFER. Convert the rdwr, convert,
> and busy GPIO lookup failures in ad7816_probe() to dev_err_probe(),
> which suppresses the error message on deferral and records the deferral
> reason.
>
> No functional change other than defer handling.
...
> static int ad7816_probe(struct spi_device *spi_dev)
While at it, add
struct device *dev = &spi_dev->dev;
at the top of the function and use in the code you have touched.
> chip->id = spi_get_device_id(spi_dev)->driver_data;
> chip->rdwr_pin = devm_gpiod_get(&spi_dev->dev, "rdwr", GPIOD_OUT_HIGH);
> - if (IS_ERR(chip->rdwr_pin)) {
> - ret = PTR_ERR(chip->rdwr_pin);
> - dev_err(&spi_dev->dev, "Failed to request rdwr GPIO: %d\n",
> - ret);
> - return ret;
> - }
> + if (IS_ERR(chip->rdwr_pin))
> + return dev_err_probe(&spi_dev->dev, PTR_ERR(chip->rdwr_pin),
> + "Failed to request rdwr GPIO\n");
> chip->convert_pin = devm_gpiod_get(&spi_dev->dev, "convert",
> GPIOD_OUT_HIGH);
> - if (IS_ERR(chip->convert_pin)) {
> - ret = PTR_ERR(chip->convert_pin);
> - dev_err(&spi_dev->dev, "Failed to request convert GPIO: %d\n",
> - ret);
> - return ret;
> - }
> + if (IS_ERR(chip->convert_pin))
> + return dev_err_probe(&spi_dev->dev, PTR_ERR(chip->convert_pin),
> + "Failed to request convert GPIO\n");
> if (chip->id == ID_AD7816 || chip->id == ID_AD7817) {
> chip->busy_pin = devm_gpiod_get(&spi_dev->dev, "busy",
> GPIOD_IN);
> - if (IS_ERR(chip->busy_pin)) {
> - ret = PTR_ERR(chip->busy_pin);
> - dev_err(&spi_dev->dev, "Failed to request busy GPIO: %d\n",
> - ret);
> - return ret;
> - }
> + if (IS_ERR(chip->busy_pin))
> + return dev_err_probe(&spi_dev->dev, PTR_ERR(chip->busy_pin),
> + "Failed to request busy GPIO\n");
> }
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-11-19 9:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 18:22 Maximo Manriquez Lizarraga via B4 Relay
2026-11-19 9:22 ` Andy Shevchenko [this message]
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=av6_10q49dJE_s9i@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=DelaySystem@tubot.lat \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=crofts@kernel.org \
--cc=dlechner@baylibre.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux@analog.com \
--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
all inboxes | Powered by JetHome®