diff mbox

[v1,2/3] regmap: add dummy regmap_can_raw_write() to header

Message ID 1460569154-25030-3-git-send-email-srinivas.kandagatla@linaro.org
State New
Headers show

Commit Message

Srinivas Kandagatla April 13, 2016, 5:39 p.m. UTC
This patch adds dummy function for regmap_can_raw_write() in the header
file, so that the code can be atleast compiled without regmap enabled.
This kind of setup is mostly tested using randomconfig or zero
day-testing.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

---
 include/linux/regmap.h | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
2.5.0

Comments

Mark Brown April 14, 2016, 6:45 a.m. UTC | #1
On Wed, Apr 13, 2016 at 06:39:13PM +0100, Srinivas Kandagatla wrote:
> This patch adds dummy function for regmap_can_raw_write() in the header

> file, so that the code can be atleast compiled without regmap enabled.

> This kind of setup is mostly tested using randomconfig or zero

> day-testing.


I'm not convinced that this isn't flagging real problems - it's hard to
see how code can safely and sensibly be written which would use this
without a dependency on regmap (and given that and the fact that we have
no external users we should probably make it internal to the API).
diff mbox

Patch

diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index be3da4c..c060b9b 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -1052,6 +1052,12 @@  static inline bool regmap_can_raw_read(struct regmap *map)
 	return false;
 }
 
+static inline bool regmap_can_raw_write(struct regmap *map)
+{
+	WARN_ONCE(1, "regmap API is disabled");
+	return false;
+}
+
 static inline int regmap_register_patch(struct regmap *map,
 					const struct reg_sequence *regs,
 					int num_regs)