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

Commit 34c1c460 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: fix dangling pointers
  lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic
  lp3971: Fix setting val for LDO2 and LDO4
  regulator: Get rid of lockdep warning
  regulator: handle kcalloc() failure
  Regulators: max8925-regulator - clean up driver data after removal
parents 61964eba 8b4709ec
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1038,6 +1038,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
			goto overflow_err;

		regulator->dev = dev;
		sysfs_attr_init(&regulator->dev_attr.attr);
		regulator->dev_attr.attr.name = kstrdup(buf, GFP_KERNEL);
		if (regulator->dev_attr.attr.name == NULL)
			goto attr_name_err;
+8 −2
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ static int lp3971_set_bits(struct lp3971 *lp3971, u8 reg, u16 mask, u16 val);
	LP3971_BUCK2 -> 4
	LP3971_BUCK3 -> 6
*/
#define BUCK_VOL_CHANGE_SHIFT(x) (((1 << x) & ~0x01) << 1)
#define BUCK_VOL_CHANGE_SHIFT(x) (((!!x) << 2) | (x & ~0x01))
#define BUCK_VOL_CHANGE_FLAG_GO 0x01
#define BUCK_VOL_CHANGE_FLAG_TARGET 0x02
#define BUCK_VOL_CHANGE_FLAG_MASK 0x03
@@ -187,7 +187,8 @@ static int lp3971_ldo_set_voltage(struct regulator_dev *dev,
		return -EINVAL;

	return lp3971_set_bits(lp3971, LP3971_LDO_VOL_CONTR_REG(ldo),
		LDO_VOL_CONTR_MASK << LDO_VOL_CONTR_SHIFT(ldo), val);
			LDO_VOL_CONTR_MASK << LDO_VOL_CONTR_SHIFT(ldo),
			val << LDO_VOL_CONTR_SHIFT(ldo));
}

static struct regulator_ops lp3971_ldo_ops = {
@@ -439,6 +440,10 @@ static int __devinit setup_regulators(struct lp3971 *lp3971,
	lp3971->num_regulators = pdata->num_regulators;
	lp3971->rdev = kcalloc(pdata->num_regulators,
				sizeof(struct regulator_dev *), GFP_KERNEL);
	if (!lp3971->rdev) {
		err = -ENOMEM;
		goto err_nomem;
	}

	/* Instantiate the regulators */
	for (i = 0; i < pdata->num_regulators; i++) {
@@ -461,6 +466,7 @@ static int __devinit setup_regulators(struct lp3971 *lp3971,
		regulator_unregister(lp3971->rdev[i]);
	kfree(lp3971->rdev);
	lp3971->rdev = NULL;
err_nomem:
	return err;
}

+1 −1
Original line number Diff line number Diff line
@@ -243,8 +243,8 @@ static int __devexit max1586_pmic_remove(struct i2c_client *client)
	for (i = 0; i <= MAX1586_V6; i++)
		if (rdev[i])
			regulator_unregister(rdev[i]);
	kfree(rdev);
	i2c_set_clientdata(client, NULL);
	kfree(rdev);

	return 0;
}
+2 −1
Original line number Diff line number Diff line
@@ -356,6 +356,7 @@ static int __devinit max8649_regulator_probe(struct i2c_client *client,
	dev_info(info->dev, "Max8649 regulator device is detected.\n");
	return 0;
out:
	i2c_set_clientdata(client, NULL);
	kfree(info);
	return ret;
}
@@ -367,9 +368,9 @@ static int __devexit max8649_regulator_remove(struct i2c_client *client)
	if (info) {
		if (info->regulator)
			regulator_unregister(info->regulator);
		i2c_set_clientdata(client, NULL);
		kfree(info);
	}
	i2c_set_clientdata(client, NULL);

	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -470,8 +470,8 @@ static int __devexit max8660_remove(struct i2c_client *client)
	for (i = 0; i < MAX8660_V_END; i++)
		if (rdev[i])
			regulator_unregister(rdev[i]);
	kfree(rdev);
	i2c_set_clientdata(client, NULL);
	kfree(rdev);

	return 0;
}
Loading