Re: [PATCH v3] mux: core: Replace manual put_device() with __free(put_device)

From: Maxwell Doose

Date: Tue Jun 02 2026 - 16:55:45 EST


On Tue, 2 Jun 2026 22:37:06 +0200
Peter Rosin <peda@xxxxxxxxxxxxxx> wrote:

> On 2026-06-02 18:44, Maxwell Doose wrote:
> > The current code for returning on failure in mux_get() uses manual
> > put_device() calls. Refactor and replace them with a new variable for
> > the pointer to the underlying device and __free(put_device).
>
> I hinted at it in the reply to v1, and seeing it confirms it methinks.
> For me, __free() works well for RAII, but the pattern here isn't RAII.
> Acquisition happened before init and the scope of the variable isn't
> the lifetime either. It feels a bit clumsy. So, this patch is not a
> clear improvement and therefore not worth it. Sorry.
>
> Cheers,
> Peter
>

That's fair. Have a good night though!

--
best regards,
max