Re: [PATCH v2 03/10] mfd: rz-mtu3: use device-managed mfd_add_devices()
From: Lee Jones
Date: Wed May 20 2026 - 12:07:47 EST
On Thu, 07 May 2026, Cosmin-Gabriel Tanislav wrote:
> > From: Lee Jones <lee@xxxxxxxxxx>
> > Sent: Thursday, May 7, 2026 3:46 PM
> >
> > On Fri, 10 Apr 2026, Cosmin Tanislav wrote:
> >
> > > Replace mfd_add_devices() and the custom cleanup action with
> > > devm_mfd_add_devices().
> > >
> > > Remove the ret variable as it is now unused.
> >
> > Do this first, then the changes in the first patch make more sense.
> >
>
> Doing the devm_mfd_add_devices() conversion first would not be a simple
> replacement, as devm_add_action_or_reset() would also need to be moved
> before it to keep the intermediate patch correct.
>
> Otherwise, on release, the reset will be asserted before the MFD devices
> are removed. Doing the reset conversion first fixes that without extra
> logic changes.
>
> Alternatively, we can squash the two conversions to avoid the
> intermediate states entirely, and remove struct rz_mtu3_priv::rstc in a
> new separate patch. What do you think about this variant?
As you wish.
--
Lee Jones