summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown2009-01-21 15:08:40 +0100
committerLiam Girdwood2009-03-31 10:56:22 +0200
commit1fa9ad52b07811ebf258f3f6907de8dbf020ec2d (patch)
treebf2c73e87ed15f2d5e5619392fbc4359b3ca8b08
parentregulator: Mark attributes table for virtual regulator static (diff)
downloadkernel-qcow2-linux-1fa9ad52b07811ebf258f3f6907de8dbf020ec2d.tar.gz
kernel-qcow2-linux-1fa9ad52b07811ebf258f3f6907de8dbf020ec2d.tar.xz
kernel-qcow2-linux-1fa9ad52b07811ebf258f3f6907de8dbf020ec2d.zip
regulator: Hoist struct regulator_dev out of core to fix notifiers
Commit 872ed3fe176833f7d43748eb88010da4bbd2f983 caused regulator drivers to take the struct regulator_dev lock themselves which requires that the struct be visible to them. Band aid this by making the struct visible. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r--drivers/regulator/core.c27
-rw-r--r--include/linux/regulator/driver.h32
2 files changed, 32 insertions, 27 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index f17362ac9c61..0ed13c2a8c3c 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -30,33 +30,6 @@ static LIST_HEAD(regulator_list);
static LIST_HEAD(regulator_map_list);
/*
- * struct regulator_dev
- *
- * Voltage / Current regulator class device. One for each regulator.
- */
-struct regulator_dev {
- struct regulator_desc *desc;
- int use_count;
-
- /* lists we belong to */
- struct list_head list; /* list of all regulators */
- struct list_head slist; /* list of supplied regulators */
-
- /* lists we own */
- struct list_head consumer_list; /* consumers we supply */
- struct list_head supply_list; /* regulators we supply */
-
- struct blocking_notifier_head notifier;
- struct mutex mutex; /* consumer lock */
- struct module *owner;
- struct device dev;
- struct regulation_constraints *constraints;
- struct regulator_dev *supply; /* for tree */
-
- void *reg_data; /* regulator_dev data */
-};
-
-/*
* struct regulator_map
*
* Used to provide symbolic supply names to devices.
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 2254ad93b784..c263e36e564e 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -137,6 +137,38 @@ struct regulator_desc {
struct module *owner;
};
+/*
+ * struct regulator_dev
+ *
+ * Voltage / Current regulator class device. One for each
+ * regulator.
+ *
+ * This should *not* be used directly by anything except the regulator
+ * core and notification injection (which should take the mutex and do
+ * no other direct access).
+ */
+struct regulator_dev {
+ struct regulator_desc *desc;
+ int use_count;
+
+ /* lists we belong to */
+ struct list_head list; /* list of all regulators */
+ struct list_head slist; /* list of supplied regulators */
+
+ /* lists we own */
+ struct list_head consumer_list; /* consumers we supply */
+ struct list_head supply_list; /* regulators we supply */
+
+ struct blocking_notifier_head notifier;
+ struct mutex mutex; /* consumer lock */
+ struct module *owner;
+ struct device dev;
+ struct regulation_constraints *constraints;
+ struct regulator_dev *supply; /* for tree */
+
+ void *reg_data; /* regulator_dev data */
+};
+
struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
struct device *dev, struct regulator_init_data *init_data,
void *driver_data);