Re: [PATCH v2 1/1] regmap: Drop unused devm_regmap_*_free() APIs

Andy Shevchenko
2025-01-16T17:51:56Z

On Thu, Jan 16, 2025 at 04:41:36PM +0000, Mark Brown wrote:
> On Thu, Jan 16, 2025 at 06:24:50PM +0200, Andy Shevchenko wrote:
> > On Thu, Jan 16, 2025 at 04:15:05PM +0000, Mark Brown wrote:
>
> > > This just seems unhelpful, there's fairly obvious uses for something
> > > like this where we decide we can't actually use some things based on
> > > what we discover during probe.
>
> > It's an effectively dead code. I rarely see people are using devm_*_free(), and
> > when it's so, it is most likely by misunderstanding of the concept. For what you
> > described I don't remember any _practical_ use case. Theoretically any dead code
> > is useful, but it's not the point, right?
>
> The use case would be to read some ID registers in a subfeature then
> decide that it's not supported for some reason so we'll just ignore it
> at runtime. Given that you're also complaining about there being no
> current users there doesn't seem to be much problem with misuse.

Yeah no users — no misuse :-)

--
With Best Regards,
Andy Shevchenko