From c9bf5426f15517266195e9b13971cbc50f105b2c Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Tue, 13 Nov 2012 09:48:51 +0100 Subject: [PATCH] --- yaml --- r: 335649 b: refs/heads/master c: f0f98b19e23d4426ca185e3d4ca80e6aff5ef51b h: refs/heads/master i: 335647: f357351bf12ca13d11caae088ae8d50c4c4a5ad5 v: v3 --- [refs] | 2 +- trunk/drivers/regulator/core.c | 30 ++++++++++++------------------ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/[refs] b/[refs] index 5ace69f188bf..3605f2ea8798 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 23ff2f0f6128b4c310fbb274dbb91cc2f9b6ab06 +refs/heads/master: f0f98b19e23d4426ca185e3d4ca80e6aff5ef51b diff --git a/trunk/drivers/regulator/core.c b/trunk/drivers/regulator/core.c index 3ebc06b280ab..27eb9d66f06a 100644 --- a/trunk/drivers/regulator/core.c +++ b/trunk/drivers/regulator/core.c @@ -1381,14 +1381,22 @@ struct regulator *regulator_get_exclusive(struct device *dev, const char *id) } EXPORT_SYMBOL_GPL(regulator_get_exclusive); -/* Locks held by regulator_put() */ -static void _regulator_put(struct regulator *regulator) +/** + * regulator_put - "free" the regulator source + * @regulator: regulator source + * + * Note: drivers must ensure that all regulator_enable calls made on this + * regulator source are balanced by regulator_disable calls prior to calling + * this function. + */ +void regulator_put(struct regulator *regulator) { struct regulator_dev *rdev; if (regulator == NULL || IS_ERR(regulator)) return; + mutex_lock(®ulator_list_mutex); rdev = regulator->rdev; debugfs_remove_recursive(regulator->debugfs); @@ -1404,20 +1412,6 @@ static void _regulator_put(struct regulator *regulator) rdev->exclusive = 0; module_put(rdev->owner); -} - -/** - * regulator_put - "free" the regulator source - * @regulator: regulator source - * - * Note: drivers must ensure that all regulator_enable calls made on this - * regulator source are balanced by regulator_disable calls prior to calling - * this function. - */ -void regulator_put(struct regulator *regulator) -{ - mutex_lock(®ulator_list_mutex); - _regulator_put(regulator); mutex_unlock(®ulator_list_mutex); } EXPORT_SYMBOL_GPL(regulator_put); @@ -1980,7 +1974,7 @@ int regulator_is_supported_voltage(struct regulator *regulator, if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) { ret = regulator_get_voltage(regulator); if (ret >= 0) - return (min_uV >= ret && ret <= max_uV); + return (min_uV <= ret && ret <= max_uV); else return ret; } @@ -3451,7 +3445,7 @@ regulator_register(const struct regulator_desc *regulator_desc, scrub: if (rdev->supply) - _regulator_put(rdev->supply); + regulator_put(rdev->supply); if (rdev->ena_gpio) gpio_free(rdev->ena_gpio); kfree(rdev->constraints);