diff options
| author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-01-21 09:08:40 -0500 |
|---|---|---|
| committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2009-03-31 04:56:22 -0400 |
| commit | 1fa9ad52b07811ebf258f3f6907de8dbf020ec2d (patch) | |
| tree | bf2c73e87ed15f2d5e5619392fbc4359b3ca8b08 | |
| parent | fefdae42465facfa26d41a7f0010f1ade32c3386 (diff) | |
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.c | 27 | ||||
| -rw-r--r-- | include/linux/regulator/driver.h | 32 |
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); | |||
| 30 | static LIST_HEAD(regulator_map_list); | 30 | static LIST_HEAD(regulator_map_list); |
| 31 | 31 | ||
| 32 | /* | 32 | /* |
| 33 | * struct regulator_dev | ||
| 34 | * | ||
| 35 | * Voltage / Current regulator class device. One for each regulator. | ||
| 36 | */ | ||
| 37 | struct regulator_dev { | ||
| 38 | struct regulator_desc *desc; | ||
| 39 | int use_count; | ||
| 40 | |||
| 41 | /* lists we belong to */ | ||
| 42 | struct list_head list; /* list of all regulators */ | ||
| 43 | struct list_head slist; /* list of supplied regulators */ | ||
| 44 | |||
| 45 | /* lists we own */ | ||
| 46 | struct list_head consumer_list; /* consumers we supply */ | ||
| 47 | struct list_head supply_list; /* regulators we supply */ | ||
| 48 | |||
| 49 | struct blocking_notifier_head notifier; | ||
| 50 | struct mutex mutex; /* consumer lock */ | ||
| 51 | struct module *owner; | ||
| 52 | struct device dev; | ||
| 53 | struct regulation_constraints *constraints; | ||
| 54 | struct regulator_dev *supply; /* for tree */ | ||
| 55 | |||
| 56 | void *reg_data; /* regulator_dev data */ | ||
| 57 | }; | ||
| 58 | |||
| 59 | /* | ||
| 60 | * struct regulator_map | 33 | * struct regulator_map |
| 61 | * | 34 | * |
| 62 | * Used to provide symbolic supply names to devices. | 35 | * 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 { | |||
| 137 | struct module *owner; | 137 | struct module *owner; |
| 138 | }; | 138 | }; |
| 139 | 139 | ||
| 140 | /* | ||
| 141 | * struct regulator_dev | ||
| 142 | * | ||
| 143 | * Voltage / Current regulator class device. One for each | ||
| 144 | * regulator. | ||
| 145 | * | ||
| 146 | * This should *not* be used directly by anything except the regulator | ||
| 147 | * core and notification injection (which should take the mutex and do | ||
| 148 | * no other direct access). | ||
| 149 | */ | ||
| 150 | struct regulator_dev { | ||
| 151 | struct regulator_desc *desc; | ||
| 152 | int use_count; | ||
| 153 | |||
| 154 | /* lists we belong to */ | ||
| 155 | struct list_head list; /* list of all regulators */ | ||
| 156 | struct list_head slist; /* list of supplied regulators */ | ||
| 157 | |||
| 158 | /* lists we own */ | ||
| 159 | struct list_head consumer_list; /* consumers we supply */ | ||
| 160 | struct list_head supply_list; /* regulators we supply */ | ||
| 161 | |||
| 162 | struct blocking_notifier_head notifier; | ||
| 163 | struct mutex mutex; /* consumer lock */ | ||
| 164 | struct module *owner; | ||
| 165 | struct device dev; | ||
| 166 | struct regulation_constraints *constraints; | ||
| 167 | struct regulator_dev *supply; /* for tree */ | ||
| 168 | |||
| 169 | void *reg_data; /* regulator_dev data */ | ||
| 170 | }; | ||
| 171 | |||
| 140 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | 172 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, |
| 141 | struct device *dev, struct regulator_init_data *init_data, | 173 | struct device *dev, struct regulator_init_data *init_data, |
| 142 | void *driver_data); | 174 | void *driver_data); |
