regulator: A couple of fixes for 3.4

One small fix for an edge condition in the max8997 driver and a fix for
 a surprise in the devres API which caused devm_regulator_put() to not
 actually put the regulator - a nicer version of this based on an
 improvement of the devres API is queued for 3.5.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPp99CAAoJEBus8iNuMP3d7VwP/387BkvdNpC0UwWKomSJ9G2+
 bwRXqKGUcRX2yB1EBs+jPyx1kUk1J/a2iVeJ3oC54gPWLOB/lbMvld9wRMqziplq
 0bTR+Hjeflh+WAAhnGHHvKZR+lxT3oz8FjESq9xVQYroB6ZLSCfbf9FWO2wcfyzo
 Pc/qa0UOV98UPYPvcAG2ixBn/VLL6jAZNupnwPcWb9tVlGWeyHakLMS46oJnESGw
 wUUYSWaxEQzvNx91DqeRdJmvINh9WjT4nwQMeoiUGnAXc2wpm0mUu9Ac+c0fMcd5
 NG/ojZX7kLB8sgjWNG9IQrYaxz53F7LaqyOwmOAI/ld16hp/6SPT+fgIBR64cR3s
 4UmjLnr5EYjiumzztz5QyGs+BlbVSgUy5z615c4vGpwxfPL/MQ54K8ngW3hQWZiH
 GH6TvQncxigoPjwB3OJwxXozCCEmYOqRDAP9C7CvKcZzVehUyaDCRPSwCr0NRnj2
 /bZXRlVOeWmXO2eN9Tr/l1kLY6S13gMkldLDcbJFykko1DD422bV3nsXU24EF0uD
 Rxb+S1WA1Hd435DYYTEnh727LLvECO8bOQQ0f7hqEO5Dv+pfqzd8afVn+KQdNK7v
 wN4w2MdgtvoEfTy6ciVDXBJR1/NR5uJsA6ryzo7N092e3vn7f8DQOHFyk4slHHBp
 23gCXM7LYO6cUdJqMv9K
 =Q7eh
 -----END PGP SIGNATURE-----

Merge tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "One small fix for an edge condition in the max8997 driver and a fix
  for a surprise in the devres API which caused devm_regulator_put() to
  not actually put the regulator - a nicer version of this based on an
  improvement of the devres API is queued for 3.5."

* tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: Actually free the regulator in devm_regulator_put()
  regulator: Fix the logic to ensure new voltage setting in valid range
This commit is contained in:
Linus Torvalds 2012-05-08 11:49:30 -07:00
commit 1eef1600af
2 changed files with 5 additions and 2 deletions

View File

@ -1431,7 +1431,10 @@ void devm_regulator_put(struct regulator *regulator)
rc = devres_destroy(regulator->dev, devm_regulator_release,
devm_regulator_match, regulator);
WARN_ON(rc);
if (rc == 0)
regulator_put(regulator);
else
WARN_ON(rc);
}
EXPORT_SYMBOL_GPL(devm_regulator_put);

View File

@ -684,7 +684,7 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev,
}
new_val++;
} while (desc->min + desc->step + new_val <= desc->max);
} while (desc->min + desc->step * new_val <= desc->max);
new_idx = tmp_idx;
new_val = tmp_val;