Re: [PATCH v2 4/5] input: drv260x: Fix unbalanced regulator_disable() call
From: Dmitry Torokhov
Date: Tue Feb 24 2026 - 17:49:09 EST
On Thu, Feb 19, 2026 at 12:11:47PM +0200, Yauhen Kharuzhy wrote:
> On Wed, Feb 18, 2026 at 06:43:30PM -0800, Dmitry Torokhov wrote:
> > Hi Yauhen,
> >
> > On Sun, Feb 15, 2026 at 04:14:34PM +0200, Yauhen Kharuzhy wrote:
> > > +static void drv260x_remove(struct i2c_client *client)
> > > +{
> > > + struct drv260x_data *haptics = i2c_get_clientdata(client);
> > > +
> > > + regulator_disable(haptics->regulator);
> > > }
> >
> > This will result in power being shut off the first thing during
> > unbinding, which is too early.
> >
> > I switched this to devm_add_action_or_reset() and applied.
>
> Do you mean that, in this case, regulator_disable() may be called before any
> devm_* registered actions? Good point, thanks.
>
Yes, all devm* actions are run after remove() completes.
Thanks.
--
Dmitry