regulator: provide rdev_get_regmap()
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 9 Jan 2019 17:44:00 +0000 (18:44 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 9 Jan 2019 18:36:44 +0000 (18:36 +0000)
Provide a helper allowing to access regulator's regmap.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c
include/linux/regulator/driver.h

index 3f9d81b6e763b6de22a15242587e3c9b026b0852..430a73dea487b5c9ed3467663ecbaaf520a57ed7 100644 (file)
@@ -5251,6 +5251,12 @@ struct device *rdev_get_dev(struct regulator_dev *rdev)
 }
 EXPORT_SYMBOL_GPL(rdev_get_dev);
 
+struct regmap *rdev_get_regmap(struct regulator_dev *rdev)
+{
+       return rdev->regmap;
+}
+EXPORT_SYMBOL_GPL(rdev_get_regmap);
+
 void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data)
 {
        return reg_init_data->driver_data;
index 389bcaf7900f6ab733618801b69450441c6cc356..795b38a06b6c2ec5644f79757f877fe4da5f90ce 100644 (file)
@@ -503,6 +503,7 @@ int regulator_notifier_call_chain(struct regulator_dev *rdev,
 
 void *rdev_get_drvdata(struct regulator_dev *rdev);
 struct device *rdev_get_dev(struct regulator_dev *rdev);
+struct regmap *rdev_get_regmap(struct regulator_dev *rdev);
 int rdev_get_id(struct regulator_dev *rdev);
 
 int regulator_mode_to_status(unsigned int);