Re: [PATCH v2 6/7] nvmem: split struct nvmem_device into refcounted and provider-owned data
From: Johan Hovold
Date: Mon Mar 23 2026 - 13:42:19 EST
On Tue, Mar 17, 2026 at 01:52:13PM +0100, Bartosz Golaszewski wrote:
> On Tue, Mar 17, 2026 at 11:44 AM Johan Hovold <johan@xxxxxxxxxx> wrote:
> > On Mon, Feb 23, 2026 at 11:57:07AM +0100, Bartosz Golaszewski wrote:
> > > +/*
> > > + * Holds data owned by the provider of the nvmem implementation. This goes
> > > + * away immediately the moment nvmem_unregister() is called.
> > > + */
> > > +struct nvmem_impl {
> > > + nvmem_reg_read_t reg_read;
> > > + nvmem_reg_write_t reg_write;
> > > + void *priv;
> >
> > And priv is just a pointer that is never used by nvmem core directly.
> >
> > > +};
> >
> > How about just wrapping the callbacks and calling the struct nvmem_ops
> > to make it more clear how this is used?
> >
> > That is, that nvmem core guarantees that there will be no further
> > callbacks after deregistration.
>
> Yeah, having an ops struct makes sense. Do you have any objections to
> patches 1-5? Maybe Srini could pick them up for v7.1 because I'm not
> sure when I'll be able to rework the last two.
This one fell between the cracks, sorry. I've taken a closer look at 1-5
now as well.
Johan