Linux IIO development
 help / color / mirror / Atom feed
From: Joshua Crofts <joshua.crofts1@gmail.com>
To: "Nuno Sá" <nuno.sa@analog.com>
Cc: Linus Walleij <linusw@kernel.org>,
	Jonathan Cameron <jic23@kernel.org>,
	David Lechner <dlechner@baylibre.com>,
	Andy Shevchenko <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Dingisoul <dingiso.kernel@gmail.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] iio: gyro: mpu3050: add missing trigger cleanup on remove
Date: Thu, 15 Oct 2026 22:06:06 +0200	[thread overview]
Message-ID: <20261015220606.70c95a4d@systembl0wer> (raw)
In-Reply-To: <as4jIPWKMKIo5Di2@nsa>

On Tue, 13 Oct 2026 13:30:32 +0100
Nuno Sá <nuno.sa@analog.com> wrote:

> On Sun, Oct 11, 2026 at 07:12:40PM +0200, Joshua Crofts wrote:
> > On Sun, 11 Oct 2026 17:53:01 +0200
> > Joshua Crofts <joshua.crofts1@gmail.com> wrote:  
> > >  drivers/iio/gyro/mpu3050-core.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >   
> > 
> > Sashiko review came back and the issue doesn't seem so
> > straight-forward. I'll probably introduce a local pointer
> > and then assign it to the mpu3050 data struct.  
> 
> Hmm the probe seems a mess of mixed devm with manual cleanup. Ideally we
> would move all of it managed resources (and that would fix the issue).
> Other than that, seems to me we have two things in play. First:
> 
> if (irq) {
> 	ret = mpu3050_trigger_probe(indio_dev, irq);
> 	if (ret)
> 		dev_err(dev, "failed to register trigger\n");
> }
> 
> Do we really want to ignore the error? I would say no... 
> So, if we change the above to not ignore errors, we can assume that, on
> success, our trigger was registered. Which means that on the if (irq) at
> the errir patch we could unregister the trigger. Not that pretty but 
> consistent with what we have :).

Ah well, I'm an idiot and pushed out a v2. This would make things
easier as the trigger would have been guaranteed to exist...

> If someone has the HW, moving this into devm would probably be the
> better approach (but even in that case, we might want the simple fix
> first for backporting).

I'd push the simple fix out, then move it to devm.

-- 
Kind regards,
Joshua Crofts

      reply	other threads:[~2026-10-15 20:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 15:53 [PATCH] iio: gyro: mpu3050: add missing trigger cleanup on remove Joshua Crofts
2026-10-11 17:12 ` Joshua Crofts
2026-10-13 12:30   ` Nuno Sá
2026-10-15 20:06     ` Joshua Crofts [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=20261015220606.70c95a4d@systembl0wer \
    --to=joshua.crofts1@gmail.com \
    --cc=andy@kernel.org \
    --cc=dingiso.kernel@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=stable@vger.kernel.org \
    /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