All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnav Kapoor <kapoorarnav43@gmail.com>
To: Jochen Henneberg <jh@henneberg-systemdesign.com>
Cc: "Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Maoyi Xie" <maoyixie.tju@gmail.com>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: imu: bno555: Fix reset pin operation
Date: Fri,  4 Dec 2026 14:55:18 +0530	[thread overview]
Message-ID: <20261204092518.690646-1-kapoorarnav43@gmail.com> (raw)
In-Reply-To: <87y0a5s9jz.fsf@henneberg-systemdesign.com>

On Fri, Dec 04, 2026 at 10:02:24AM +0100, Jochen Henneberg wrote:
> Just pushed v2 with the reset controller but after thinking about this
> again it raised a question. The Kconfig does not enable
> RESET_CONTROLLER, however, the fallback function if the reset subsystem
> is not enabled returns ENOTSUPP which in case of this driver would cause
> a probe error. Is this intended even though the reset is optional? Or
> would it be better to select RESET_CONTROLLER from Kconfig?

I don't think the probe error can happen. With RESET_CONTROLLER=n,
the stubs in include/linux/reset.h only return -ENOTSUPP for the
non-optional getters. For the _optional_ ones they return NULL:

	return optional ? NULL : ERR_PTR(-ENOTSUPP);

So devm_reset_control_get_optional_exclusive() gives NULL, and the
driver falls back to the register reset as before. I built v2 with
RESET_CONTROLLER=n and it is fine. ad8366 did the same conversion
recently (ee4f8c56e46a, "iio: amplifiers: ad8366: replace reset-gpio
with reset controller") without touching Kconfig.

> But then, in
> case RESET_GPIO is not selected it will silently fail to setup the reset
> controller because that does not cause an error (GPIO lookup does simply
> not happen).

Right, __fwnode_reset_control_get() only looks at reset-gpios when
CONFIG_RESET_GPIO is enabled, and otherwise returns NULL for an
optional reset. If you want to cover that, "imply RESET_GPIO" in the
BOSCH_BNO055 Kconfig entry would enable it by default without forcing
it (drivers/net/dsa/lantiq/Kconfig does this). I'll leave it to Andy
and Jonathan whether they want that.

I have a few more comments on v2 itself, which I'll send there.

Thanks,
Arnav

  reply	other threads:[~2026-12-04  9:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 10:49 [PATCH] iio: imu: bno555: Fix reset pin operation Jochen Henneberg
2026-12-03 14:26 ` Andy Shevchenko
2026-12-04  9:02   ` Jochen Henneberg
2026-12-04  9:25     ` Arnav Kapoor [this message]
2026-12-04 16:34     ` Andy Shevchenko
2026-12-03 14:45 ` Arnav Kapoor

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=20261204092518.690646-1-kapoorarnav43@gmail.com \
    --to=kapoorarnav43@gmail.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jh@henneberg-systemdesign.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=maoyixie.tju@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.