diff options
| author | Evan Wilson <evan@oliodevices.com> | 2016-01-11 00:12:13 -0800 | 
|---|---|---|
| committer | Evan Wilson <evan@oliodevices.com> | 2016-01-27 15:14:06 -0800 | 
| commit | 594327ff44ea1b9e8c4124bcceae5bfd7f47a9ec (patch) | |
| tree | 4ac523dbdaa2a29bc7808f3e07467a2455de6fa4 /drivers/regulator/core.c | |
| parent | 49c7b2a6eb962e4692fb18dd064da48c7be40208 (diff) | |
| download | olio-linux-3.10-594327ff44ea1b9e8c4124bcceae5bfd7f47a9ec.tar.xz olio-linux-3.10-594327ff44ea1b9e8c4124bcceae5bfd7f47a9ec.zip | |
Adding a recovery mechanism to the accelerometer.
It will not hard reset the regulator if it detects a corrupt WAI register,
or if there has not been any accelerometer events in 20 minutes.
Change-Id: I3d55cb2edfba4861f7509b7cba4f1acc3efebb0e
Diffstat (limited to 'drivers/regulator/core.c')
| -rw-r--r-- | drivers/regulator/core.c | 5 | 
1 files changed, 4 insertions, 1 deletions
| diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 815d6df8bd5..75329f01037 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1824,8 +1824,11 @@ int regulator_force_disable(struct regulator *regulator)  	mutex_unlock(&rdev->mutex);  	if (rdev->supply) -		while (rdev->open_count--) +		while (rdev->open_count > 0) +		{ +			rdev->open_count--;  			regulator_disable(rdev->supply); +		}  	return ret;  } |