The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Stepan Ionichev <sozdayvek@gmail.com>
To: andriy.shevchenko@intel.com
Cc: joshua.crofts1@gmail.com, jic23@kernel.org,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	gregkh@linuxfoundation.org, hcazarim@yahoo.com,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	sozdayvek@gmail.com
Subject: Re: [PATCH] iio: trigger: iio-trig-interrupt: use devm_* helpers
Date: Mon, 11 May 2026 11:36:28 +0500	[thread overview]
Message-ID: <20260511063628.913-1-sozdayvek@gmail.com> (raw)
In-Reply-To: <20260511060732.7728-1-sozdayvek@gmail.com>

On Mon, May 11, 2026 at 18:46, Andy Shevchenko wrote:
> Looking at this and taking into account the above, have you checked the
> - trigger lifetime versus platform device
> - parent-child relationship in the sysfs
>
> The latter might lead to interesting side-effects.

You are right -- the parent change is the real concern here, not
just the cleanup ladder.

Checked the rest of IIO: there are 26 other devm_iio_trigger_alloc()
callers in drivers/iio/, and all of them pass a non-NULL parent
(typically &client->dev, &spi->dev or &indio_dev->dev). The
iio-trig-interrupt driver with NULL parent is the only exception.

devm_iio_trigger_alloc() requires a non-NULL parent for devres
tracking, so the conversion necessarily introduces one. The
trigger then becomes a child of the platform device both in the
device tree and in sysfs, and its lifetime is tied to pdev
unbind instead of the (former) manual .remove().

If preserving the parent-less behavior is required for userspace
or for any subtle reason I have not thought of, please drop both
v1 and v2 of this patch. I do not have the IIO trigger framework
background to argue that the parent change is safe.

If the conversion is acceptable (in line with the rest of IIO),
v2 already addresses the dev_err()/local-device/commit-message
nits.

Stepan

  parent reply	other threads:[~2026-05-11 13:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11  6:07 [PATCH] iio: trigger: iio-trig-interrupt: use devm_* helpers Stepan Ionichev
2026-05-11  6:32 ` [PATCH v2] " Stepan Ionichev
2026-05-11 13:53   ` Joshua Crofts
2026-05-11 14:56   ` Jonathan Cameron
2026-05-11 15:05   ` Andy Shevchenko
2026-05-11  6:36 ` Stepan Ionichev [this message]
2026-05-11  6:44 ` [PATCH] " Stepan Ionichev
2026-05-11 13:33 ` Joshua Crofts
2026-05-11  6:27   ` Stepan Ionichev
2026-05-11 13:48     ` Joshua Crofts
2026-05-11 13:46   ` Andy Shevchenko
2026-05-11 13:38 ` Andy Shevchenko
2026-05-13  8:33 ` Stepan Ionichev

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=20260511063628.913-1-sozdayvek@gmail.com \
    --to=sozdayvek@gmail.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hcazarim@yahoo.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