User: | Jiri Slaby |
Error type: | Double Unlock |
Error type description: | Some lock is unlocked twice unintentionally in a sequence |
File location: | drivers/regulator/core.c |
Line in file: | 1172 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
|
Entered: | 2011-11-07 22:20:57 UTC |
1142 /* notify other consumers that power has been forced off */ 1143 _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE, 1144 NULL); 1145 } 1146 1147 /* decrease our supplies ref count and disable if required */ 1148 if (rdev->supply) 1149 _regulator_disable(rdev->supply); 1150 1151 rdev->use_count = 0; 1152 return ret; 1153} 1154 1155/** 1156 * regulator_force_disable - force disable regulator output 1157 * @regulator: regulator source 1158 * 1159 * Forcibly disable the regulator output voltage or current. 1160 * NOTE: this *will* disable the regulator output even if other consumer 1161 * devices have it enabled. This should be used for situations when device 1162 * damage will likely occur if the regulator is not disabled (e.g. over temp). 1163 */ 1164int regulator_force_disable(struct regulator *regulator) 1165{ 1166 int ret; 1167 1168 mutex_lock(®ulator->rdev->mutex); 1169 regulator->enabled = 0; 1170 regulator->uA_load = 0; 1171 ret = _regulator_force_disable(regulator->rdev); 1172 mutex_unlock(®ulator->rdev->mutex); 1173 return ret; 1174} 1175EXPORT_SYMBOL_GPL(regulator_force_disable); 1176 1177static int _regulator_is_enabled(struct regulator_dev *rdev) 1178{ 1179 int ret; 1180 1181 mutex_lock(&rdev->mutex); 1182