Re: [PATCH 1/2] regmap: cache: Do not panic for REGCACHE_NONE regmap

From: Mark Brown
Date: Fri Mar 10 2023 - 09:22:32 EST


On Fri, Mar 10, 2023 at 02:35:13PM +0100, Alexander Stein wrote:
> Am Freitag, 10. März 2023, 14:02:13 CET schrieb Mark Brown:

> > Why would we be trying to do a regcache_sync() on a device with
> > no cache?

> Indeed, that makes no sense. That's indicating a bug in a driver, but why do
> we need to panic the kernel in this case?

You're trying to change this to silently ignore the call which
isn't going to make anything happy.

> On the other hand the same question applies to other regcache related
> functions currently checking for non-cached maps. There is no common
> behaviour:

> panic:
> * regcache_sync
> * regcache_sync_region

These are only ever triggered from a client driver, nothing in
regmap will ever sync the regmap without being explicitly asked
to.

> returning -ENOSYS:
> * regcache_read

> returning success (0):
> * regcache_write

> early return (void return value):
> * regcache_exit

These are all called transparently as part of the regmap core
regardless of if there is a cache, users never directly read or
write values to the cache.

Attachment: signature.asc
Description: PGP signature