Re: [PATCH mfd v1] mfd: Add Renesas Synchronization Management Unit (SMU) support

From: Lee Jones
Date: Tue May 25 2021 - 14:23:17 EST


On Tue, 25 May 2021, Min Li wrote:

> >
> > > +/* Current mfd device index */
> > > +static atomic_t rsmu_ndevs = ATOMIC_INIT(0);
> >
> > Counting/indexing this way is generally not good/required.
> >
>
> Hi Lee
>
> Since there could be more than one devices attached to the system, I am using this counter to track the index of each device.
> How would you suggest to do it? Thanks

Why do you need to track how many there are?

We don't usually do that at all.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog