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

Commit 2049c030 authored by Kiran Gunda's avatar Kiran Gunda
Browse files

regulator: qpnp-amoled: Fix uninitialized variable warning



Variable 'rc' is used without being initialized. Fix it by
initializing it. While at it, return 'rc' instead of '0' at
the end of the function.

Change-Id: I33e33a4fff9c9d63d2c20de5971fbb417e01433c
Signed-off-by: default avatarKiran Gunda <kgunda@codeaurora.org>
parent ba3a7712
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -233,7 +233,7 @@ static int qpnp_ab_ibb_regulator_set_mode(struct regulator_dev *rdev,
						unsigned int mode)
{
	struct qpnp_amoled *chip  = rdev_get_drvdata(rdev);
	int rc;
	int rc = 0;

	if (mode != REGULATOR_MODE_NORMAL && mode != REGULATOR_MODE_STANDBY &&
		mode != REGULATOR_MODE_IDLE) {
@@ -276,7 +276,7 @@ static int qpnp_ab_ibb_regulator_set_mode(struct regulator_dev *rdev,
error:
	if (rc < 0)
		pr_err("Failed to configure for mode %d\n", mode);
	return 0;
	return rc;
}

static unsigned int qpnp_ab_ibb_regulator_get_mode(struct regulator_dev *rdev)