diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-03-14 13:12:33 +0000 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-03-14 13:12:33 +0000 |
commit | e1c1c69c8fc7656c33460c8e085ac0d0be22ac3b (patch) | |
tree | 3199753118adf26baf52841cb913afa77f549829 /drivers/base/regmap/regmap-i2c.c | |
parent | f5d6eba74b8aac7d4bf646c5445807aa6a247e6c (diff) | |
parent | c0eb46766d395da8d62148bda2e59bad5e6ee2f2 (diff) |
Merge remote-tracking branches 'regmap/topic/core' and 'regmap/topic/devm' into regmap-next
Diffstat (limited to 'drivers/base/regmap/regmap-i2c.c')
-rw-r--r-- | drivers/base/regmap/regmap-i2c.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap-i2c.c b/drivers/base/regmap/regmap-i2c.c index 38621ec87c0..9a3a8c56438 100644 --- a/drivers/base/regmap/regmap-i2c.c +++ b/drivers/base/regmap/regmap-i2c.c @@ -111,4 +111,21 @@ struct regmap *regmap_init_i2c(struct i2c_client *i2c, } EXPORT_SYMBOL_GPL(regmap_init_i2c); +/** + * devm_regmap_init_i2c(): Initialise managed register map + * + * @i2c: Device that will be interacted with + * @config: Configuration for register map + * + * The return value will be an ERR_PTR() on error or a valid pointer + * to a struct regmap. The regmap will be automatically freed by the + * device management code. + */ +struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c, + const struct regmap_config *config) +{ + return devm_regmap_init(&i2c->dev, ®map_i2c, config); +} +EXPORT_SYMBOL_GPL(devm_regmap_init_i2c); + MODULE_LICENSE("GPL"); |