Unverified Commit 3e47b887 authored by Mark Brown's avatar Mark Brown
Browse files

regmap: Drop early readability check



We have some drivers that have a use case for cached write only
registers, doing read/modify/writes on read only registers in order to
work more easily with bitfields.  Go back to trying the cache before we
check if we can read from the device.

Fixes: eab5abde ("regmap: Check for register readability before checking cache during read")
Reported-by: default avatarKonrad Dybcio <konradybcio@kernel.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230615-regmap-drop-early-readability-v1-1-8135094362de@kernel.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 505cb70c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2897,9 +2897,6 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
	int ret;
	void *context = _regmap_map_get_context(map);

	if (!regmap_readable(map, reg))
		return -EIO;

	if (!map->cache_bypass) {
		ret = regcache_read(map, reg, val);
		if (ret == 0)
@@ -2909,6 +2906,9 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
	if (map->cache_only)
		return -EBUSY;

	if (!regmap_readable(map, reg))
		return -EIO;

	ret = map->reg_read(context, reg, val);
	if (ret == 0) {
		if (regmap_should_log(map))