Re: [PATCH v14 5/5] reset: Leverage revocable for accessing struct reset_controller_dev
From: Bartosz Golaszewski
Date: Mon Oct 19 2026 - 13:55:14 EST
On Mon, 19 Oct 2026 14:41:47 +0200, Philipp Zabel <p.zabel@xxxxxxxxxxxxxx> said:
> On Mo, 2026-10-19 at 11:53 +0000, Tzung-Bi Shih wrote:
>> On Thu, Oct 15, 2026 at 05:49:11AM -0400, Bartosz Golaszewski wrote:
>> > > diff --git a/drivers/reset/core.c b/drivers/reset/core.c
>> > > index 38e189d04d09..788a235c3965 100644
>> > > --- a/drivers/reset/core.c
>> > > +++ b/drivers/reset/core.c
>> > > @@ -24,8 +24,8 @@
>> > > #include <linux/property.h>
>> > > #include <linux/reset.h>
>> > > #include <linux/reset-controller.h>
>> > > +#include <linux/revocable.h>
>> > > #include <linux/slab.h>
>> > > -#include <linux/srcu.h>
>> > >
>> > > static DEFINE_MUTEX(reset_list_mutex);
>> > > static LIST_HEAD(reset_controller_list);
>> > > @@ -37,9 +37,7 @@ static DEFINE_IDA(reset_gpio_ida);
>> > >
>> > > /**
>> > > * struct reset_control - a reset control
>> > > - * @rcdev: a pointer to the reset controller device
>> > > - * this reset control belongs to
>> > > - * @srcu: protects the rcdev pointer from removal during consumer access
>> > > + * @rev: revocable handle for accessing the reset controller device
>> >
>> > Please call it "revocable". The name "rev" does not indicate what it is at all.
>> > Same elsewhere if you call it the same.
>>
>> Ack, I initially used "rev" to keep the lines shorter with the revocable
>> APIs, but "rev" alone can indeed be confusing. On the other hand, I feel
>> "revocable" is a bit verbose and doesn't indicate which target object it
>> protects. How about calling it "rcdev_rev"?
>
> I strongly associate "rev" with "revision".
>
> I'd be fine with "rcdev_revocable" (in struct reset_control and
> "revocable" in struct reset_controller_device).
>
I think "revocable" in both cases is fine. After all: we know what type the
dereferenced variable is.
Bart