]> git.baikalelectronics.ru Git - kernel.git/commit
regmap: Make regmap_noinc_read() return -ENOTSUPP if map->read isn't set
authorJavier Martinez Canillas <javierm@redhat.com>
Thu, 16 Jun 2022 07:34:34 +0000 (09:34 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 20 Jun 2022 10:35:37 +0000 (11:35 +0100)
commit5ffa58d760ec880ee12f0be6e88b530b3a9ac933
treefd2d77dfbf1766db76d591a5ed4c1a298523aa1f
parent9a1e2144f3b853dfa3432701a614d50a4eae80de
regmap: Make regmap_noinc_read() return -ENOTSUPP if map->read isn't set

Before adding support to define bulk read/write callbacks in regmap_config
by the commit 71ba7e7abdcd ("regmap: Add bulk read/write callbacks into
regmap_config"), the regmap_noinc_read() function returned an errno early
a map->bus->read callback wasn't set.

But that commit dropped the check and now a call to _regmap_raw_read() is
attempted even when bulk read operations are not supported. That function
checks for map->read anyways but there's no point to continue if the read
can't succeed.

Also is a fragile assumption to make so is better to make it fail earlier.

Fixes: 71ba7e7abdcd ("regmap: Add bulk read/write callbacks into regmap_config")
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20220616073435.1988219-3-javierm@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap.c