Commit 020501f1 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

regulator: Remove NULL test before calling regulator_unregister()



It's safe to call regulator_unregister() with NULL, thus remove the NULL test
before regulator_unregister() calls.

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@sirena.org.uk>
parent 1e4b545c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -232,7 +232,6 @@ static int max1586_pmic_remove(struct i2c_client *client)
	int i;

	for (i = 0; i <= MAX1586_V6; i++)
		if (max1586->rdev[i])
		regulator_unregister(max1586->rdev[i]);
	return 0;
}
+2 −4
Original line number Diff line number Diff line
@@ -275,10 +275,8 @@ static int max8649_regulator_remove(struct i2c_client *client)
{
	struct max8649_regulator_info *info = i2c_get_clientdata(client);

	if (info) {
		if (info->regulator)
	if (info)
		regulator_unregister(info->regulator);
	}

	return 0;
}
+1 −2
Original line number Diff line number Diff line
@@ -426,7 +426,6 @@ static int max8660_remove(struct i2c_client *client)
	int i;

	for (i = 0; i < MAX8660_V_END; i++)
		if (max8660->rdev[i])
		regulator_unregister(max8660->rdev[i]);
	return 0;
}
+2 −4
Original line number Diff line number Diff line
@@ -923,7 +923,6 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
	return 0;
err:
	for (i = 0; i < s5m8767->num_regulators; i++)
		if (rdev[i])
		regulator_unregister(rdev[i]);

	return ret;
@@ -936,7 +935,6 @@ static int s5m8767_pmic_remove(struct platform_device *pdev)
	int i;

	for (i = 0; i < s5m8767->num_regulators; i++)
		if (rdev[i])
		regulator_unregister(rdev[i]);

	return 0;
+1 −2
Original line number Diff line number Diff line
@@ -584,7 +584,6 @@ static int pmic_remove(struct spi_device *spi)
	if (!hw)
		return 0;
	for (i = 0; i < N_REGULATORS; i++) {
		if (hw->rdev[i])
		regulator_unregister(hw->rdev[i]);
		hw->rdev[i] = NULL;
	}