From 72b39f6f2b5a6b0beff14b80bed9756f151218a9 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 8 May 2012 17:44:40 +0100 Subject: regmap: Implement dev_get_regmap() Use devres to implement dev_get_regmap(). This should mean that in almost all cases devices wishing to take advantage of framework features based on regmap shouldn't need to explicitly pass the regmap into the framework. This simplifies device setup a bit. Signed-off-by: Mark Brown --- include/linux/regmap.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/linux/regmap.h b/include/linux/regmap.h index f6abc8d33d6..90a4652eaae 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -156,6 +156,7 @@ struct regmap *devm_regmap_init_mmio(struct device *dev, void regmap_exit(struct regmap *map); int regmap_reinit_cache(struct regmap *map, const struct regmap_config *config); +struct regmap *dev_get_regmap(struct device *dev, const char *name); int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); int regmap_raw_write(struct regmap *map, unsigned int reg, const void *val, size_t val_len); @@ -340,6 +341,13 @@ static inline int regmap_register_patch(struct regmap *map, return -EINVAL; } +static inline struct regmap *dev_get_regmap(struct device *dev, + const char *name) +{ + WARN_ONCE(1, "regmap API is disabled"); + return NULL; +} + #endif #endif -- cgit v1.2.3-70-g09d2