Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a919cf0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
  regulator: wm8350-regulator - fix the logic of checking REGULATOR_MODE_STANDBY mode
  regulator: wm831x-ldo - fix the logic to set REGULATOR_MODE_IDLE and REGULATOR_MODE_STANDBY modes
  regulator: ab8500 - fix off-by-one value range checking for selector
  regulator: 88pm8607 - fix value range checking for accessing info->vol_table
  regulator: isl6271a-regulator - fix regulator_desc parameter for regulator_register()
  regulator: ad5398 - fix a memory leak
  regulator: Update e-mail address for Liam Girdwood
  regulator: set max8998->dev to &pdev->dev.
  regulator: tps6586x-regulator - fix bit_mask parameter for tps6586x_set_bits()
  regulator: tps6586x-regulator - fix value range checking for val
  regulator: max8998 - set max8998->num_regulators
  regulator: max8998 - fix memory allocation size for max8998->rdev
  regulator: tps6507x - remove incorrect comments
  regulator: max1586 - improve the logic of choosing selector
  regulator: ab8500 - fix the logic to remove already registered regulators in error path
  regulator: ab3100 - fix the logic to remove already registered regulators in error path
  regulator/ab8500: move dereference below the check for NULL
parents 94ca9d66 8ecee36a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ regulators (where voltage output is controllable) and current sinks (where
current limit is controllable).

(C) 2008  Wolfson Microelectronics PLC.
Author: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Author: Liam Girdwood <lrg@slimlogic.co.uk>


Nomenclature
+2 −2
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ static int pm8607_list_voltage(struct regulator_dev *rdev, unsigned index)
	struct pm8607_regulator_info *info = rdev_get_drvdata(rdev);
	int ret = -EINVAL;

	if (info->vol_table && (index < (2 << info->vol_nbits))) {
	if (info->vol_table && (index < (1 << info->vol_nbits))) {
		ret = info->vol_table[index];
		if (info->slope_double)
			ret <<= 1;
@@ -233,7 +233,7 @@ static int choose_voltage(struct regulator_dev *rdev, int min_uV, int max_uV)
		max_uV = max_uV >> 1;
	}
	if (info->vol_table) {
		for (i = 0; i < (2 << info->vol_nbits); i++) {
		for (i = 0; i < (1 << info->vol_nbits); i++) {
			if (!info->vol_table[i])
				break;
			if ((min_uV <= info->vol_table[i])
+1 −4
Original line number Diff line number Diff line
@@ -634,12 +634,9 @@ static int __devinit ab3100_regulators_probe(struct platform_device *pdev)
				"%s: failed to register regulator %s err %d\n",
				__func__, ab3100_regulator_desc[i].name,
				err);
			i--;
			/* remove the already registered regulators */
			while (i > 0) {
			while (--i >= 0)
				regulator_unregister(ab3100_regulators[i].rdev);
				i--;
			}
			return err;
		}

+4 −5
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ static int ab8500_list_voltage(struct regulator_dev *rdev, unsigned selector)
	if (info->fixed_uV)
		return info->fixed_uV;

	if (selector > info->voltages_len)
	if (selector >= info->voltages_len)
		return -EINVAL;

	return info->supported_voltages[selector];
@@ -344,13 +344,14 @@ static inline struct ab8500_regulator_info *find_regulator_info(int id)
static __devinit int ab8500_regulator_probe(struct platform_device *pdev)
{
	struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
	struct ab8500_platform_data *pdata = dev_get_platdata(ab8500->dev);
	struct ab8500_platform_data *pdata;
	int i, err;

	if (!ab8500) {
		dev_err(&pdev->dev, "null mfd parent\n");
		return -EINVAL;
	}
	pdata = dev_get_platdata(ab8500->dev);

	/* register all regulators */
	for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) {
@@ -368,11 +369,9 @@ static __devinit int ab8500_regulator_probe(struct platform_device *pdev)
			dev_err(&pdev->dev, "failed to register regulator %s\n",
					info->desc.name);
			/* when we fail, un-register all earlier regulators */
			i--;
			while (i > 0) {
			while (--i >= 0) {
				info = &ab8500_regulator_info[i];
				regulator_unregister(info->regulator);
				i--;
			}
			return err;
		}
+6 −6
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ struct ad5398_chip_info {
	unsigned int current_level;
	unsigned int current_mask;
	unsigned int current_offset;
	struct regulator_dev rdev;
	struct regulator_dev *rdev;
};

static int ad5398_calc_current(struct ad5398_chip_info *chip,
@@ -211,7 +211,6 @@ MODULE_DEVICE_TABLE(i2c, ad5398_id);
static int __devinit ad5398_probe(struct i2c_client *client,
				const struct i2c_device_id *id)
{
	struct regulator_dev *rdev;
	struct regulator_init_data *init_data = client->dev.platform_data;
	struct ad5398_chip_info *chip;
	const struct ad5398_current_data_format *df =
@@ -233,9 +232,10 @@ static int __devinit ad5398_probe(struct i2c_client *client,
	chip->current_offset = df->current_offset;
	chip->current_mask = (chip->current_level - 1) << chip->current_offset;

	rdev = regulator_register(&ad5398_reg, &client->dev, init_data, chip);
	if (IS_ERR(rdev)) {
		ret = PTR_ERR(rdev);
	chip->rdev = regulator_register(&ad5398_reg, &client->dev,
					init_data, chip);
	if (IS_ERR(chip->rdev)) {
		ret = PTR_ERR(chip->rdev);
		dev_err(&client->dev, "failed to register %s %s\n",
			id->name, ad5398_reg.name);
		goto err;
@@ -254,7 +254,7 @@ static int __devexit ad5398_remove(struct i2c_client *client)
{
	struct ad5398_chip_info *chip = i2c_get_clientdata(client);

	regulator_unregister(&chip->rdev);
	regulator_unregister(chip->rdev);
	kfree(chip);
	i2c_set_clientdata(client, NULL);

Loading