summaryrefslogtreecommitdiff
path: root/include/linux/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-03 23:46:53 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-04 14:43:26 +0400
commit65f26846b90611742f3b407cc538a1cad33abde8 (patch)
tree4da36021e30f3428f6382673eb45343450b78a03 /include/linux/regulator
parentdd775ae2549217d3ae09363e3edb305d0fa19928 (diff)
downloadlinux-65f26846b90611742f3b407cc538a1cad33abde8.tar.xz
regulator: core: Constify the regulator_desc passed in when registering
Drivers should be able to declare their descriptors const and the framework shouldn't ever be modifying the desciptor. Make the parameter and the pointer in regulator_dev const to enforce this. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/linux/regulator')
-rw-r--r--include/linux/regulator/driver.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index fa8b55b8191c..1dcdf00e0db2 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -184,7 +184,7 @@ struct regulator_desc {
* no other direct access).
*/
struct regulator_dev {
- struct regulator_desc *desc;
+ const struct regulator_desc *desc;
int exclusive;
u32 use_count;
u32 open_count;
@@ -210,7 +210,8 @@ struct regulator_dev {
struct dentry *debugfs;
};
-struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
+struct regulator_dev *
+regulator_register(const struct regulator_desc *regulator_desc,
struct device *dev, const struct regulator_init_data *init_data,
void *driver_data, struct device_node *of_node);
void regulator_unregister(struct regulator_dev *rdev);